Free models and budgets
A model whose input_cost_per_token and output_cost_per_token are both set to 0 costs nothing, so LiteLLM skips budget checks for requests to it. A key, user or team that has used up its budget is still rejected on paid models but keeps working on the free one. This makes free or self-hosted models a fallback that budget-exhausted callers can still reach.
Both prices must be set explicitly to 0 on the deployment, in its litellm_params or its model_info. A model whose prices are unset or null is treated as paid, even when LiteLLM's built-in price list has it at $0, and budget checks still apply to it.
How it works
LiteLLM decides per model group, from the prices of every deployment the group routes to. A group's price is the highest of its deployments, so a group that mixes free and paid deployments counts as paid. A deployment that bills provisioned throughput as a flat hourly cost, with ptu_count and cost_per_ptu_per_hour in its model_info, is never free even with zero token prices. For chat, completions, responses and messages requests, LiteLLM judges the model the request is served by after key, team and router model aliases, so an alias that points at a paid model is not free. A request that names several models skips budget checks only when every one of them is free.
The request is still logged and its spend recorded, at $0, so it never uses up any budget. Rate limits and model access rules still apply.
When to use it
Price a model at zero when it costs you nothing per request: a model you host yourself with Ollama or vLLM, a free tier, or capacity you already pay for on a flat contract. A team that runs out of budget can then keep working on that model instead of stopping, which suits coding tools and internal assistants that should degrade rather than fail.
A model that costs money to run should keep a real price, even when you want it to stay reachable, since a $0 price also records its usage at $0 in spend reports. See Custom pricing. To limit how much a free model is used, use rate limits, which still apply to it. To keep a capped key running at reduced speed on paid models instead, use throttling.
Supported scopes
Supported means a request to a free model skips that scope's budget check. Nothing is set per scope: pricing the model at zero covers every scope marked Yes.
| Scope | Supported | How to set it |
|---|---|---|
| Whole proxy | Yes | litellm_settings.max_budget is not checked. |
| Organization | Yes | The organization's max_budget is not checked. |
| Team | Yes | The team's max_budget, its budget_limits windows and its per-model budgets are not checked. |
| Team member | Yes | The member's budget in the team and the per-model caps a team sets for its members are not checked. |
| Project | Yes | The project's max_budget is not checked. |
| Virtual key | Yes | The key's max_budget, budget_limits windows and model_max_budget are not checked. |
| Internal user | Yes | The personal max_budget, budget_limits windows and model_max_budget are not checked. |
| Customer | Yes | Legacy end-user budgets, including their per-model budgets, are not checked. Customer Management budgets and their windows are still checked. |
| Tag | Yes | Tags created with /tag/new are not checked. Tags in litellm_settings.tag_budget_config are still enforced by the router. |
| Model access group | Yes | The group's max_budget is not checked. |
| AI tool | Yes | The team's per AI tool limits, and each member's, are not checked. |
| Agent session | No | max_budget_per_session is still checked before each call. |
How to use it
Price the model at zero
Set both cost fields explicitly to 0 in config.yaml:
model_list:
- model_name: my-free-model
litellm_params:
model: ollama/llama3
api_base: http://localhost:11434
input_cost_per_token: 0
output_cost_per_token: 0
The same two fields work under the deployment's model_info, and in the litellm_params or model_info of a /model/new or /model/update request for models stored in the database. Give every deployment in the model group the zero price, since one paid deployment makes the whole group paid.
Check it
Send a request to the free model with a key that has used up its budget. It succeeds and its x-litellm-response-cost header shows a cost of 0, while the same key's requests to a paid model fail with budget_exceeded.
curl 'http://0.0.0.0:4000/v1/chat/completions' \
-H 'Authorization: Bearer sk-...' \
-H 'Content-Type: application/json' \
-d '{"model": "my-free-model", "messages": [{"role": "user", "content": "hello"}]}'
Limits
Whether a model is free comes from its per-token prices. A deployment whose input_cost_per_token and output_cost_per_token are 0 but that bills by another unit, such as input_cost_per_second, still counts as free, so its requests skip budget checks while they record spend. Leave the per-token fields unset on such a deployment.
Budget checks run once, at authentication, before the router picks a fallback. When a free model falls back to a paid one through the router's fallbacks, general_settings.enforce_fallback_budget Since v1.103.0, on by default, re-checks only the key's max_budget, the owner's personal max_budget where it applies, and the team member's per-model caps before the paid fallback runs. Team, organization, project and other budgets are not re-checked, so avoid paid fallbacks on a free model when those budgets matter. When LiteLLM's own rate limits refuse a request to a free model before the call, the proxy tries only the free models among its fallbacks. See Enforce budget on fallbacks.
Free requests take no budget reservation, since they cannot move a counter.
Related
Custom pricing covers setting model prices, Budget exceeded errors covers what a refused request receives, and Budgets and spend limits covers every scope a request is checked against.