Skip to content

OpenAI provider ignores configured timeout/batch_size/max_retries — factory drops them #360

Closed

Description

@GoodOlClint

Summary

EmbeddingProviderFactory._create_openai_provider reads the embedding config but never forwards timeout, batch_size, or max_retries to create_openai_provider(), so OpenAI-compatible providers always run with the hardcoded defaults (30s timeout, batch_size 100, 3 retries) no matter what the user configures.

The VoyageAI path in the same factory does forward all three (embedding_factory.py, _create_voyageai_provider), so this looks like an oversight rather than a design choice — OpenAIEmbeddingProvider.__init__ already accepts all three parameters.

Repro

{
  "embedding": {
    "provider": "openai",
    "base_url": "http://localhost:11434/v1",
    "model": "nomic-embed-text",
    "timeout": 120,
    "batch_size": 16
  }
}

Index a repo large enough that an embedding batch takes >30s (easy against a local Ollama/llama.cpp/MLX endpoint) — batches still time out at 30s. provider._timeout is 30 after factory creation.

This is what the last commenter on #134 hit ("following config not work, still timeouterror with timeout shows 30") — that issue was closed, but the config keys it added are silently dropped on the OpenAI path.

Impact

Anyone running embeddings against a local OpenAI-compatible endpoint (Ollama, LM Studio, llama.cpp, MLX servers), where per-batch latency routinely exceeds 30s for larger models.

Fix is staged — PR incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions