VeloxAI
Quay lại Blog
Reliability· 8 phút đọc

Readiness trung thực: vì sao 'coming soon' tạo niềm tin hơn 'fake active'

AI platforms phụ thuộc nhiều services. Hiển thị configured/unconfigured/degraded trung thực ngăn incidents, xây dựng niềm tin và giúp operators ngủ ngon.

VeloxAI Engineering
VeloxAI EngineeringDoi ky thuat VeloxAI
#readiness#reliability#operations
API readiness trung thực
API readiness trung thực

Tôi từng tham gia team có dashboard hiển thị mọi model 'active' — chấm xanh khắp nơi. Trông đẹp đến khi khách thử Gemini và nhận 500 error. API key hết hạn hai tuần trước nhưng readiness check hardcode return true. Khách mất hai ngày debug. Trải nghiệm đó định hình cách tôi nghĩ về readiness.

Bốn states, không hơn

  • Configured: Dependency đã kết nối, tested, responding trong latency chấp nhận được. Xanh nghĩa là thật.
  • Unconfigured: Cần setup. Feature tồn tại trong code nhưng chưa có credentials. Hiển thị setup guide, không phải error.
  • Degraded: Respond nhưng latency hoặc error rate cao. Hoạt động nhưng nên dùng cẩn thận. Hiển thị warning với metrics hiện tại.
  • Coming soon: Chưa implemented. Không hứa production API. Hiển thị estimated timeline nếu có, không bao giờ fake active.
// Cached readiness checks with timeouts
const store = new Map<string, ReadinessStatus>();

async function checkReadiness(provider: string) {
  const cache = store.get(provider);
  if (cache && Date.now() - cache.checkedAt < 30_000) return cache;
  try {
    const start = performance.now();
    const res = await fetch(healthUrl(provider), { signal: AbortSignal.timeout(5000) });
    const status = { state: res.ok ? "configured" : "degraded",
      latencyMs: Math.round(performance.now() - start), checkedAt: Date.now() };
    store.set(provider, status);
    return status;
  } catch {
    return { state: "unconfigured", checkedAt: Date.now(), error: "Health check failed" };
  }
}
Cached readiness với 5s timeout

Cập nhật:

Sẵn sàng dựng sản phẩm AI của bạn?

Bắt đầu free, route nhiều provider, đo chi phí và readiness trung thực ngay từ ngày đầu.