Skip to content

Vector-IO Insert API fails with KeyError: 'document_id' on all requests #3494

@skamenan7

Description

@skamenan7

System Info

llama-stack version: 0.2.21
FAISS provider: SQLite kvstore backend
Embedding models: sentence-transformers/all-MiniLM-L6-v2, Ollama all-minilm

Information

  • The official example scripts
  • My own modified scripts

🐛 Describe the bug

The /v1/vector-io/insert API endpoint consistently fails with a KeyError on 'document_id'

Commands used:

# Basic vector database creation (works)
curl -X POST http://localhost:8321/v1/vector-dbs \
  -H "Content-Type: application/json" \
  -d '{
    "vector_db_id": "test-faiss-db",
    "embedding_model": "sentence-transformers/all-MiniLM-L6-v2",
    "provider_id": "faiss"
  }'

# Vector-io insert (fails)
curl -X POST http://localhost:8321/v1/vector-io/insert \
  -H "Content-Type: application/json" \
  -d '{
    "vector_db_id": "test-faiss-db",
    "chunks": [{
      "content": "This is a test document",
      "chunk_metadata": {
        "document_id": "doc_1"
      }
    }]
  }'

Error logs

INFO VectorIORouter.insert_chunks [StatusCode.OK] (0.26ms)
INFO error: 'document_id'
ERROR Error executing endpoint route='/v1/vector-io/insert' method='post': 'document_id'

Client response:

HTTP/1.1 500 Internal Server Error
{
"detail": "Internal server error: An unexpected error occurred."
}

Expected behavior

The /v1/vector-io/insert endpoint should successfully insert chunks into the vector database when provided with valid schema-compliant requests.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions