Support --dimensions parameter in CLI#564
Open
persiyanov wants to merge 5 commits intomichaelfeil:mainfrom
Open
Support --dimensions parameter in CLI#564persiyanov wants to merge 5 commits intomichaelfeil:mainfrom
--dimensions parameter in CLI#564persiyanov wants to merge 5 commits intomichaelfeil:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
PR Summary
The PR adds a new CLI parameter, --dimensions, to set default matryoshka embedding dimensions across the Infinity API.
- Updated
/libs/infinity_emb/infinity_emb/args.pyto include a newdimensionsfield in EngineArgs. - Modified
/libs/infinity_emb/infinity_emb/cli.pyto pass the--dimensionsparameter for both v1 and v2 commands. - Integrated
matryoshka_diminto/libs/infinity_emb/infinity_emb/inference/batch_handler.pyfor embedding operations. - Updated
/docs/docs/cli_v2.mdto document the new parameter. - Adjusted
/libs/infinity_emb/infinity_server.pyand end-to-end tests to ensure default dimensions are applied properly.
💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!
8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #564 +/- ##
==========================================
- Coverage 79.85% 79.83% -0.02%
==========================================
Files 43 43
Lines 3489 3497 +8
==========================================
+ Hits 2786 2792 +6
- Misses 703 705 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hi there!
First off – thank you for
infinity, it's a fantastic project that allows setting up OpenAI-compatible API quickly.I was integrating it with Typesense, which recently introduced semantic search capabilities. However, I'm using Matryoshka embeddings, and Typesense doesn't support customizing the OpenAI-server request.
Hence, I had to update the infinity CLI to support setting a default value for
matryoshka_dimwhen the server starts.The way you can run it is:
I'm not sure if this aligns with the roadmap of the project, but I figured I'd submit a PR anyway if others find it helpful.
Checklist