--- id: model2vec version: "0.9.0" 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) license_treatment: permissive maintenance: active --- # model2vec — Fast State-of-the-Art Static Embeddings License: permissive · Maintenance: active · Downloads: 941.6K/mo ## 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 above — 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 pip install model2vec uv add model2vec 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_current - Install friction: low - Maintenance: active - Downloads: 941.6K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags static text embeddings, sentence transformer distillation, fast embedding inference, lightweight embedding models, text vectorization, semantic search embeddings, model compression embeddings, embeddings, model-distillation, nlp [View on SkillFed](https://skillfed.io/packages/model2vec) · [View on PyPI](https://pypi.org/project/model2vec/)