Skip to content

feat: Add dense embedding integrations - #97

Draft
jiahuei wants to merge 4 commits into
mainfrom
feat/embeddings
Draft

jiahuei wants to merge 4 commits into
mainfrom
feat/embeddings

Conversation

@jiahuei

@jiahuei jiahuei commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Added Molto.embeddings() with a typed OpenAI request and parsed SDK result, OpenAI-compatible transport for OpenAI/Infinity/vLLM, and Cohere v2/VoyageAI text embedding translation. Endpoint, provider, and destination remain independent.
  • Registered a distinct client class for every embedding provider/protocol pair, following feat: Add provider clients and multi-turn replay coverage #96's design. Infinity and vLLM use thin subclasses of the shared OpenAI implementation; their classes enforce explicit destinations. The registry replaces the separate provider allowlist, while the coordinator retains credential resolution and native-versus-translated orchestration.
  • Preserved single/batched text and supported token inputs, indices, dimensions, SDK encoding behavior, task/truncation options, model identity, and provider metadata. Unknown usage remains None. Unsupported multimodal/contextual, quantized, sparse, and multiple-vector semantics fail explicitly. Shared HTTP lifecycle and error conventions are reused without new runtime dependencies, streaming, or automatic batching.
  • Added independent hosted recordings and labelled synthetic schema fixtures with public-coordinator replay coverage. Published the five-provider support matrix, examples, architecture, and evidence limits. Merged main at 6036a7f; the implementation remains independent of feat: Add provider clients and multi-turn replay coverage #96.

Draft; related to #93. OpenAI (text-embedding-3-small) and Cohere (embed-v4.0) have successful live captures. VoyageAI's available credentials returned 401; the configured vLLM server timed out; Infinity was unconfigured. VoyageAI success coverage is synthetic. Infinity 3.0.0 and vLLM 0.33.0 are pinned source/schema references, not live-tested server/model claims. The issue remains open until successful evidence establishes all five integrations. A synthetic Infinity error enum was previously corrected to the pinned schema's Empty value.

Verification

At 237f131:

  • .venv/bin/python -m pytest --cov=python/molto --cov-report=term-missing --cov-report=xml:coverage.xml --junitxml=junit/pytest.xml: 2,672 passed, Python 3.14.7, offline replay only; four SDK base64-vector serialization warnings.

  • .venv/bin/python -m pytest tests/core/test_embeddings.py tests/core/test_embedding_engines.py tests/test_embedding_translation.py -q -o addopts='' --tb=short: 171 passed, including provider-class selection and direct-client destination validation.

  • uv run --extra lint ruff check --output-format github --config pyproject.toml .: passed.

  • uv run --extra lint ruff format --diff --config pyproject.toml .: passed, 95 files.

  • npx prettier@3.8 --check .: passed.

  • Clean core-only editable installation imported Molto with PyYAML absent.

  • git diff --cached --check: passed before commit. Conversational coordinator methods are AST-identical to main.

  • Existing embedding cassette bytes were preserved; conversational fixture changes came from main. No recordings were made during this update.

  • Live verification remains incomplete for VoyageAI, Infinity, and vLLM for the access/deployment reasons above.

  • gh pr checks 97 --repo EmbeddedLLM/molto --watch --interval 10: all five checks passed at the commit above (Python 3.12/3.13/3.14, Ruff, and Prettier).

@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report (Python 3.12) •
FileStmtsMissCoverMissing
configs.py46491%49, 53, 61, 65
core.py182597%133, 146, 336, 404, 482
providers.py140100% 
adapters
   embeddings.py50100% 
types
   embeddings.py210100% 
   openai_embeddings.py110100% 
upstream
   base.py60493%129, 134, 148, 153
   embeddings.py1501093%46, 74, 77–78, 80, 84, 111, 219, 270, 275
   registry.py30100% 
TOTAL379320495% 

Tests Skipped Failures Errors Time
2672 0 💤 0 ❌ 0 🔥 41.321s ⏱️

@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report (Python 3.14) •
FileStmtsMissCoverMissing
configs.py46491%49, 53, 61, 65
core.py182597%133, 146, 336, 404, 482
providers.py130100% 
adapters
   embeddings.py50100% 
types
   embeddings.py160100% 
   openai_embeddings.py90100% 
upstream
   base.py59493%129, 134, 148, 153
   embeddings.py1491093%46, 74, 77–78, 80, 84, 111, 219, 270, 275
   registry.py30100% 
TOTAL374020495% 

Tests Skipped Failures Errors Time
2672 0 💤 0 ❌ 0 🔥 42.834s ⏱️

@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report (Python 3.13) •
FileStmtsMissCoverMissing
configs.py46491%49, 53, 61, 65
core.py182597%133, 146, 336, 404, 482
providers.py140100% 
adapters
   embeddings.py50100% 
types
   embeddings.py210100% 
   openai_embeddings.py110100% 
upstream
   base.py60493%129, 134, 148, 153
   embeddings.py1501093%46, 74, 77–78, 80, 84, 111, 219, 270, 275
   registry.py30100% 
TOTAL379320495% 

Tests Skipped Failures Errors Time
2672 0 💤 0 ❌ 0 🔥 1m 10s ⏱️

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant