feat: add Arctic Embed 2.0 (M and L) models - #656
Conversation
Add Snowflake/snowflake-arctic-embed-m-v2.0 (768 dims, GTE-based, multilingual, 8192 tokens) and Snowflake/snowflake-arctic-embed-l-v2.0 (1024 dims, XLM-RoBERTa-based, multilingual, 8192 tokens). Arctic Embed 2.0 adds multilingual support (100+ languages) without sacrificing English performance. Both models support 8192 token context (16x longer than Arctic Embed 1.0's 512 tokens). Canonical vectors generated via: - M: ONNX runtime inference (same execution path as fastembed) - L: sentence-transformers + PyTorch (reference implementation) Both models use Apache-2.0 license and are available on HuggingFace with pre-built ONNX exports.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR adds medium and large Snowflake Arctic Embed v2.0 multilingual ONNX models to the supported model registry. It defines their embedding dimensions, token limits, licenses, sizes, sources, and file paths. It also adds canonical test vectors for both models. Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@fastembed/text/onnx_embedding.py`:
- Line 175: Update the model descriptors for
Snowflake/snowflake-arctic-embed-m-v2.0 and
Snowflake/snowflake-arctic-embed-l-v2.0 to state “74 languages” instead of “100+
languages,” unless a revision-specific source in the descriptors substantiates
the broader claim.
- Line 177: Update the Snowflake Arctic-Embed v2.0 handling in OnnxTextModel so
query inputs receive the required “query: ” prefix before tokenization, or
revise both query/document prefix descriptions to clearly require callers to add
it. Ensure the documented contract matches the actual preprocessing behavior for
v2.0 models.
- Around line 194-195: Update the large model descriptor in the relevant model
configuration to include onnx/model.onnx_data alongside onnx/model.onnx in its
allowed/downloaded model files, ensuring the external ONNX data file is cached
with the model.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f2f124ae-7a9f-4327-9f08-cb0c33a1a8f5
📒 Files selected for processing (2)
fastembed/text/onnx_embedding.pytests/test_text_onnx_embeddings.py
…, and L model external data - Change '100+ languages' to '74 languages' (per HuggingFace model card metadata) - Update prefix description: Arctic Embed 2.0 recommends 'query: ' prefix for retrieval queries - Add additional_files=['onnx/model.onnx_data'] for L model (external ONNX data file required for loading)
Make the prefix description unambiguous: the caller is responsible for prepending 'query: ' to retrieval queries. Matches the convention used by existing Arctic Embed v1 model descriptions.
Re: CodeRabbit Review — Query Prefix (Comment 2)Updated the description in commit
Why descriptor-only (no code change): fastembed does not automatically apply query/passage prefixes for any model — including existing Arctic Embed v1 models whose descriptions say "Prefixes for queries/documents: necessary". The The updated description now makes this explicit: callers must prepend |
6f097a4 to
03ba47c
Compare
Add Snowflake/snowflake-arctic-embed-m-v2.0 (768 dims, GTE-based, multilingual, 8192 tokens) and Snowflake/snowflake-arctic-embed-l-v2.0 (1024 dims, XLM-RoBERTa-based, multilingual, 8192 tokens).
Arctic Embed 2.0 adds multilingual support (100+ languages) without sacrificing English performance. Both models support 8192 token context (16x longer than Arctic Embed 1.0's 512 tokens).
Canonical vectors generated via:
Both models use Apache-2.0 license and are available on HuggingFace with pre-built ONNX exports.
All Submissions:
New Feature Submissions:
pre-commitwithpip3 install pre-commitand set up hooks withpre-commit install?New models submission: