Sentence Transformers
Model2Vec can be used directly in Sentence Transformers: The following code snippet shows how to load a Model2Vec model into a Sentence Transformer model:LangChain
Model2Vec can be used in LangChain using thelangchain-community
package. For more information, see the LangChain Model2Vec docs. The following code snippet shows how to use Model2Vec in LangChain after installing the langchain-community
package with pip install langchain-community
:
Txtai
Model2Vec can be used in txtai for text embeddings, nearest-neighbors search, and any of the other functionalities that txtai offers. The following code snippet shows how to use Model2Vec in txtai after installing thetxtai
package (including the vectors
dependency) with pip install txtai[vectors]
:
Chonkie
Model2Vec is the default model for semantic chunking in Chonkie. To use Model2Vec for semantic chunking in Chonkie, simply install Chonkie withpip install chonkie[semantic]
and use one of the potion
models in the SemanticChunker
class. The following code snippet shows how to use Model2Vec in Chonkie:
BERTopic
Model2Vec can be used as an embedding model in BERTopic. The following snippet shows how to use Model2Vec in BERTopic:KeyBert
Model2Vec can be used as an embedding model in KeyBert. The following snippet shows how to use Model2Vec in KeyBert:Weaviate
The Model2Vec Weaviate documentation can be found here.Milvus
The Model2Vec Milvus documentation can be found hereTransformers.js
To use a Model2Vec model in transformers.js, the following code snippet can be used as a starting point:model.onnx
file and several required tokenizers file. To generate these for a model that does not have them yet, the following code snippet can be used: