BerriAI/litellm · error · HTTPException

Index {index_create_request.index_name} already exists

Error message

Index {index_create_request.index_name} already exists

What it means

Uniqueness guard on vector-store index creation: a LiteLLM_ManagedVectorStoreIndex row with the same index_name already exists (checked via find_unique before insert). Index names are globally unique; use a different name or update/delete the existing index.

Source

Thrown at litellm/proxy/vector_store_endpoints/endpoints.py:585

    assert_proxy_admin_for_vector_store_index_management(
        user_api_key_dict,
        operation="create",
    )

    if prisma_client is None:
        raise HTTPException(
            status_code=500,
            detail=CommonProxyErrors.db_not_connected_error.value,
        )
    ## 1. check if index already exists
    existing_index: Final = await ManagedVectorStoreIndexRepository(prisma_client).table.find_unique(
        where={"index_name": index_create_request.index_name}
    )

    ## 2. set created_by and updated_by

    if existing_index is not None:
        raise HTTPException(
            status_code=400,
            detail=f"Index {index_create_request.index_name} already exists",
        )

    ## 2. create index
    index_data: Final = index_create_request.model_dump(exclude_none=True)
    index_data["created_by"] = user_api_key_dict.user_id
    index_data["updated_by"] = user_api_key_dict.user_id
    new_index = await ManagedVectorStoreIndexRepository(prisma_client).table.create(data=jsonify_object(index_data))

    return new_index.model_dump()


@router.get(
    "/v1/indexes",
    dependencies=[Depends(user_api_key_auth)],
    response_model=IndexListResponse,
)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Choose a different index_name or delete/reuse the existing index.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/vector_store_endpoints/endpoints.py:585 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/e2b97d384654aaf7. Report an issue: GitHub.