1.6 KiB
1.6 KiB
Session 6.6 — Items 5 & 6: System Health + Spend Column
Files
| File | Action | What |
|---|---|---|
src/lib/litellm.ts |
REPLACE | Added listTeams(), getLitellmHealth(), getGlobalSpend(), getPerTeamSpend() |
src/app/api/admin/health/route.ts |
NEW | Returns tenant phase counts, aggregate + per-tenant spend, vLLM & LiteLLM health |
src/components/admin/admin-panel.tsx |
REPLACE | Added "Health" tab (service indicators, tenant overview, spend cards) + "Spend (CHF)" column in tenants table |
patch-i18n-admin-health.mjs |
RUN ONCE | Patches all 4 i18n files with new admin keys |
Steps
- Drop in the 3 source files (overwrite existing)
- Run the i18n patcher from the portal root:
node patch-i18n-admin-health.mjs - Build and deploy
Environment Variables (optional)
VLLM_HEALTH_URL— defaults tohttp://vllm.inference.svc:8000. Set if your vLLM is elsewhere.LITELLM_INTERNAL_URL/LITELLM_MASTER_KEY— already configured.
Notes
- The health API uses
Promise.allSettledso a single service being down won't break the whole page. - Per-tenant spend is fetched from LiteLLM's
/team/listwhich returns the cumulativespendper team. This is mapped to tenant names viastatus.litellmTeamIdon the PiecedTenant CR. - The spend column in the tenants table piggybacks on the same health data — fetched once when switching to the tenants tab.
- If LiteLLM's
/team/listor/global/spendresponse format differs from what I assumed, you may need to adjust the parsing inlitellm.ts. The functions have fallbacks for common response shapes.