Commit graph

52707 commits

Author SHA1 Message Date
devin-ai-integration[bot]
537e8ac068
feat(cost): warn and count $0 cost on billable requests (#42345)
* feat(cost): warn and count $0 cost on billable requests

A request that carries usage but prices to $0 on a model whose pricing
entry has a non-zero rate now logs one warning naming the model, the
pricing entry, and the missing rate, and increments
litellm_zero_cost_requests_total{requested_model, model, model_id,
api_provider, reason}. Free models (every used rate is 0), requests
without usage, and unmapped models stay silent. The diagnostic rides on
the standard logging payload as zero_cost_diagnostic

* fix(cost): keep the zero-cost diagnostic importable on 3.10 and recursion-free

* fix(cost): warn once per request when a $0 result is priced again

* fix(cost): judge a free deployment by its own pricing and keep it silent on calculator errors

* fix(cost): warn once per request when a usage-less evaluation sits between two zero-cost findings

* fix(cost): judge zero-cost findings by the priced entry, skip cache hits, count failure rows

* test(cost): type the zero-cost diagnostic test helpers

* test(logging): flag a $0 terminal Responses stream event by its inner response

* chore: restore the lazy OpenAPI snapshot as CI's Python 3.12 generates it

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-21 19:49:26 -07:00
devin-ai-integration[bot]
1106b16745
feat(openrouter): price typesafe/jev-1.13 and add an openrouter decisions pass-through (#42301) 2026-09-22 02:44:15 +00:00
devin-ai-integration[bot]
5d3d99eb9f
fix(proxy): drop cost-map metadata echoed back on model save (#41944)
* fix(proxy): drop cost-map metadata echoed back on model save

Filter unchanged cost-map fields from model-info save echoes while preserving edited overrides.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): drop a stored override when an echoed save resets it to the cost-map value

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): compare model_info echo against the deployment's cost-map lookup

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): decrypt the stored model before the cost-map lookup

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): treat a reset to the bundled catalog value as an echo even after router registration

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): compare the reset against the catalog as loaded, not only the bundled backup

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(types): type the catalog snapshot and echo filter parameters as Mapping[str, object]

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(proxy): inject the loaded catalog into update_db_model instead of patching the class

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(proxy): use contextlib.suppress for cost-map lookup miss to stay under BLE001 budget

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: ryan <ryan@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:33:16 -07:00
devin-ai-integration[bot]
5a764205a5
fix(fal_ai): price non-canonical image sizes from the nearest row and honour dump options (#42336)
* fix(fal_ai): price non-canonical image sizes from the nearest row and honour dump options

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(fal_ai): drop monkeypatched mixed pricing case

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(fal_ai): use the default dimensions constant directly

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fal_ai): forward nested include and exclude when dumping image data

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fal_ai): honour pydantic item selectors in image data serializer

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fal_ai): match negative item selectors in image data serializer

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:19:18 -07:00
devin-ai-integration[bot]
8b33da7bb3
feat(proxy): opt-in litellm_call_id in JSON error bodies (#42391)
* feat(proxy): opt-in litellm_call_id in JSON error bodies

Add general_settings.include_call_id_in_error_body. When true, the value
already on the x-litellm-call-id response header is copied into JSON error
bodies: as error.litellm_call_id on the OpenAI-shaped routes, /v1/messages,
and streaming first-chunk errors, and as a top-level litellm_call_id on
pass-through routes. Off by default, so error bodies stay byte-identical
unless an admin opts in

* chore(proxy): drop helper docstring and restore lazy OpenAPI snapshot

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-21 19:17:18 -07:00
devin-ai-integration[bot]
b833e1fc4c
feat(fal_ai): add flux-lora-depth image edits and moondream3 chat completions (#42334)
* feat(fal_ai): add flux-lora-depth image edits and moondream3 chat completions

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(fal_ai): retrigger codecov processing

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fal_ai): reject multi-turn and system messages for moondream3 chat

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fal_ai): return 400 for invalid moondream3 chat requests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fal_ai): reject moondream3 responses missing output or usage

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(fal_ai): reject streaming moondream3 requests before dispatch

stream never reaches optional_params, so the transform_request check could not fire; reject in _complete_fal_ai on ctx.stream

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:01:28 -07:00
devin-ai-integration[bot]
5dc6261ebb
fix(bedrock): sign batch S3 requests with s3_access_key_id and s3_secret_access_key (#42342)
* fix(bedrock): sign batch S3 requests with s3_access_key_id and s3_secret_access_key

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(bedrock): keep S3 signer test additions scoped to new cases

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(bedrock): drop e2e suite changes from the S3 signing fix

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(bedrock): build S3 credentials directly from the s3_* pair so ambient AWS_* env never mixes in

Restores the split-identity e2e coverage

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:01:18 -07:00
devin-ai-integration[bot]
b720909dac
fix(bedrock): send every Mantle beta in the anthropic-beta header on the bedrock/mantle route (#42376)
- fix(bedrock): send every Mantle beta in the anthropic-beta header on the bedrock/mantle route
- refactor(bedrock): type the Mantle header helper and build the header fields in one comprehension
2026-09-21 18:52:29 -07:00
kerry-berri
3bbbf7f693
Merge pull request #42385 from BerriAI/litellm_fix_responses_stream_cost_breakdown
fix(logging): price terminal Responses stream events from their inner response
2026-09-21 18:47:13 -07:00
Mateo Wang
5eb4e30f29
Merge pull request #42352 from BerriAI/litellm_mcp_tools_camelcase_keys
fix(mcp): return camelCase tool keys from /v1/mcp/tools after the SDK 2 upgrade
2026-09-21 18:46:17 -07:00
kerry-berri
5b9983e680
Merge pull request #42389 from BerriAI/litellm_fix_agent_read_through_test_isolation
test(proxy): isolate the agent read-through singleton between unknown-agent tests
2026-09-21 18:45:49 -07:00
kerry
41d6acaa97 test(proxy): isolate the agent read-through singleton between unknown-agent tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:34:31 +00:00
kerry-berri
ee73e6391e
Merge pull request #42384 from BerriAI/litellm_xai_manual_price_sync
feat(pricing): add xai grok-4.20 aliases and image token prices from /v1/language-models
2026-09-21 18:32:10 -07:00
kerry-berri
d8627938aa
Merge pull request #42386 from BerriAI/litellm_remove_openrouter_union_alpha
fix(openrouter): remove the retired stealth/union-alpha model from the cost map
2026-09-21 18:23:20 -07:00
jesus-berri
f6d5b28443
Merge pull request #39578 from Louis-Vauterin/jwt-key-mapping-token-id
feat(jwt-key-mapping): accept token_id as an alternative to the plaintext key
2026-09-21 18:22:54 -07:00
kerry
d3cf820c48 fix(pricing): keep function calling disabled on xai multi-agent rows
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:21:58 +00:00
kerry
2f6a9eb073 test(logging): drop docstring from terminal event pricing test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:20:44 +00:00
kerry
f7b11b3430 style(logging): ruff format litellm_logging.py
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:17:20 +00:00
kerry
839cb268fd fix(openrouter): remove the retired stealth/union-alpha model from the cost map
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:13:51 +00:00
kerry
3ae43d35a1 fix(logging): price terminal Responses stream events from their inner response
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:13:20 +00:00
kerry
52ae9534ad feat(pricing): add xai grok-4.20 aliases and image token prices from /v1/language-models
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:08:11 +00:00
yuneng-jiang
a59ecfb7c5
Merge pull request #42367 from BerriAI/litellm_team_usage_export_per_user
feat(ui): add per-user breakdown to team usage export
2026-09-21 18:07:54 -07:00
kerry
1dacb03ad9 test(integration): allow unmanaged response ids and serve fal h3 video bytes without auth
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:05:48 +00:00
kerry
c798ef6d03 fix(responses): price the completed response, not the terminal event, in post-success hooks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 01:05:48 +00:00
Mateo Wang
2044483974
Merge pull request #42379 from BerriAI/litellm_rust_semantic_followup
fix(cache): keep native Redis semantic binding and Qdrant batch writes after merge
2026-09-21 17:59:41 -07:00
tin-berri
275c0c4d96
Merge pull request #42057 from BerriAI/litellm_classifier_forecast_cards
feat(ui): show Capability and FUSE v2 routing forecasts
2026-09-21 17:55:25 -07:00
kerry-berri
d22a6806df
Merge pull request #42377 from BerriAI/litellm-providers/price-sync-openrouter
chore(prices): sync OpenRouter prices: 4 models
2026-09-21 17:44:04 -07:00
Yujong Lee
397d0b4824 fix(cache): keep native Redis semantic binding and Qdrant batch writes after merge
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 00:41:24 +00:00
yuneng
49126d4434 test(ui): pin the clock in the per-user export filename test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 00:34:59 +00:00
berriai-litellm-provider-info-sync[bot]
66d197f56c
chore(prices): sync OpenRouter prices: 4 models
openrouter/~deepseek/deepseek-pro-latest: off_peak_pricing, input_cost_per_token, output_cost_per_token, cache_read_input_token_cost
openrouter/~z-ai/glm-latest: input_cost_per_token, output_cost_per_token, cache_read_input_token_cost
openrouter/deepseek/deepseek-v4-pro-0813: off_peak_pricing, input_cost_per_token, output_cost_per_token, cache_read_input_token_cost
openrouter/z-ai/glm-5.3: input_cost_per_token, output_cost_per_token, cache_read_input_token_cost
2026-09-22 00:31:00 +00:00
yujonglee
cc9970efbf
Merge pull request #42324 from BerriAI/litellm_rust_qdrant_semantic_cache
Some checks are pending
Unit Tests: Documentation Validation / documentation (push) Waiting to run
Unit Tests: Proxy DB Operations / assert-shard-coverage (push) Waiting to run
Unit Tests: Proxy DB Operations / auth-checks (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / budgets (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / custom-logging (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / db-and-spend (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / endpoints-and-responses (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / guardrails-hooks (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / jwt-and-keys (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / key-generation (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / logging-misc (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-runtime (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-server-core (push) Blocked by required conditions
Unit Tests: Proxy DB Operations / proxy-utils (push) Blocked by required conditions
Unit Tests / misc (push) Waiting to run
Unit Tests / caching-local (push) Waiting to run
Unit Tests / core-utils (push) Waiting to run
Unit Tests / enterprise-package (push) Waiting to run
Unit Tests / enterprise-routing (push) Waiting to run
Unit Tests / integrations (push) Waiting to run
Unit Tests / All Other Providers (push) Waiting to run
Unit Tests / Vertex AI (push) Waiting to run
Unit Tests / mcp-integration (push) Waiting to run
Unit Tests / proxy-auth (push) Waiting to run
Unit Tests / proxy-endpoints (push) Waiting to run
Unit Tests / proxy-extras (push) Waiting to run
Unit Tests / proxy-infra (push) Waiting to run
Unit Tests / proxy-server (push) Waiting to run
Unit Tests / responses-caching-types (push) Waiting to run
GitHub Actions Security Analysis / zizmor (push) Waiting to run
2026-09-21 17:30:30 -07:00
yuneng-jiang
79c7136292
Merge pull request #41794 from BerriAI/litellm_wt_0918_138e
test(e2e): cover chat and responses registry gaps
2026-09-21 17:27:09 -07:00
yuneng
86a019128e fix(ui): key per-user export buckets on a collision-free tuple
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 00:25:13 +00:00
Mateo Wang
9fad216030
Merge pull request #42295 from BerriAI/litellm_fix_azure_cancellederror_cooldown
fix(azure): propagate asyncio.CancelledError instead of raising a 500
2026-09-21 17:24:22 -07:00
yucheng-berri
12f79308cf
Merge pull request #42354 from BerriAI/litellm_fix_video_key_guardrails_lit_6685
* fix(guardrails): scan video prompts for key-attached guardrails on /v1/videos

/v1/videos dispatches call_type avideo_generation, which CallTypes did not
know and no guardrail translation handler covered, so the unified guardrail
hook returned the request unscanned. Add the video call types and an OpenAI
video guardrail translation package that scans the prompt for create, remix,
edit and extension requests

Resolves LIT-6685

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(ui): regenerate api types for video call types

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test: skip avideo_generation in azure sdk client exhaustive check

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(e2e): retry a leaked video job until the guardrail sync deadline

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(guardrails): satisfy the type-discipline gate in the video handler

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(guardrails): gate the video e2e on a chat probe so a miss starts at most one paid job

Addresses Greptile review: typed RewritingGuardrail override, dropped routine docstrings, and the e2e waits for the key guardrail to sync via /chat/completions before its single /v1/videos call

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 17:23:56 -07:00
mateo-berri
1c6c1e568d Merge remote-tracking branch 'origin/main' into litellm_mcp_tools_camelcase_keys 2026-09-21 17:21:46 -07:00
Yujong Lee
e3ca80b19a Merge origin/main into litellm_rust_qdrant_semantic_cache
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-22 00:19:34 +00:00
Yassin Kortam
9cc5b78c33
Merge pull request #41634 from BerriAI/litellm_agent_access_groups
feat(agents): attach access groups to agents and enforce them for models, MCP servers and agent calls
2026-09-21 19:13:46 -05:00
kerry-berri
17e3d314f0
Merge pull request #42371 from BerriAI/litellm-providers/price-sync-openrouter
chore(prices): sync OpenRouter prices: 4 models
2026-09-21 17:10:29 -07:00
tin-berri
24f616b637
Merge pull request #42356 from BerriAI/litellm_cli_footer_version_guard
fix(cli): preserve newer installed status lines during setup
2026-09-21 17:09:38 -07:00
yujonglee
ef8103a5a8
Merge pull request #42319 from BerriAI/litellm_native_redis_semantic_cache
feat(cache): serve Redis Semantic caches natively in Rust
2026-09-21 17:05:49 -07:00
Yuneng Jiang
d90da59ac7
Merge branch 'main' into litellm_wt_0918_138e
Resolve conflicts in the e2e Responses suite: main replaced the bespoke
EndpointsClient with provider SDK clients (76bf0cd579), so the four added
Vertex and Azure OpenAI /v1/responses tests are ported onto the OpenAI SDK
and tool_choice=required now comes from the SDK instead of a custom
request model.
2026-09-21 17:05:35 -07:00
tin-berri
094a60bb9c
Merge pull request #41872 from BerriAI/litellm_context_escalation_opt_in
fix(router): make context-window escalation opt-in
2026-09-21 17:03:33 -07:00
yucheng-berri
99e284106d
Merge pull request #41213 from BerriAI/litellm_spend_log_cleanup_cancel_outcome
fix(proxy): record aborted outcome when spend-log cleanup is cancelled at shutdown
2026-09-21 17:03:25 -07:00
yuneng-jiang
1f4b595072
Merge pull request #41788 from BerriAI/litellm_config_read_source
feat(proxy): report the source of alerting, UI and router settings on read
2026-09-21 17:02:18 -07:00
berriai-litellm-provider-info-sync[bot]
c8252a50f5
chore(prices): sync OpenRouter prices: 4 models
openrouter/~deepseek/deepseek-pro-latest: input_cost_per_token, output_cost_per_token, cache_read_input_token_cost, off_peak_pricing
openrouter/deepseek/deepseek-v4-flash: input_cost_per_token, output_cost_per_token, cache_read_input_token_cost
openrouter/deepseek/deepseek-v4-pro: input_cost_per_token, output_cost_per_token, cache_read_input_token_cost
openrouter/deepseek/deepseek-v4-pro-0813: input_cost_per_token, output_cost_per_token, cache_read_input_token_cost, off_peak_pricing
2026-09-22 00:01:01 +00:00
yuneng-jiang
8d4ef24496
Merge pull request #41795 from BerriAI/litellm_wt_0918_5836
test(router): cover legacy lowest TPM selection
2026-09-21 16:57:19 -07:00
Yujong Lee
69b7224aef test(python-bridge): initialize the interpreter in the embedder seed test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 23:56:40 +00:00
yuneng-jiang
a158aa878f
Merge pull request #41773 from BerriAI/litellm_dashboard-form-happy-paths
test(ui): cover dashboard form journeys
2026-09-21 16:56:25 -07:00
Tin Chi Lo
9221109d18 chore(router): resolve merge conflict with main 2026-09-21 16:52:47 -07:00