Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

feat!: Add support for custom embedding models and related tests - #32

Merged
anush008 merged 3 commits into
anush008:mainfrom
solarpush:main
Sep 16, 2025
Merged

anush008 merged 3 commits into
anush008:mainfrom
solarpush:main

Conversation

@solarpush

Copy link
Copy Markdown
Contributor

Add support for custom embedding models

This PR introduces support for loading custom embedding models in addition to the predefined set.

  • Added a new CUSTOM enum option to allow initialization with user-provided models.
  • Extended fastembed.ts to handle initialization with a custom model directory (modelAbsoluteDirPath) and optional modelName.
  • Introduced a tokenizer configuration path to ensure compatibility with custom models (tokenizer.json, config.json, etc.).
  • Added a dedicated test suite to validate initialization and embedding functionality for custom models.
  • Updated TypeScript configuration to exclude heavy model directories from compilation for a lighter build.

- Introduced a new tokenizer configuration file for custom models.
- Modified the fastembed.ts to handle custom embedding models with appropriate options.
- Created a new test suite for custom embedding models to validate initialization and embedding functionality.
- Updated TypeScript configuration to exclude model directories from compilation.
* Refactored multiple tests to initialize `FlagEmbedding` with `EmbeddingModel.CUSTOM`.
* Ensured consistent model path and name usage across tests.
* Updated expected values in the canonical values test for accuracy.
@solarpush

Copy link
Copy Markdown
Contributor Author

about the models/ directory it's just to perform tests
i found just a misstake i push again (sorry)

Comment thread models/customs/config.json Outdated
…m model tests to include file downloads and improve test structure.
@solarpush

Copy link
Copy Markdown
Contributor Author

it's ok for test they download config /tokenizer/ model from sentence-transformers HF repo

@solarpush solarpush changed the title Add support for custom embedding models and related tests feat: Add support for custom embedding models and related tests Sep 14, 2025
@anush008 anush008 changed the title feat: Add support for custom embedding models and related tests feat!: Add support for custom embedding models and related tests Sep 15, 2025

@anush008 anush008 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @solarpush. Thanks for the contribution.

@solarpush

Copy link
Copy Markdown
Contributor Author

Thanks for your work! In the future, I’d propose adding precision selection for quantified ONNX (01, 02, 03, 04), if you’re okay with it.

and maybe add in readme the CUSTOM usage too.

Thanks you

@anush008
anush008 merged commit 43945aa into anush008:main Sep 16, 2025
41 of 45 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 16, 2025
## [2.0.0](v1.14.4...v2.0.0) (2025-09-16)

### ⚠ BREAKING CHANGES

* Add support for custom embedding models and related tests (#32)

### 🍕 Features

* Add support for custom embedding models and related tests ([#32](#32)) ([43945aa](43945aa))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants