BerriAI/litellm · error · ValueError

vector_store_id (corpus ID) is required for Vertex AI RAG in

Error message

vector_store_id (corpus ID) is required for Vertex AI RAG ingestion. Please provide an existing RAG corpus ID.

What it means

ValueError raised in VertexRAGIngestion.__init__ when the vector_store config carries no vector_store_id. Vertex AI RAG ingestion imports files into an existing RAG corpus; LiteLLM never auto-creates corpora, so the corpus ID is mandatory at construction time.

Source

Thrown at litellm/llms/vertex_ai/rag_engine/ingestion.py:76

    - chunk_size: Maximum size of chunks (default: 1000)
    - chunk_overlap: Overlap between chunks (default: 200)

    Authentication:
    - Uses Application Default Credentials (ADC)
    - Run: gcloud auth application-default login
    """

    def __init__(
        self,
        ingest_options: RAGIngestOptions,
        router: Router | None = None,
    ):
        super().__init__(ingest_options=ingest_options, router=router)

        # Get corpus ID (required for Vertex AI)
        self.corpus_id = self.vector_store_config.get("vector_store_id")
        if not self.corpus_id:
            raise ValueError(
                "vector_store_id (corpus ID) is required for Vertex AI RAG ingestion. "
                "Please provide an existing RAG corpus ID."
            )

        # GCP config
        self.vertex_project = self.vector_store_config.get("vertex_project") or get_secret_str("VERTEXAI_PROJECT")
        self.vertex_location = (
            self.vector_store_config.get("vertex_location") or get_secret_str("VERTEXAI_LOCATION") or "us-central1"
        )
        self.vertex_credentials = self.vector_store_config.get("vertex_credentials")

        # GCS bucket for file uploads
        self.gcs_bucket = self.vector_store_config.get("gcs_bucket") or os.environ.get("GCS_BUCKET_NAME")
        if not self.gcs_bucket:
            raise ValueError(
                "gcs_bucket is required for Vertex AI RAG ingestion. "
                "Set via vector_store config or GCS_BUCKET_NAME env var."
            )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Create a RAG corpus first (gcloud alpha rag corpora create --display-name my-corpus, or via the Console) and copy its ID
  2. Set vector_store_id=<corpus-id> in the vector_store config passed to ingestion
  3. Double-check the exact key name is vector_store_id
  4. Confirm the corpus lives in the same vertex_project / vertex_location you configure

Example fix

# before
vector_store_config = {'vertex_project': 'my-project'}  # no vector_store_id

# after
vector_store_config = {
    'vector_store_id': '<rag-corpus-id>',  # from `gcloud alpha rag corpora create`
    'vertex_project': 'my-project',
    'gcs_bucket': 'my-bucket',
}
Defensive patterns

Strategy: validation

Validate before calling

cfg = get_vector_store_config()  # your config source
assert cfg.get('vector_store_id'), 'vector_store_id (RAG corpus ID) is required for vertex_ai RAG ingestion'

Try / catch

try:
    ingestion = VertexRAGIngestion(ingest_options=opts, router=router)
except ValueError as e:
    if 'vector_store_id' in str(e):
        raise SystemExit('Create a RAG corpus and set vector_store_id in the config')
    raise

Prevention

When it happens

Trigger: Building a Vertex RAG ingestion job whose vector_store config lacks vector_store_id, or stores it under a different key (e.g. 'corpus_id' or 'id').

Common situations: Migrating from vector stores that auto-create indexes (Pinecone, Qdrant) and assuming the same behavior; forgetting to create the corpus first with gcloud or the Console; passing the full corpus resource name instead of the bare ID.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/e8363f6853a34310. Report an issue: GitHub.