Commit graph

15520 commits

Author SHA1 Message Date
Yujong Lee
27bf5d9364 fix(rust): repair retained callback CI gates 2026-09-08 09:15:13 -07:00
Yujong Lee
3be0ced670 more xfail 2026-09-08 08:43:46 -07:00
Yujong Lee
d7b4cfb7f8 test(rust): xfail messages provider retry cases 2026-09-08 08:42:03 -07:00
Yujong Lee
d08d22642e fix(rust): preserve messages provider failures 2026-09-08 08:28:52 -07:00
Yujong Lee
42b8cd80be wip 2026-09-08 08:10:45 -07:00
Yujong Lee
a459ac932f fix(guardrails): validate logging-only mode with production integration coverage 2026-09-08 08:00:57 -07:00
Yujong Lee
02572d815f fix(rust): isolate callback tests and preserve messages logging lifecycle 2026-09-08 07:51:52 -07:00
Yujong Lee
0688d9e309 test tooling 2026-09-07 23:38:31 -07:00
Yujong Lee
87d1997155 test(rust): expand callback lifecycle coverage 2026-09-07 23:38:20 -07:00
Yujong Lee
b02c53cebc fix(rust): satisfy CI quality gates 2026-09-07 23:31:04 -07:00
Yujong Lee
aa8d8bf84b wip 2026-09-07 23:03:27 -07:00
Yujong Lee
94ce534b93 test(rust): strengthen native callback coverage 2026-09-07 22:41:27 -07:00
Yujong Lee
5b7ba86c30 wip 2026-09-07 22:02:46 -07:00
Yujong Lee
f1a5a6f47a test(rust): cover messages callbacks and streaming 2026-09-07 21:32:30 -07:00
Yujong Lee
969fa34968 wip 2026-09-07 20:58:41 -07:00
Yujong Lee
737c6946fb test(ocr): exercise native callbacks through public API 2026-09-07 19:55:27 -07:00
Yujong Lee
f250e3dded just pass lint 2026-09-07 19:49:54 -07:00
Yujong Lee
993ddf7214 done 2026-09-07 19:49:54 -07:00
Yujong Lee
bdd98cef46 test(ocr): pin cancellation callback parity 2026-09-07 19:49:54 -07:00
Yujong Lee
99efd4113e test(ocr): cover terminal callback sources 2026-09-07 19:49:54 -07:00
Yujong Lee
b1f74b3603 wip 2026-09-07 19:49:54 -07:00
Yujong Lee
5cb55a5efd wip 2026-09-07 19:49:54 -07:00
Yujong Lee
036007a4e9 cleanup 2026-09-07 19:49:37 -07:00
Yujong Lee
2ca2d106f7 wip 2026-09-07 19:49:37 -07:00
Yujong Lee
c6cd873266 wip 2026-09-07 19:49:19 -07:00
Yujong Lee
f1553ae9c3 wip 2026-09-07 19:49:05 -07:00
yujonglee
13df85cceb
test: add Rust extension pytest contract (#40181)
* test: add Rust extension pytest contract

* test: prove native OCR execution

* test: isolate Rust extension pytest collection

* ci: register Rust extension test coverage

* test: prove native OCR at wire boundary
2026-09-07 18:46:29 -07:00
yucheng-berri
9bc9104102
fix(proxy): log budget reservation notice once at config load (#40167)
* fix(proxy): log disable_budget_reservation notice once at config load

The disabled-budget-reservation reminder fired as a WARNING inside request
authentication, so every authenticated request on a proxy that deliberately
set the flag produced one warning line. The notice now runs once per worker
when general_settings loads, at INFO, and the request path only skips the
reservation. Reservation skipping and read-time budget checks are unchanged

* fix(proxy): keep budget notice sentinel with constants

* fix(proxy): expose shared budget notice state
2026-09-07 18:18:28 -07:00
tin-berri
1761fe236f
feat(complexity_router): add declarative custom dimensions to the heuristic scorer (#40156)
Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-07 18:17:30 -07:00
tin-berri
7da6fe54b5
fix: skip one-shot Claude Code cache injection (#40175) 2026-09-07 18:03:43 -07:00
Mateo Wang
26d589cd28
Merge pull request #39234 from BerriAI/litellm_fix_agent_mcp_grants
fix(mcp): clear error when an agent-bound key is denied a scoped MCP server + agent MCP grants in the UI
2026-09-07 18:02:16 -07:00
yucheng-berri
1009976c49
fix(bedrock): keep x-amzn-RequestId on chat error responses (#40089)
* fix(bedrock): keep x-amzn-RequestId on chat error responses

Bedrock chat error paths built BedrockError from only a status code and a
message, so the provider response headers were gone before exception mapping
ran and the proxy had nothing to forward. AWS support needs x-amzn-RequestId
to investigate a server-side error.

- converse and invoke chat handlers pass the real headers and response when
  they turn an httpx.HTTPStatusError into a BedrockError, and read the body
  through error_response_text so a streamed body nobody read does not throw
- every bedrock chat get_error_class honors the headers it is already handed:
  invoke, moonshot, bedrock-hosted openai, agentcore and the invoke agent
- BedrockError carries those headers into the response it synthesizes when a
  caller has headers but no response, skipping values httpx cannot carry
- the bedrock 500 mapping forwards the provider response like its 4xx and 503
  siblings instead of fabricating a blank one

The proxy now returns llm_provider-x-amzn-requestid on Bedrock chat errors.

* fix(bedrock): keep request-id on text-classified errors

The context-window and image branches of _map_bedrock_exception built their
litellm exception without the provider response, so a Bedrock 400 classified
by its body text lost x-amzn-RequestId while the sibling branches kept it.

Also narrows the new BedrockError types and trims its docstrings.

* chore(bedrock): drop the docstrings on the new error helpers

* fix(bedrock): keep request-id on every error path that has one

The ticket's root cause is that every BedrockError raise site under
litellm/llms/bedrock/ was built from status and message alone. The first
commits covered the chat and invoke handlers; this covers the rest.

Embeddings, rerank, image generation, image edit, count tokens, search and
the transformation layers now hand on the provider response or its headers,
and both bedrock_mantle configs return a BedrockError instead of the
OpenAI error that drops them.

Two blockers surfaced while verifying the streaming path. The trailing
`except Exception` in make_call and make_sync_call swallowed the BedrockError
raised a few lines above, relabelling a provider status as a 500, and the
non-200 branch read an unread streamed body, which throws.

The raise sites left alone have no provider response to carry: timeouts,
credential and config errors, and mid-stream event frames.

* fix(bedrock): forward provider headers from the count tokens route

The count tokens route converts BedrockError into an HTTPException, and dropped
the headers the handler had just kept, so that route still lost the request id.

get_response_headers now takes a Mapping so an httpx.Headers can be handed to it
without a copy.

* fix(bedrock): classify every bedrock surface through BedrockError

Eleven bedrock configs still inherited a provider-agnostic get_error_class
that builds a blank response, so the request id was gone before the proxy
read it. Claude platform, bedrock anthropic-messages, both image edit
configs, passthrough, realtime, vector stores and agentcore search now
return BedrockError, and a parametrized audit drives all 36 configs.

* fix(proxy): keep provider headers on the httpx status error branch

_handle_llm_api_exception forwards safe_headers on every branch except the
httpx.HTTPStatusError one, which the bedrock passthrough route reaches, so
the request id was dropped before the client saw the response.

* fix(bedrock): keep the request id on the timeout mappings

Timeout takes no response argument, so the three bedrock timeout branches
dropped the provider headers even when the upstream answered 408 or 504
with an x-amzn-RequestId. They now ride on the exception, already
llm_provider-prefixed, which is the form the proxy emits.

* fix(bedrock): keep the provider response on mapped timeouts

The previous round attached llm_provider-prefixed headers directly to the
Timeout. That shadowed the raw upstream headers for _get_response_headers,
so router cooldown and fallback cooldown stopped honouring retry-after on
bedrock 408/504 replies.

Give Timeout an optional response instead, the way every other mapped
bedrock exception already carries one. Retry logic reads the raw
retry-after off the response, and the proxy prefixes those headers on the
way out, so clients still see llm_provider-x-amzn-requestid.

* chore(bedrock): drop the explanatory comment on Timeout.response
2026-09-07 17:16:47 -07:00
mateo-berri
e01bb98960 merge: bring litellm_internal_staging into litellm_fix_agent_mcp_grants again
Staging moved by the auto-router classifier cost change (#40168) between the
first merge and its push; this merge picks it up so the PR merges cleanly
2026-09-07 16:36:55 -07:00
mateo-berri
5e4dec4b88 merge: bring litellm_internal_staging into litellm_fix_agent_mcp_grants
Take staging's test_bedrock_knowledgebase_hook.py, which drops the duplicate
embedding_executor parameter that turned the lint check red, and make the two
cross-module helpers this branch added public (raise_denied_scoped_mcp_access
and routes_through_gateway) so the private-usage budget stays at its base count
2026-09-07 16:35:40 -07:00
tin-berri
9d0c9b9382
feat(ui): itemize auto-router classification spend (#40168)
Resolves LIT-7141

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-07 16:29:19 -07:00
Mateo Wang
bb8fe4a32f
Merge pull request #39826 from BerriAI/litellm_lit_6348_fireworks_responses_api
feat(fireworks_ai): add native Responses API config
2026-09-07 16:15:58 -07:00
tin-berri
cd681a573f
fix(mcp): encrypt stored static headers and stdio environment (#40164)
Encrypt secret maps at the shared persistence boundary, preserve plaintext API/runtime views, and extend rotation and migration scanning to legacy rows.

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-07 16:03:06 -07:00
yuneng-jiang
8af624b5f5
Merge pull request #40162 from BerriAI/litellm_default_branch_tooling
ci: follow the default branch in development tooling
2026-09-07 15:56:30 -07:00
mateo-berri
18aa52d5e1 chore: merge litellm_internal_staging into litellm_lit_6348_fireworks_responses_api 2026-09-07 15:43:08 -07:00
yuneng-jiang
1646901170
Merge pull request #40041 from BerriAI/litellm_presidio_ui_user_story_e2e
test(e2e/ui): automate the RC checklist's Presidio guardrail walk
2026-09-07 15:41:33 -07:00
yuneng-jiang
41e4f1a8c8
Merge pull request #40038 from BerriAI/litellm_/guardrail-automation-testing-3ecd3d
test(guardrails): pin the presidio spend-log record and the UI's masked-entity persistence
2026-09-07 15:39:51 -07:00
Yuneng Jiang
15ba07f20d
ci: avoid duplicate default branch fetches 2026-09-07 15:28:01 -07:00
ryan-crabbe-berri
38683643e0
Merge pull request #40170 from BerriAI/litellm_chatgpt_add_model_provider
feat(ui): list the ChatGPT subscription provider in the Add Model form
2026-09-07 15:21:58 -07:00
Mateo Wang
058d260509
Merge pull request #38914 from BerriAI/litellm_fix_skills_hook_import_side_effect
fix(proxy): register SkillsInjectionHook at proxy startup instead of import time
2026-09-07 15:18:54 -07:00
Mateo Wang
0e9e2c01f3
Merge pull request #38806 from BerriAI/litellm_fix_mcp_test_connection_oauth_bearer
fix(mcp): forward staged credentials on /mcp-rest/test/connection like /test/tools/list
2026-09-07 15:18:35 -07:00
Mateo Wang
d0dd3ce2d8
Merge pull request #38869 from BerriAI/litellm_fix_guardrail_route_call_types
fix(guardrails): resolve generateContent routes and async-first passthrough call types
2026-09-07 15:15:51 -07:00
Mateo Wang
9eaf15bcf9
Merge pull request #38842 from BerriAI/litellm_fix_responses_reasoning_drop_params
fix(responses): drop unsupported reasoning param for openai non-reasoning models
2026-09-07 15:14:13 -07:00
ryan-crabbe-berri
bb2db2d3f8 test(proxy): drop docstrings from the Add Model provider tests
Move the only guidance worth keeping into the parity assertion message so a
failing run tells the contributor to add a catalog entry instead of growing
the frozen unlisted set.

Claude-Session: https://claude.ai/code/session_011Tn3657NkV6ojLqewL64Kb
2026-09-07 15:12:41 -07:00
ryan-crabbe-berri
8e5a12057a feat(ui): list the ChatGPT subscription provider in the Add Model form
The Add Model provider dropdown is driven entirely by provider_create_fields.json,
and chatgpt had no entry there, so the documented ChatGPT subscription setup was
unreachable from the Admin UI. Add the entry plus the dashboard enum, slug, logo and
placeholder mappings so the provider can be selected and its cost-map models listed.

The entry carries no credential fields on purpose: the chatgpt backend ignores
api_key and api_base and signs in through the device-code auth file on the proxy
host, so any field here would be inert.

Add a parity test that every LlmProviders value is either listed for Add Model or
frozen in an explicit unlisted set, so a new backend provider cannot silently miss
the dropdown again.

Claude-Session: https://claude.ai/code/session_011Tn3657NkV6ojLqewL64Kb
2026-09-07 14:55:43 -07:00
tin-berri
c5ec2eedc1
fix(spend): price caching savings on the billed request basis (#40160)
Resolves LIT-7137

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-07 21:41:05 +00:00