mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +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
48 lines
1.5 KiB
Markdown
48 lines
1.5 KiB
Markdown
# 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
|
|
|
|
```hcl
|
|
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 provided
|
|
- `max_budget` (Optional) - Requests fail if this budget in USD is exceeded
|
|
- `soft_budget` (Optional) - Requests do not fail if this is exceeded, but alerts fire
|
|
- `max_parallel_requests` (Optional) - Maximum concurrent requests allowed for this budget
|
|
- `tpm_limit` (Optional) - Maximum tokens per minute allowed for this budget
|
|
- `rpm_limit` (Optional) - Maximum requests per minute allowed for this budget
|
|
- `budget_duration` (Optional) - Budget reset period, e.g. `1hr`, `1d`, `28d`
|
|
- `model_max_budget` (Optional) - JSON string of per-model budget config, e.g. `jsonencode({"gpt-4o" = {max_budget = 10.0}})`
|
|
|
|
## Attribute Reference
|
|
|
|
- `id` - The budget ID
|
|
- `budget_reset_at` - Datetime when the budget is reset
|
|
|
|
## Import
|
|
|
|
Budgets can be imported using the budget ID:
|
|
|
|
```shell
|
|
terraform import litellm_budget.engineering <budget-id>
|
|
```
|