skillfed

model2vec

Fast State-of-the-Art Static Embeddings

model2vec v0.9.0 941.6K downloads/30d#4,676 on PyPI2,176
Permissive 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) Active released

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 model2vec

uv

uv add model2vec

poetry

poetry add model2vec

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Software Development :: Libraries

Tags

static text embeddingssentence transformer distillationfast embedding inferencelightweight embedding modelstext vectorizationsemantic search embeddingsmodel compression embeddings
embeddingsmodel-distillationnlp

More Libraries packages

Further reading