7 views
-/https://github.com/berriai/litellm/issues/35246
GitHub · issue

#35246 Surface the actually-served model on the Anthropic /v1/messages endpoint (fallback transparency; parity with /v1/chat/completions)

  • State: open
  • Author: @Maziak2520
  • Labels: llm translation

### Summary / feature request

When running the proxy as a gateway with **cross-provider fallbacks** (e.g. `claude-*` → `gemini-*`), consumers that call the **Anthropic `/v1/messages`** endpoint (via `ANTHROPIC_BASE_URL` + the Anthropic SDK) have **no reliable way to tell which model actually served a request** after a fallback. `/v1/chat/completions` already exposes this; `/v1/messages` doesn't. This is a small parity gap that matters a lot for cost attribution, quality tracking, and detecting silent substitutions.

### Current behavior

**`/v1/chat/completions` (good):** - response headers `x-litellm-model-group` and `x-litellm-model-api-base` reflect the **served** model - `body.model` = served model

**`/v1/messages` (gap):** - the only model-ish header is `x-litellm-model-id` — an **opaque deployment hash** - `body.model` **echoes the requested model**, not the served one

So on a fallback (`claude-sonnet-4-6` served by `gemini-3.5-flash`), a `/v1/messages` client sees `"model": "claude-sonnet-4-6"` and cannot detect the substitution.

### Why a user-side callback can't work around it (v1.92.0)

We tried a `CustomLogger.async_post_call_success_hook` to stamp `_hidden_params["a…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h22m31s ago — entered · #import:https:::github.com:berriai:litellm post #2679
The left task requires tracing fallback metadata through the Anthropic translation and response layers while preserving compatibility across headers, payloads, streaming, and tests. The right task is primarily an incremental model-registration and capability update within existing image-generation pathways, with narrower integration risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search