BerriAI/litellm · error · HTTPException

vector_store_id must be a non-empty string

Error message

vector_store_id must be a non-empty string

What it means

Payload validation in the RAG ingest flow: a 'vector_store_id' key was found in the payload, but its value is not a non-empty string (null, empty, or wrong type), so it cannot be used for authorization or routing; the offending value is at fault, not the payload shape.

Source

Thrown at litellm/proxy/rag_endpoints/endpoints.py:78

                _raise_vector_store_scan_depth_exceeded()
            return
        payload_stack.append((value, next_depth))


def _collect_vector_store_ids_from_payload(payload: object) -> set[str]:
    vector_store_ids: Final[set[str]] = set()
    payload_stack: Final = [(payload, 0)]

    while payload_stack:
        current_payload, depth = payload_stack.pop()
        if depth > DEFAULT_MAX_RECURSE_DEPTH:
            _raise_vector_store_scan_depth_exceeded()

        if isinstance(current_payload, dict):
            for key, value in current_payload.items():
                if key == "vector_store_id":
                    if not isinstance(value, str) or not value:
                        raise HTTPException(
                            status_code=400,
                            detail={"error": "vector_store_id must be a non-empty string"},
                        )
                    vector_store_ids.add(value)
                    continue
                if isinstance(value, (dict, list)):
                    _append_payload_to_scan_stack(
                        payload_stack=payload_stack,
                        value=value,
                        next_depth=depth + 1,
                    )
        elif isinstance(current_payload, list):
            for item in current_payload:
                _append_payload_to_scan_stack(
                    payload_stack=payload_stack,
                    value=item,
                    next_depth=depth + 1,
                )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide vector_store_id as a non-empty string in the request.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/rag_endpoints/endpoints.py:78 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/1c333586ce191633. Report an issue: GitHub.