New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add embeddings for LocalAI #8134
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
99131ec
to
0addb58
Compare
Signed-off-by: mudler <mudler@localai.io>
0addb58
to
76ebaf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- lets add an example notebook for this
- lets add this to
langchain/embeddings/__init__.py
Signed-off-by: mudler <mudler@localai.io>
Signed-off-by: mudler <mudler@localai.io>
@hwchase17 done! will follow up along with #5256 and once we have complete integration with LocalAI I'll update also the documentation page accordingly. Taking this opportunity to ask - is there any interest into adding e.g. voice capabilities? LocalAI supports tts and audio-to-text as well |
looks awesome, thanks @mudler! there definitely is interest in voice but adding other modalities is a big change that we want to be super thoughtful about, and we haven't had the time to think it through just yet. very open to suggestions on the interface if you're eager to see it in langchain |
Description:
This PR adds embeddings for LocalAI ( https://github.com/go-skynet/LocalAI ), a self-hosted OpenAI drop-in replacement. As LocalAI can re-use OpenAI clients it is mostly following the lines of the OpenAI embeddings, however when embedding documents, it just uses string instead of sending tokens as sending tokens is best-effort depending on the model being used in LocalAI. Sending tokens is also tricky as token id's can mismatch with the model - so it's safer to just send strings in this case.
Partly related to: #5256
Dependencies: No new dependencies
Twitter: @mudler_it
Maintainers: @rlancemartin, @eyurtsev, @hwchase17