litellm/litellm-rust
Mikalai Karytka c54da063f2
fix(anthropic): send extra_body fields at the top level and forward the server-side fallback beta
extra_body passed to litellm.completion for an Anthropic model reached the
Messages API as a literal nested "extra_body" key, and Anthropic rejected the
request with "extra_body: Extra inputs are not permitted". That blocked every
Anthropic request field litellm doesn't model yet, including fallbacks

AnthropicConfig.transform_request now pops extra_body from the request params
and merges its keys into the wire body. The direct Anthropic, Vertex AI and
Azure paths all go through this transform. Paths on llm_http_handler, like
Bedrock invoke, already pop extra_body before transform_request, so nothing
is merged twice. EXTRA_BODY_ROUTING_KEYS is filtered out the same way as on
the OpenAI-compatible path, so extra_body can't change the requested model

fallbacks also needs the server-side-fallback-2026-07-01 beta, which the beta
filter dropped as unknown, so Anthropic still answered "fallbacks: Extra
inputs are not permitted". The beta is now forwarded for the anthropic
provider only, since Anthropic documents server-side fallback for its own API.
The Rust AnthropicBeta table mirrors the JSON config

The regression test drives litellm.completion end to end against a mock
transport and asserts the whole request body
2026-10-26 11:00:17 +01:00
..
.agents/skills refactor(rust): derive strum VariantArray and string conversions (#45434) 2026-10-08 21:24:49 +00:00
crates fix(anthropic): send extra_body fields at the top level and forward the server-side fallback beta 2026-10-26 11:00:17 +01:00
docs/adrs docs(rust): add ADRs for the Rust core (#45205) 2026-10-08 10:21:56 -07:00
.gitignore feat: add LiteLLM Rust workspace with Mistral OCR bridge (#31033) 2026-06-23 13:16:47 -07:00
AGENTS.md feat(rust): add native OpenRouter Responses (#46000) 2026-10-15 11:02:03 -07:00
Cargo.lock fix(security): stop trusting the compromised eMudhra root CA (#47670) 2026-10-22 02:09:52 +00:00
Cargo.toml fix(security): stop trusting the compromised eMudhra root CA (#47670) 2026-10-22 02:09:52 +00:00
clippy.toml feat(rust): add the MCP gateway (#43470) 2026-09-27 19:37:41 -07:00