model2vec
Fast State-of-the-Art Static Embeddings
What it is and what it does
Model2Vec is a distillation technique that transforms any sentence transformer into a compact static embedding model. It reduces model size by up to 50 times and achieves up to 500 times faster inference on CPU, with minimal performance loss. The package provides pre-trained models from HuggingFace (including multilingual variants) ready for immediate use, plus tools to distill your own models from existing sentence transformers in about 30 seconds without requiring a dataset.
The core workflow is straightforward: load a pre-trained Model2Vec model or distill one from a sentence transformer, then call encode() to generate sentence embeddings or encode_as_sequence() for token-level embeddings. These embeddings work for text classification, semantic search, clustering, and retrieval-augmented generation. The package integrates with HuggingFace hub for easy model sharing and is already integrated into Sentence Transformers and LangChain.
Use it for:
- Build a semantic search or retrieval system where inference speed and model size are critical constraints.
- Distill a custom static embedding model from a sentence transformer in under a minute without training data.
- Fine-tune a classification model on top of a pre-trained Model2Vec embedding for text categorization tasks.
- Deploy embeddings in resource-constrained environments where model size and CPU inference speed matter.
- Generate multilingual embeddings for text in any of 101 languages using the potion-multilingual model.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Model2Vec converts sentence transformers into small, fast static embedding models that generate vector representations of text for tasks like retrieval, classification, and clustering.
Yes. Model2Vec is actively maintained, has no known vulnerabilities, uses permissive MIT licensing, and offers a clear value proposition: fast, small static embeddings with strong performance. Install if you need embedding inference speed and model compactness; the low dependency footprint and HuggingFace integration make it straightforward to adopt. Requires Python >=3.10.
Install
model2vec on PyPI
pip
pip install model2vecuv
uv add model2vecpoetry
poetry add model2vecInstalling model2vec
Before you install
Low friction: pure Python wheel with six common dependencies (numpy, jinja2, joblib, safetensors, tokenizers, tqdm). Active maintenance with recent releases; last commit 2026-08-13.
License in practice
MIT License permits unrestricted use, modification, and distribution with only attribution required—no restrictions on commercial or proprietary use.
Quickstart
pip install model2vec
from model2vec import StaticModel
model = StaticModel.from_pretrained("minishlab/potion-base-32M")
embeddings = model.encode(["It's dangerous to go alone!"])
Requires Python >=3.10; pre-trained models are downloaded from HuggingFace hub on first use.
Verify before relying
- Whether distillation (via model2vec[distill]) and training (via model2vec[train]) extras are included in the base install or require separate installation.
- Actual inference speed gains and embedding quality trade-offs compared to the original sentence transformer models in specific use cases.
Package facts
| License | MIT License Copyright (c) 2024 Thomas van Dongen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — jinja2, joblib, numpy, safetensors, tokenizers, tqdm |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 941,618/month — #4,676 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: model2vec-0.9.0-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
fastembedFastEmbed generates vector embeddings for text,…
permissive · top 5,000 on PyPI
sentence-transformersComputes embeddings and reranking scores for…
permissive · top 1,000 on PyPI
transformer-smaller-training-vocabReduces transformer model vocabulary to only…
permissive · top 15,000 on PyPI
InstructorEmbeddingInstructorEmbedding generates task-specific…
permissive · top 15,000 on PyPI
pinecone-textProvides sparse and dense text encoders for…
unclear · top 15,000 on PyPI
colpali-engineColPali-engine provides training and inference…
permissive · top 15,000 on PyPI
setfitSetFit fine-tunes Sentence Transformers for…
permissive · top 15,000 on PyPI
antibertyAntiBERTy is a transformer language model…
unclear · top 15,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
fasttext-numpy2fasttext-numpy2 provides Python bindings for…
permissive · top 5,000 on PyPI