mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* fix(proxy): size budget reservation from route output cap fields * fix(proxy): respect provider max_output_tokens on chat completions * fix(proxy): include chat cap fields for bridged responses reservations * fix(proxy): match deployment provider precedence for responses reservations * fix(proxy): preserve explicit null bridge overrides in responses budget reservation * fix(proxy): resolve budget hold providers without login and pin inferenceConfig scope Adds a regression test that inferenceConfig.maxTokens leaves the hold unchanged on /v1/chat/completions, /v1/messages, and /v1/responses while it still bounds the hold on Bedrock converse routes Provider lookups for the hold now use the metadata resolver, so a github_copilot or chatgpt deployment never starts a device login at auth time Removes the unused default path for the output field mode and the branches that the route and provider lookups already cover, and adds tests for an Infinity cap and a priced model the provider resolver rejects * fix(proxy): count every output cap in budget holds and include configured max_tokens The hold now takes the largest valid cap across every cap field the request sets, fills missing caps from router defaults and each deployment's litellm_params, and keeps the default fallback unless the route's own cap field is present. This drops the per-provider lookups. * fix(proxy): only let request caps lower budget holds Configured caps in default_litellm_params or a deployment's litellm_params are no longer read for the hold. A configured cap the provider drops could shrink the hold, and reading them made each estimate about 2.5x slower * fix(proxy): keep the uncapped hold when a deployment drops max_completion_tokens A chat call that sends only max_completion_tokens now lowers the hold only when every deployment in the group lists it in supported_openai_params. Providers like Replicate and watsonx drop it under drop_params and generate uncapped, so their groups keep the 16384-token default. The deployment model info is read once per estimate and shared with the tiered pricing lookup * fix(proxy): trust a budget hold cap only when every deployment receives it A cap field lowers the in-flight hold only when every deployment in the group forwards it to the provider, read from supported_openai_params or the provider's native cap name. Routes outside the call-type map (Cursor, the Claude Code gateway, Interactions) read only the cap of the shape they forward, and a responses max_output_tokens below 16 holds the forwarded minimum * fix(proxy): ignore budget hold caps named in additional_drop_params * fix(proxy): read the drop list the router sends when sizing budget holds * fix(proxy): keep the uncapped budget hold when a provider rejects the cap probe A ScaleDown chat call that carried max_output_tokens, maxTokens, or inferenceConfig.maxTokens failed auth with a 401, since the hold's per-provider cap lookup raised a provider config error it did not catch. The lookup now reads that error as a cap the provider does not receive * fix(proxy): multiply the budget hold by a configured n or best_of A deployment or router default that sets n or best_of returns that many choices per call, so the hold now reserves for them when the request sets neither * fix(budgets): hold the default output cap on generateContent routes --------- Co-authored-by: xinglan163 <250816997+xinglan163@users.noreply.github.com> Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| file_search | ||
| litellm_completion_transformation | ||
| mcp | ||
| additional_tools.py | ||
| bridge_check.py | ||
| dispatch.py | ||
| input_items_query.py | ||
| instructions_length.py | ||
| main.py | ||
| retrieve_stream_query.py | ||
| sse_output_recovery.py | ||
| streaming_iterator.py | ||
| utils.py | ||