{"record":{"id":"2fbc92127f80dfa5","repo":"BerriAI/litellm","slug":"gemini-api-base-is-required","errorCode":null,"errorMessage":"GEMINI_API_BASE is required","messagePattern":"GEMINI_API_BASE is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/rag/ingestion/gemini_ingestion.py","lineNumber":96,"sourceCode":"            embeddings: Ignored - Gemini handles embedding\n            existing_file_id: Existing provider file ID, unsupported for Gemini\n\n        Returns:\n            Tuple of (vector_store_id, file_id)\n        \"\"\"\n        vector_store_id = self.vector_store_config.get(\"vector_store_id\")\n\n        vector_store_config: Final = cast(dict[str, Any], self.vector_store_config)\n\n        # Get API credentials\n        api_key: Final = cast(str | None, vector_store_config.get(\"api_key\")) or GeminiModelInfo.get_api_key()\n        api_base: Final = cast(str | None, vector_store_config.get(\"api_base\")) or GeminiModelInfo.get_api_base()\n\n        if not api_key:\n            raise ValueError(\"GEMINI_API_KEY or GOOGLE_API_KEY is required for Gemini File Search\")\n\n        if not api_base:\n            raise ValueError(\"GEMINI_API_BASE is required\")\n\n        api_version: Final = \"v1beta\"\n        base_url: Final = f\"{api_base}/{api_version}\"\n\n        # Create File Search store if not provided\n        if not vector_store_id:\n            vector_store_id = await self._create_file_search_store(\n                api_key=api_key,\n                base_url=base_url,\n                display_name=self.ingest_name or \"litellm-rag-ingest\",\n            )\n\n        # Upload file to File Search store\n        result_file_id = None\n        if file_content and filename and vector_store_id:\n            result_file_id = await self._upload_to_file_search_store(\n                api_key=api_key,\n                base_url=base_url,","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/rag/ingestion/gemini_ingestion.py#L78-L114","documentation":"Endpoint guard in the Gemini ingestion flow: no api_base was resolved from vector_store_config or the GEMINI_API_BASE environment variable, so the target URL for the Gemini File API cannot be constructed. Set GEMINI_API_BASE (e.g. for a proxy or regional endpoint) and retry.","triggerScenarios":"Thrown at litellm/rag/ingestion/gemini_ingestion.py:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set GEMINI_API_BASE to the Gemini API base URL."],"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"}