Commit graph

49820 commits

Author SHA1 Message Date
kerry-berri
9ae727bc8e
Merge pull request #40929 from BerriAI/litellm_fireworks_short_key_lookup
fix(fireworks): resolve short model names to long cost map keys
2026-09-12 20:49:44 -07:00
Devin AI
7a0ea9867d docs(fireworks): drop provider example from get_model_cost_key docstring
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 03:38:14 +00:00
Devin AI
f1fe61af06 docs(fireworks): explain what get_model_cost_key is for
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 03:36:00 +00:00
mateo-berri
299cd084f9 refactor(prompt_templates): share the tool use id sanitizer between the Anthropic and Bedrock paths 2026-09-12 20:29:16 -07:00
Devin AI
a519d805bb refactor(fireworks): resolve cost map key through a provider config hook
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 03:29:11 +00:00
mateo-berri
a635d7be6a fix(guardrails): write per-message guardrail rewrites back onto Responses input items
A guardrail that answers one rewritten text per message it saw no longer
matches the texts the Responses handler extracted once the request carries
instructions or tool items, so the rewrite was rejected with a 500. Spread
such an answer over the structured messages' text slots and write it back
through the structured path, have Prompt Security modify return
structured_messages directly, and give the chat completions pairing the same
named rejection instead of a silent misalignment when the counts differ.
2026-09-12 20:29:09 -07:00
Devin AI
0904051fda refactor(fireworks): move cost map key construction under llms/
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 03:24:23 +00:00
Mateo Wang
e240997529
Merge pull request #40912 from BerriAI/litellm_logging_worker_timeout_summary
fix(logging): log one bounded summary for a burst of timed-out LoggingWorker callbacks
2026-09-12 19:12:22 -07:00
joshua-berri
b7f4258e32
Merge pull request #40923 from BerriAI/litellm_fix_mcp_delegated_auth_tracking_6970
fix(mcp): require admission for delegated OAuth
2026-09-12 19:11:35 -07:00
devin-ai-integration[bot]
56045503db
fix(proxy): bound tool and guardrail index create_many by the spend-log statement budgets (#40561)
* fix(proxy): bound tool and guardrail index create_many by the spend-log statement budgets

One flush drains up to MAX_LOGS_PER_INTERVAL source transactions or logs, but a
transaction fans out to one LiteLLM_SpendLogToolIndex row per tool and a log
to one LiteLLM_SpendLogGuardrailIndex row per guardrail, so the index
create_many payload was unbounded. Both index writes now go through
spend_log_write_batches(SPEND_LOG_WRITE_BATCH_MAX_BYTES, SPEND_LOG_WRITE_BATCH_MAX_ROWS).
The tool index write moves out of the rollup batch_() so the split reduces
the query-engine payload; replayed index rows are no-ops under
skip_duplicates, and the daily rollup upserts stay in one transaction

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

* test(proxy): pin the row budget in the index fan-out tests

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-12 19:00:47 -07:00
ryan-crabbe-berri
67dd150fed
Merge pull request #36363 from joshgarnett/bugfix/responses-reasoning-object-to-effort
fix(responses): translate the reasoning object into a chat-completion reasoning effort
2026-09-12 18:52:25 -07:00
yuneng-jiang
16f6d92453
Merge pull request #40933 from BerriAI/litellm_internal_staging
chore(ci): promote internal staging to main
2026-09-12 18:51:00 -07:00
yuneng-jiang
0f16cff575
Merge pull request #40931 from BerriAI/litellm_/release-version-bump-6cf851
chore: rebuild Admin UI bundle from staging
2026-09-12 18:42:18 -07:00
Joshua Valluru
939fa4ee73 test(mcp): remove unrelated formatting changes 2026-09-12 18:27:20 -07:00
mateo-berri
0429c64504 fix(proxy): keep an empty duration out of the legacy update hook on key regenerate 2026-09-12 18:22:31 -07:00
yassin
566da87771 test(router): expect the exact error per retry-cap case and drop explanatory docstrings
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 01:20:46 +00:00
mateo-berri
3d22ee8f59 fix(logging): keep partial logging payloads intact when nothing needs truncating
Some checks failed
ai-gateway image / ai-gateway release image (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
2026-09-12 18:20:33 -07:00
Yuneng Jiang
d15edb8cc9
chore: update Next.js build artifacts (2026-09-13 01:20 UTC, node v24.19.0) 2026-09-12 18:20:05 -07:00
Joshua Valluru
f23ac2e197 docs: remove MCP evidence image from repository 2026-09-12 18:18:10 -07:00
ryan-crabbe-berri
a969319fb5
Merge pull request #36222 from BerriAI/litellm_lit_5292_model_info_pricing_filter
fix(model_management): stop persisting cost map pricing as a deployment override
2026-09-12 18:16:06 -07:00
yassin
555e321cf1 fix(router): record flat retry attempts and cap retries from attempted_retries
Router.log_retry used to copy the failed attempt's kwargs and metadata into
metadata.previous_models. Nothing downstream read those copies, but they carried
client credentials into spend logs and grew the payload on every retry. Each
attempt now leaves a flat record (model group, deployment id, exception type and
string, attempt number), which drops RETRY_BREADCRUMB_EXCLUDED_KWARGS and the
per-retry credential masking.

num_retries_per_request was enforced from len(previous_models), which only
looked at the metadata bucket and never exceeded four records. The sync and
async client wrappers and the Rust lifecycle guard now read attempted_retries
from whichever metadata bucket the call carries.

Resolves LIT-7505

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 01:05:51 +00:00
mateo-berri
6db93a930f test(e2e): skip the override strategy cells and describe the 1s cooldown cache 2026-09-12 17:56:23 -07:00
mateo-berri
cae009c387 fix(logging): datadog truncation no longer rewrites the shared standard logging payload 2026-09-12 17:56:23 -07:00
ryan-crabbe-berri
0c83e831db fix(responses): carry the reasoning summary as an alias, not inside reasoning_effort
The bridge probe asked `responses_api_bridge_check` with the summary read straight off
the Responses object, but `litellm.completion` reads it from `optional_params` via
`peek_reasoning_summary_aliases`, which the bridged request never populated. So gpt-5,
gpt-5.1 and azure/gpt-5 answered "bridging" to the probe and "not bridging" for real,
and the object still landed on Chat Completions, which only takes a string

`reasoning_effort` is now always the effort string, and `summary` rides the
`reasoning_summary` alias that main.py already reassembles into `{effort, summary}` on
the bridged path. The alias is emitted only when the probe says the model bridges, so
no chat provider ever sees it, and the probe is now asked with the exact params this
transform emits
2026-09-12 17:49:30 -07:00
mateo-berri
a94c060b84 fix(cost): fill the missing realtime cache-read rates 2026-09-12 17:48:00 -07:00
Mateo Wang
9d984371fd
Merge pull request #40909 from BerriAI/litellm_databricks_reasoning_effort_thinking
fix(databricks): translate reasoning_effort to thinking for Gemini 2.5
2026-09-12 17:46:44 -07:00
Devin AI
239bcbc214 fix(fireworks): resolve short model names to long cost map keys
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 00:44:30 +00:00
Joshua Garnett
216af3826e fix(responses): log the bridge check failure lazily
The debug call built its message with an f-string, which
test_logging_calls_do_not_build_their_message_eagerly rejects. Pass the exception
as a %-style argument so the message is only built when the log is emitted.
2026-09-12 17:42:05 -07:00
Joshua Garnett
3d648b7fe1 fix(responses): pass api_base to the responses bridge check
The bridge probe called responses_api_bridge_check without api_base, so it
resolved the OpenAI base from globals and environment rather than from the
request, while litellm.completion runs the same check with the caller's value.

Today the two cannot disagree: this path always supplies a reasoning_effort,
which short-circuits the endpoint term in the only arm that reads it. Passing it
anyway keeps the probe a faithful mirror of the definitive check rather than one
that happens to agree.
2026-09-12 17:42:05 -07:00
Joshua Garnett
1d5ed79931 fix(responses): translate the reasoning object into a chat-completion reasoning effort
The Responses API takes reasoning as an object, {effort, summary}. Chat
Completions takes reasoning_effort as a string enum and has no equivalent of
summary, but the completion bridge forwarded the whole object whenever summary
was set, which agentic clients set on every request.

Bedrock Converse guards its mapping with isinstance(value, str) and has no else
branch, so the object fell through, thinking was never enabled, and the caller
was billed for a non-thinking turn with nothing in the response to explain it.

The object is still forwarded for the one caller that can consume it: a model
whose cost-map mode is responses, which litellm.completion bridges back onto the
Responses API and reassembles {effort, summary} there. That decision is delegated
to responses_api_bridge_check, the same check litellm.completion runs, rather
than a second copy of the rule that could drift from it. An object carrying no
effort now yields no reasoning_effort at all.
2026-09-12 17:42:05 -07:00
yassin
f41c8556b5 feat(jwt): allow virtual_key_claim_field per issuer
Multi-IdP deployments can now set virtual_key_claim_field and
unregistered_jwt_client_behavior on a JWTIssuerConfig entry. Tokens from
that issuer use the issuer-specific claim path and no-match policy for the
virtual key mapping lookup; issuers that omit them keep the global values.
The auth flow now enters the mapping lookup when any issuer configures the
field, not only when the global field is set.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 00:41:08 +00:00
mateo-berri
a159c7d98e fix(proxy): write the requested object permission row only after the key policy allows the update 2026-09-12 17:38:23 -07:00
ryan-crabbe-berri
76cb0fec1c fix(model_management): stop persisting cost map pricing as a deployment override
/model/info fills a deployment's missing pricing in from the model cost map so the
Admin UI has a rate to display. Clients echo that whole model_info blob back on save,
and update_db_model merged it into the row, so editing an unrelated setting turned
that day's catalog price into a real per-deployment override. After that the
deployment ignored the cost map and Reload Price Data could no longer move it,
because the reload replays each deployment's stored pricing over the fresh catalog.

Drop the derived pricing from incoming model_info on the two write paths. The
drop-set is read off the same objects the read path uses, CustomPricingLiteLLMParams
plus the tiered *_above_N_tokens pattern that get_model_info passes through and no
model declares, so it cannot drift as new rates are added. output_vector_size is
exempt: it lives on the pricing model but is an embedding dimension, not a rate.

A deployment's own pricing still rides litellm_params, which is untouched, as is the
explicit-null clear, which reads the incoming model rather than the filtered dict.
The filter sits in the endpoint bodies rather than _add_model_to_db, which master-key
rotation reuses to re-serialize every stored deployment.
2026-09-12 17:29:35 -07:00
Joshua Valluru
f33bac8080 test(mcp): model delegated hook credentials 2026-09-12 17:29:26 -07:00
mateo-berri
c15f3e9228 fix(cli): decode codex debug models output as UTF-8
Some checks failed
ai-gateway image / ai-gateway release image (push) Has been cancelled
2026-09-12 17:29:09 -07:00
Joshua Valluru
364e466210 fix(mcp): strip duplicate delegated credentials 2026-09-12 17:18:54 -07:00
yassin
8577d63ff5 fix(proxy): forward provider request id headers on mapped error responses
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 00:14:49 +00:00
mateo-berri
c69f2fe7de style(logging): drop explanatory comments per repo no-comments policy 2026-09-12 17:03:40 -07:00
Joshua Valluru
97b964dd9a fix(mcp): prevent delegated admission key forwarding 2026-09-12 17:00:21 -07:00
mateo-berri
4b84c83788 fix(cost): split the cache read breakdown at the audio cache-read rate 2026-09-12 16:59:23 -07:00
mateo-berri
15721e52ef fix(cli): mark proxy-served stock Codex models as selectable with an API key
Codex hides catalog entries whose supported_in_api is false when it runs
with an API key, so a stock entry the proxy serves now carries
supported_in_api true alongside its list visibility.
2026-09-12 16:50:50 -07:00
mateo-berri
defead0eab fix(logging): keep tracebacks for callback-raised timeouts and flush the summary on stop 2026-09-12 16:48:46 -07:00
Joshua Valluru
e2d888bb91 docs: add MCP auth fix evidence 2026-09-12 16:48:20 -07:00
ryan-crabbe-berri
d4a72e7372
Merge pull request #40907 from BerriAI/litellm_key_alias_substring_non_admin
fix(proxy): allow key_alias substring matching on /key/list for non-admins
2026-09-12 16:48:17 -07:00
mateo-berri
5b9153f5ea feat(cli): keep the installed Codex's entries for proxy models it already knows
`lite codex` now asks the installed Codex for its own model list through
`codex debug models` before writing the catalog. A proxy model whose id
matches a stock Codex slug keeps that Codex's entry (reasoning levels,
base instructions, context window and the rest) and only its picker
position, visibility and upgrade nudge come from the proxy. Unknown slugs
still get the plain entry built from the bundled base instructions. The
catalog directory is created before the stock call so a fresh CODEX_HOME
does not make Codex refuse to run
2026-09-12 16:42:52 -07:00
mateo-berri
fc62df33c2 fix(proxy): resolve rotation and permission fields before the key policy and pin the effective-row contract 2026-09-12 16:42:20 -07:00
Joshua Valluru
94e4dd725f fix(mcp): require admission for delegated OAuth 2026-09-12 16:41:23 -07:00
shivam
59c4cf9439 refactor(responses): build InputTokensDetails without post-construction mutation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-12 23:37:07 +00:00
mateo-berri
68509daeaf refactor(logging): keep the timeout summary window a plain constant
Drop the unrequested env override on LOGGING_WORKER_TIMEOUT_SUMMARY_WINDOW_SECONDS.
The constructor still accepts a value for tests, so runtime behavior is unchanged.
2026-09-12 16:33:43 -07:00
mateo-berri
710d4ae2a3 fix(vertex-live): charge the fixed cost margin once per Live session 2026-09-12 16:33:31 -07:00