{"record":{"id":"77fa9e2a141590e7","repo":"BerriAI/litellm","slug":"llm-router-not-initialized","errorCode":null,"errorMessage":"LLM router not initialized","messagePattern":"LLM router not initialized","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/management_endpoints/policy_endpoints/endpoints.py","lineNumber":781,"sourceCode":"        \"no numbering, no explanations. If the instruction asks to remove names, \"\n        \"return nothing.\"\n    )\n\n\nasync def _stream_llm_competitor_names(\n    prompt: str,\n    model: str,\n    existing: list[str],\n) -> AsyncIterator[tuple[str | None, bool]]:\n    \"\"\"\n    Stream competitor names from LLM. Yields (name, is_error) tuples.\n\n    Deduplicates against existing names (case-insensitive).\n    \"\"\"\n    from litellm.proxy.proxy_server import llm_router\n\n    if llm_router is None:\n        raise ValueError(\"LLM router not initialized\")\n\n    existing_lower: Final = {n.lower() for n in existing}\n    response: Final = await llm_router.acompletion(\n        model=model,\n        messages=[{\"role\": \"user\", \"content\": prompt}],\n        temperature=COMPETITOR_LLM_TEMPERATURE,\n        stream=True,\n    )\n    buffer = \"\"\n    count = len(existing)\n    async for chunk in response:\n        delta = chunk.choices[0].delta.content or \"\"\n        buffer += delta\n        while \"\\n\" in buffer:\n            line, buffer = buffer.split(\"\\n\", 1)\n            name = _clean_competitor_line(line)\n            if name and name.lower() not in existing_lower and count < MAX_COMPETITOR_NAMES:\n                existing_lower.add(name.lower())","sourceCodeStart":763,"sourceCodeEnd":799,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/policy_endpoints/endpoints.py#L763-L799","documentation":"_stream_llm_competitor_names needs the proxy's llm_router to dispatch the enrichment LLM call; when the router is None (proxy started without models configured), it raises ValueError, which the endpoint surfaces as a server error. At-fault condition is missing LLM infrastructure, not user input.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/policy_endpoints/endpoints.py:781 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure models on the proxy so the LLM router initializes."],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}