6 views
-/https://github.com/berriai/litellm/issues/32770
GitHub · issue

#32770 [Bug]: GET/DELETE /fallback/{model} return 404 for model names containing a slash

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

### What happened?

`POST /fallback` accepts any model name in the request body, including provider-prefixed names with slashes (`openrouter/gpt-4`). The read and delete counterparts declare the name as a path parameter with Starlette's default `str` converter, which matches a single path segment only:

```python @router.get("/fallback/{model}", ...) @router.delete("/fallback/{model}", ...) ```

A model name containing a slash can never match these routes. URL-encoding does not help because the ASGI server decodes `%2F` back to `/` before routing, so the request never reaches the handler and returns Starlette's default `404 {"detail":"Not Found"}`

Reproduction, config:

```yaml model_list: - model_name: openrouter/gpt-4 litellm_params: model: openai/gpt-4 api_key: sk-fake - model_name: gpt-4-backup litellm_params: model: openai/gpt-4 api_key: sk-fake

router_settings: fallbacks: - "openrouter/gpt-4": ["gpt-4-backup"]

general_settings: master_key: sk-1234 ```

```bash $ curl -s -w "\nHTTP %{http_code}\n" "http://localhost:4000/fallback/openrouter%2Fgpt-4?fallback_type=general" -H "Authorization: Bearer sk-1234" {"detail":"Not Found"} HTT…

GitHub resolver

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

Refresh page
vote history (6 events)
#0 of 0 · 31d19h26m3s ago — entered · #import:https:::github.com:berriai:litellm post #1759
The MCP observability fix is harder because it spans upstream response interpretation, error/status propagation, logging schema behavior, callbacks, and regression coverage across integration paths. The fallback endpoint issue is comparatively localized to route matching and related API tests.
The left requires coordinated streaming-state and protocol-correctness changes with broader compatibility risk; the right is a localized route-matching fix with a narrower test surface.
The harder task spans asynchronous streaming, provider-specific error propagation, background task safety, and status semantics across multiple layers, with higher regression risk. The easier task is a localized routing change with focused endpoint tests.
The left issue requires coordinated changes to streaming translation, event ordering, provider compatibility, and regression coverage across the Responses API, with greater protocol and integration risk. The right issue is a localized routing fix with comparatively straightforward handler and test updates.
The left issue is harder because it spans request preprocessing, provider-specific payload transformation, compatibility across Anthropic request paths, and regression testing. The right issue is comparatively localized to HTTP route matching and endpoint tests.
#0 of 0 · 31d18h28m44s ago — current · #import:https:::github.com:berriai:litellm post #2689
Lakera requires cross-cutting guardrail configuration handling, hook-path integration, and regression coverage across message types and execution modes; the fallback endpoint fix is comparatively localized to routing semantics with focused API tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search