{"record":{"id":"67b18b5c1dbcf7f4","repo":"BerriAI/litellm","slug":"llm-router-not-available-cannot-access-managed-fi","errorCode":null,"errorMessage":"llm_router not available. Cannot access managed files.","messagePattern":"llm_router not available\\. Cannot access managed files\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/hooks/batch_rate_limiter.py","lineNumber":746,"sourceCode":"            from litellm.proxy.proxy_server import llm_router, proxy_logging_obj\n        except ImportError as e:\n            raise ValueError(\n                f\"Cannot import proxy_server dependencies: {e}. Managed files require proxy_server to be initialized.\"\n            )\n\n        # Get the managed files hook\n        if proxy_logging_obj is None:\n            raise ValueError(\"proxy_logging_obj not available. Cannot access managed files hook.\")\n\n        managed_files_obj: Final = proxy_logging_obj.get_proxy_hook(\"managed_files\")\n        if managed_files_obj is None:\n            raise ValueError(\"Managed files hook not found. Cannot access managed file.\")\n\n        if not isinstance(managed_files_obj, BaseFileEndpoints):\n            raise ValueError(\"Managed files hook is not a BaseFileEndpoints instance.\")\n\n        if llm_router is None:\n            raise ValueError(\"llm_router not available. Cannot access managed files.\")\n\n        # Use the managed files hook to get file content\n        # This properly handles user permissions and file ownership\n        file_content: Final = await managed_files_obj.afile_content(\n            file_id=file_id,\n            litellm_parent_otel_span=user_api_key_dict.parent_otel_span,\n            llm_router=llm_router,\n        )\n\n        return file_content\n\n    async def async_pre_call_hook(\n        self,\n        user_api_key_dict: UserAPIKeyAuth,\n        cache: Any,\n        data: dict,\n        call_type: str,\n    ) -> Exception | str | dict | None:","sourceCodeStart":728,"sourceCodeEnd":764,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/hooks/batch_rate_limiter.py#L728-L764","documentation":"Error \"llm_router not available. Cannot access managed files.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/hooks/batch_rate_limiter.py:746 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure model_list on the proxy so llm_router is available for managed files.","Verify the proxy started with a valid router configuration."],"exampleFix":null,"handlingStrategy":null,"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"}