mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
* feat(terraform): close key/team schema gaps, fix team read envelope, add import support * feat(terraform): add fallback resource/data source and key/team block resources * feat(terraform): add access group and unified access group resources and data sources * feat(terraform): add guardrail and prompt resources and data sources * feat(terraform): add agent and search tool resources and data sources * feat(terraform): add user and budget resources and data sources * feat(terraform): add tag and project resources and data sources * docs(terraform): changelog and readme for parity additions * feat(terraform): add data sources for keys, teams, models, organizations, and mcp servers * fix(terraform): key update 400 on empty budget_duration, key info envelope, config-supplied key * fix(terraform): hash raw keys to SHA-256 tokens in key lookup URLs and block resource IDs
1.5 KiB
1.5 KiB
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>