BerriAI/litellm · error · ValueError
GEMINI_API_BASE is required
Error message
GEMINI_API_BASE is required
What it means
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.
Source
Thrown at litellm/rag/ingestion/gemini_ingestion.py:96
embeddings: Ignored - Gemini handles embedding
existing_file_id: Existing provider file ID, unsupported for Gemini
Returns:
Tuple of (vector_store_id, file_id)
"""
vector_store_id = self.vector_store_config.get("vector_store_id")
vector_store_config: Final = cast(dict[str, Any], self.vector_store_config)
# Get API credentials
api_key: Final = cast(str | None, vector_store_config.get("api_key")) or GeminiModelInfo.get_api_key()
api_base: Final = cast(str | None, vector_store_config.get("api_base")) or GeminiModelInfo.get_api_base()
if not api_key:
raise ValueError("GEMINI_API_KEY or GOOGLE_API_KEY is required for Gemini File Search")
if not api_base:
raise ValueError("GEMINI_API_BASE is required")
api_version: Final = "v1beta"
base_url: Final = f"{api_base}/{api_version}"
# Create File Search store if not provided
if not vector_store_id:
vector_store_id = await self._create_file_search_store(
api_key=api_key,
base_url=base_url,
display_name=self.ingest_name or "litellm-rag-ingest",
)
# Upload file to File Search store
result_file_id = None
if file_content and filename and vector_store_id:
result_file_id = await self._upload_to_file_search_store(
api_key=api_key,
base_url=base_url,View on GitHub (pinned to 77b7c6c40c)
Solutions
- Set GEMINI_API_BASE to the Gemini API base URL.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/rag/ingestion/gemini_ingestion.py:96 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/2fbc92127f80dfa5.
Report an issue: GitHub.