Skip to content

LiteLLMBudget ​

Defines a reusable budget / rate-limit tier registered with a LiteLLM proxy via the REST API (POST /budget/new). Other resources reference it by budget_id instead of repeating inline limits — e.g. LiteLLMVirtualKey.spec.budgetId or LiteLLMInstance.spec.defaultCustomerBudget.budgetId.

API Version: litellm.palena.ai/v1alpha1Kind: LiteLLMBudgetShort Name: lb

Example ​

yaml
apiVersion: litellm.palena.ai/v1alpha1
kind: LiteLLMBudget
metadata:
  name: tier-standard
spec:
  instanceRef:
    name: my-gateway
  budgetId: tier-standard   # stable id others reference; defaults to metadata.name
  maxBudget: 100.0
  softBudget: 80.0
  budgetDuration: 30d
  tpmLimit: 100000
  rpmLimit: 1000
  maxParallelRequests: 20

Spec Fields ​

FieldTypeRequiredDescription
instanceRefInstanceRefYesReference to the LiteLLMInstance
budgetIdstringNoStable identifier other resources reference (sent as budget_id). Defaults to metadata.name
maxBudget*float64NoMaximum budget in USD
softBudget*float64NoAlert threshold in USD below maxBudget (does not block)
budgetDurationstringNoReset interval (e.g. 1d, 7d, 30d)
tpmLimit*intNoTokens-per-minute limit
rpmLimit*intNoRequests-per-minute limit
maxParallelRequests*intNoMaximum concurrent requests
modelMaxBudgetmap[string]float64NoPer-model budget caps in USD (model name → max budget)

Status Fields ​

FieldTypeDescription
syncedboolWhether the budget is synced to LiteLLM
litellmBudgetIdstringThe budget_id assigned/used in LiteLLM
currentSpend*float64Current spend in USD, refreshed from /budget/info
lastSyncTime*TimeLast successful sync time
conditions[]ConditionStandard conditions

Referencing a budget ​

Assign the tier to a key by budget_id:

yaml
apiVersion: litellm.palena.ai/v1alpha1
kind: LiteLLMVirtualKey
metadata:
  name: app-key
spec:
  instanceRef:
    name: my-gateway
  budgetId: tier-standard   # → the LiteLLMBudget above

The operator deletes the budget from LiteLLM when the CR is removed (finalizer). Deleting a budget still referenced by keys is a LiteLLM-side concern — remove or repoint the references first.

Released under the Apache 2.0 License.