Skip to content

feat: add support for intfloat/multilingual-e5-small - #695

Open
Ilyat9 wants to merge 1 commit into
qdrant:mainfrom
Ilyat9:feat/add-multilingual-e5-small
Open

feat: add support for intfloat/multilingual-e5-small#695
Ilyat9 wants to merge 1 commit into
qdrant:mainfrom
Ilyat9:feat/add-multilingual-e5-small

Conversation

@Ilyat9

@Ilyat9 Ilyat9 commented Aug 29, 2026

Copy link
Copy Markdown

What

Adds built-in support for intfloat/multilingual-e5-small as a dense pooled text embedding model.

Closes #123

Why

This model was explicitly requested in #123. It is a small (~118M params), fast,
multilingual E5-family model, complementing the already-supported
intfloat/multilingual-e5-large, for use cases needing lower latency/memory footprint.

How I validated correctness

  • Canonical vector values were obtained from the reference HuggingFace transformers
    implementation of intfloat/multilingual-e5-small (mean pooling over the last hidden
    state, matching PooledEmbedding post-processing used for the whole E5 family),
    using the same input text ("hello world") and comparison tolerance (atol=1e-3) as
    existing tests in tests/test_text_onnx_embeddings.py.
  • The reference run was executed twice and produced identical values.
  • Local fastembed output matches the reference with max abs diff of ~3.2e-7 (tolerance is 1e-3).
  • dim=384 and size_in_GB=0.44 verified against the actually downloaded ONNX artifact
    (onnx/model.onnx = 470,268,510 bytes = 0.438 GiB).
  • tests/test_custom_models.py previously used intfloat/multilingual-e5-small as the
    example custom model; since the model is now built-in, add_custom_model correctly
    rejects it. The example was switched to Xenova/multilingual-e5-small (same weights,
    so the existing canonical values in that test remain valid and the test passes).
    Note: a parallel PR adding this model (feat: add intfloat/multilingual-e5-small support #694) does not include this fix, and the
    current tests/test_custom_models.py fails for any PR that registers this model
    as built-in without it.
  • Ran the full tests/test_text_onnx_embeddings.py and tests/test_custom_models.py
    suites locally — all passing.
  • Ran ruff check / ruff format --check / pre-commit hooks — all passing.

Note on the parallel PR

While working on this, I noticed #694 addresses the same issue. This PR is submitted
independently; happy to consolidate with the author/maintainers on whichever version
is preferred.

Checklist

  • Added model to supported_pooled_models in fastembed/text/pooled_embedding.py
  • Added canonical vector test in tests/test_text_onnx_embeddings.py
  • Fixed custom-model example in tests/test_custom_models.py (model is now built-in)
  • Followed CONTRIBUTING.md guidelines for adding new models

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 59487bf0-62ce-484f-b2f4-37df53bc416a

📥 Commits

Reviewing files that changed from the base of the PR and between c48247f and 1fd1e7c.

📒 Files selected for processing (4)
  • fastembed/text/pooled_embedding.py
  • pr_description.md
  • tests/test_custom_models.py
  • tests/test_text_onnx_embeddings.py

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Adds intfloat/multilingual-e5-small as a supported 384-dimensional pooled embedding model. The model metadata includes its Hugging Face source, ONNX file, license, and size. Embedding tests now include canonical output values for the model. Custom model tests use Xenova/multilingual-e5-small to keep the custom-model cases separate from the built-in model.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 1fd1e

This PR adds built-in support for a smaller multilingual embedding model and updates the related tests without changing existing interfaces or deployment behavior. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: joein

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the primary change: adding support for intfloat/multilingual-e5-small.
Description check ✅ Passed The description directly explains the model support, related test updates, validation, and linked issue.
Linked Issues check ✅ Passed The PR satisfies issue #123 by adding intfloat/multilingual-e5-small to supported_pooled_models and adding canonical vector coverage.
Out of Scope Changes check ✅ Passed All changes support the stated objective. The custom-model test update is required because the model is now built in.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

intfloat/multilingual-e5-small request

1 participant