BerriAI/litellm · error · ValueError
No router config provided
Error message
No router config provided
What it means
Guard in AutoRouter init/_load_semantic_routing_routes: neither auto_router_config_path nor auto_router_config was supplied, so no semantic routes can be loaded and the router cannot classify requests.
Source
Thrown at litellm/router_strategy/auto_router/auto_router.py:71
self.auto_router_config_path: str | None = auto_router_config_path
self.auto_router_config: str | None = auto_router_config
self.auto_sync_value = self.DEFAULT_AUTO_SYNC_VALUE
self.loaded_routes: list[Route] = self._load_semantic_routing_routes()
self.routelayer: SemanticRouter | None = None
self.default_model = default_model
self.embedding_model: str = embedding_model
self.max_input_chars: int = max_input_chars
self.litellm_router_instance: Router = litellm_router_instance
def _load_semantic_routing_routes(self) -> list[Route]:
from semantic_router.routers import SemanticRouter
if self.auto_router_config_path:
return SemanticRouter.from_json(self.auto_router_config_path).routes
elif self.auto_router_config:
return self._load_auto_router_routes_from_config_json()
else:
raise ValueError("No router config provided")
def _load_auto_router_routes_from_config_json(self) -> list[Route]:
import json
from semantic_router.routers.base import Route
if self.auto_router_config is None:
raise ValueError("No auto router config provided")
auto_router_routes: Final[list[Route]] = []
loaded_config: Final = json.loads(self.auto_router_config)
for route in loaded_config.get("routes", []):
auto_router_routes.append(
Route(
name=route.get("name"),
description=route.get("description"),
utterances=route.get("utterances", []),
score_threshold=route.get("score_threshold"),
)View on GitHub (pinned to 77b7c6c40c)
Solutions
- Provide a router config to the auto router constructor.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/router_strategy/auto_router/auto_router.py:71 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/c7bcf37ba4e5a415.
Report an issue: GitHub.