litellm/litellm-rust
Mikalai Karytka 9380f5ea01
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

fallbacks is also registered in BETA_GATED_FIELDS, so under drop_params a
request that doesn't end up sending the fallback beta, like a Vertex AI leg
or a deployment without the header, drops fallbacks with a warning instead
of getting a 400

The regression tests drive litellm.completion end to end against a mock
transport and assert the request body
2026-10-30 07:13:03 +01:00
..
.agents/skills feat(skills): add a litellm-setup agent skill (#47731) 2026-10-28 15:44:43 -07:00
crates fix(anthropic): send extra_body fields at the top level and forward the server-side fallback beta 2026-10-30 07:13:03 +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 refactor(rust): adopt one error discipline across litellm-rust with source chains and Report (#48042) 2026-10-28 09:22:11 -07:00
Cargo.lock build(model-catalog): ship the cost map inside the native extension (#48907) 2026-10-29 07:55:02 -07:00
Cargo.toml refactor(model-catalog): parse, lower and validate the catalog into typed prices (#48853) 2026-10-28 18:24:40 -07:00
clippy.toml build(rust): upgrade reqwest to 0.13 and move MCP out of litellm-http (#48039) 2026-10-28 07:32:40 -07:00