[FEAT] Add Mistral embedding adapter (mistral-embed)#2158
Conversation
Mistral was a first-class LLM adapter but had no embedding adapter, despite shipping a real, popular embedding model (mistral-embed). This adds a native Mistral embedding adapter that routes through LiteLLM's `mistral/` provider, so cost calculation works out of the box. - MistralEmbeddingParameters in base1.py (idempotent `mistral/` prefix, required-model validation) - MistralEmbeddingAdapter + UI JSON schema, reusing the existing logo - Registered in embedding1/__init__.py - 28 unit tests mirroring the Gemini embedding coverage Closes Zipstack#2157 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Summary by CodeRabbit
WalkthroughAdds a new Mistral embedding adapter to the Unstract SDK, including a ChangesMistral Embedding Adapter
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Mistral was a first-class LLM adapter but had no embedding adapter, despite shipping a real, popular embedding model (mistral-embed). This adds a native Mistral embedding adapter that routes through LiteLLM's
mistral/provider, so cost calculation works out of the box.mistral/prefix, required-model validation)Closes #2157
What
Adds a native Mistral embedding adapter (
mistral-embed) tounstract/sdk1. Mistral was already a first-class LLM adapter but had no embedding counterpart.MistralEmbeddingParametersinbase1.py(idempotentmistral/prefix, required-model validation)MistralEmbeddingAdapter+ UI JSON schema (embedding1/static/mistral.json), reusing the existing Mistral logoRegistered in
embedding1/__init__.py28 unit tests mirroring the Gemini embedding coverage
Why
mistral, but the 9 embedding adapters did not, despitemistral-embedbeing a real, popular model.mistral/provider means cost calculation works out of the box (litellm_provider: "mistral"matchesget_provider()).How
MistralEmbeddingParameters(BaseEmbeddingParameters)validates the requiredmodeland prepends themistral/prefix idempotently (won't double-prefix an already-prefixed model).MistralEmbeddingAdapterfollows the existing embedding-adapter contract (get_id/get_provider/get_adapter_type/etc.), returnsAdapterTypes.EMBEDDING, and is auto-discovered byregister_adapters().mistral/mistral-embed→litellm_provider: "mistral",mode: "embedding", 8192 max tokens.Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
mistral) already exists as an LLM provider, so cost-calculation behavior for existing adapters is untouched.Database Migrations
Env Config
Relevant Docs
mistral-embed(auto-prefixed tomistral/mistral-embed)Related Issues or PRs
Dependencies Versions
mistral/provider.Notes on Testing
tests/test_mistral_embedding.py— 28 tests covering registration, ID format, provider name, JSON schema (required fields, defaults, password format), model-prefix idempotency, input-mutation safety, and validation errors (empty/whitespace/None/missing model, missing API key).ruff check→ all passed;ruff format --check→ all files formatted.Screenshots
N/A — no custom UI; the adapter renders through the standard auto-generated config form.
Checklist
I have read and understood the Contribution Guidelines.