Skip to content

Add an API embedder backend (OpenAI / Cohere) behind an extra #10

Description

@AshwinUgale

The problem / use case

Context: Embedders live in retrieval_lab.embeddingDeterministicEmbedder
(keyless core) plus E5/BGE behind the [real-embed] extra, imported lazily. An API
embedder is a natural addition for teams comparing hosted vs local models.

What: Add an api embedder (start with one provider) behind a new extra
(e.g. [api-embed]), selectable via --embed-models api:text-embedding-3-small.

Acceptance:

  • lazily imported so the core stays dependency-free and the demo stays keyless
  • embeddings are cached by content hash (reuse the existing EmbeddingCache)
  • needs an API key → skipped/mocked in tests; documented in the install-options + limits
  • CHANGELOG.md updated

Note: needs a key to run for real; bigger than a one-file change — hence help wanted.

Proposed idea

Add an API-based embedder (e.g. OpenAI text-embedding-3-*) behind a new optional extra, lazily imported like the E5/BGE path, so users can benchmark hosted embeddings against local ones — without adding a runtime dependency to the core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions