SuperAPI AI Directory

litellm-cost-governance

Deployment & operations

View repository

Updated 10-15 21:11

About this skill

LiteLLM Cost Governance

Workflow

  1. Define governance boundaries and trusted sources for keys, users, teams, tags, models, and providers.
  2. Verify the LiteLLM version, licensing plan, Postgres/Redis requirements, and budget semantics.
  3. Create a virtual key, set the model allowlist, hard budget, duration or expiry, rate limits, and owner.
  4. Inject governance tags from a trusted server side; client-side tags may only be used for non-security-critical observability.
  5. Query spend logs, align time zones, token types, cache tokens, and the model cost map.
  6. Test behavior after overage, expiry, unauthorized models, and revocation.
  7. Revoke keys at the end of the course and retain audit evidence that does not contain secrets.

When key payloads, security settings, and core experiments are needed, read Experiments and References。

Security Baseline

  • Do not treat the master key as a student or general application key.
  • Do not trust client-modifiable metadata, user, or tag as authorization and budget boundaries.
  • Governance tags should be injected via key/team metadata, trusted hooks, or the server side.
  • Every temporary key must have an expiry, owner, model allowlist, and minimal budget.

Acceptance

  • After a key is created, its expiry, models, budget, and owner can be queried.
  • Expired, over-budget, revoked, and unauthorized model requests are all rejected.
  • Reports can answer who, which team, which activity, and which model spent how much.
  • Clients cannot forge security-critical cost attribution.