BerriAI/litellm · error · ValueError

No auto router config provided

Error message

No auto router config provided

What it means

Init guard in the auto (semantic) router: neither auto_router_config_path nor auto_router_config was provided, so there is no route configuration to build SemanticRouter routes from.

Source

Thrown at litellm/router_strategy/auto_router/auto_router.py:79

        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"),
                )
            )
        return auto_router_routes

    @staticmethod
    def _extract_text_from_messages(messages: list[dict[str, Any]]) -> str:
        """
        Extract text content from the last user message for routing.

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide an auto router config (with embedding model and routing config) when initializing.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/router_strategy/auto_router/auto_router.py:79 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/51d274e167ae9559. Report an issue: GitHub.