The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
litellm_budget Resource
Manages a budget object on the LiteLLM proxy. Budgets can be attached to keys, teams, organizations, and end users to enforce spend limits
Example Usage
resource "litellm_budget" "engineering" {
budget_id = "engineering-monthly"
max_budget = 500.0
soft_budget = 400.0
budget_duration = "30d"
tpm_limit = 500000
rpm_limit = 5000
max_parallel_requests = 100
model_max_budget = jsonencode({
"gpt-4o" = {
max_budget = 100.0
budget_duration = "1d"
}
})
}
Argument Reference
budget_id(Optional, Forces new resource) - Unique ID for the budget. Generated by the server if not providedmax_budget(Optional) - Requests fail if this budget in USD is exceededsoft_budget(Optional) - Requests do not fail if this is exceeded, but alerts firemax_parallel_requests(Optional) - Maximum concurrent requests allowed for this budgettpm_limit(Optional) - Maximum tokens per minute allowed for this budgetrpm_limit(Optional) - Maximum requests per minute allowed for this budgetbudget_duration(Optional) - Budget reset period, e.g.1hr,1d,28dmodel_max_budget(Optional) - JSON string of per-model budget config, e.g.jsonencode({"gpt-4o" = {max_budget = 10.0}})
Attribute Reference
id- The budget IDbudget_reset_at- Datetime when the budget is reset
Import
Budgets can be imported using the budget ID:
terraform import litellm_budget.engineering <budget-id>