{"record":{"id":"397a9f76efc81ea9","repo":"BerriAI/litellm","slug":"route-invalid-model-name-passed-in-model-model-397a9f","errorCode":null,"errorMessage":"{route}: Invalid model name passed in model={model_name}. Call `/v1/models` to view available models for your key.","messagePattern":"(.+?): Invalid model name passed in model=(.+?)\\. Call `/v1/models` to view available models for your key\\.","errorType":"http","errorClass":"ProxyModelNotFoundError","httpStatus":400,"severity":"error","filePath":"litellm/proxy/route_llm_request.py","lineNumber":675,"sourceCode":"                except Exception:\n                    # If router fails (e.g., model not found in router), fall back to direct call\n                    return getattr(litellm, f\"{route_type}\")(**data)\n            elif _is_a2a_agent_model(data.get(\"model\", \"\")):\n                from litellm.proxy.agent_endpoints.a2a_routing import (\n                    route_a2a_agent_request,\n                )\n\n                result: Final = await route_a2a_agent_request(data, route_type, user_api_key_dict=user_api_key_dict)\n                if result is not None:\n                    return result\n                # Fall through to raise exception below if result is None\n\n    elif user_model is not None or route_type == \"allm_passthrough_route\":\n        return getattr(litellm, f\"{route_type}\")(**data)\n\n    # if no route found then it's a bad request\n    route_name: Final = ROUTE_ENDPOINT_MAPPING.get(route_type, route_type)\n    raise ProxyModelNotFoundError(\n        route=route_name,\n        model_name=data.get(\"model\", \"\"),\n    )\n","sourceCodeStart":657,"sourceCodeEnd":679,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/route_llm_request.py#L657-L679","documentation":"Model resolution failure in the LLM request router: the model name in the request does not match any deployment (router lookup failed and the direct-call fallback also rejected it). The message directs the caller to /v1/models to list the models available to their key.","triggerScenarios":"Thrown at litellm/proxy/route_llm_request.py:675 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call GET /v1/models with your key and use one of the listed model names.","Fix typos in the model field of the request."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}