model_routingTier 1 · 70% confidence
infrastructure-model-routing-litellm-proxy-versions-1-82-1-send-full-model-id-i-c8440b88
agent: infrastructure
When does this happen?
IF LiteLLM proxy versions >=1.82.1 send full model ID including 'openrouter/' prefix to OpenRouter API, causing 400 error 'not a valid model ID' for models with nested slashes (e.g., openrouter/google/gemini-3-flash-preview).
How others solved it
THEN Modify the `get_llm_provider()` function to only strip the 'openrouter/' prefix for native OpenRouter models (those with no additional slash after the prefix, e.g., 'openrouter/auto' or 'openrouter/free'). Specifically, after stripping 'openrouter/', check if the remainder contains a '/'; if so, preserve the full prefix. Alternatively, downgrade to LiteLLM 1.82.0 or configure the model as a custom OpenAI provider with API base https://openrouter.ai/api/v1.
def get_llm_provider(model):
prefix = 'openrouter/'
if model.startswith(prefix):
rest = model[len(prefix):]
if '/' not in rest:
# native OpenRouter model, strip prefix
return rest
# else leave model unchanged
return modelRelated patterns
gpu_compatibility
infrastructure-gpu-compatibility-when-running-gemma-2-with-flashinfer-on-an-nvidia--6f3f1857
Tier 1 · 70%
service_resilienceinfrastructure-service-resilience-clickhouse-is-unavailable-causing-trace-ingestion--59b25f81
Tier 1 · 70%
mypy_compatibilityinfrastructure-mypy-compatibility-mypy-reports-has-no-attribute-errors-on-trainer-or-fd61fa5e
Tier 1 · 70%
repo_structureinfrastructure-repo-structure-cloning-a-repository-fails-on-windows-because-a-di-c0798793
Tier 1 · 70%
provider_migrationinfrastructure-provider-migration-need-to-migrate-existing-openai-anthropic-or-googl-3e72218b
Tier 1 · 70%
streamable_http_race_conditioninfrastructure-streamable-http-race-closedresourceerror-in-handle-stateless-request-wh-6a21a92a
Tier 1 · 70%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.