--- id: instructorembedding version: "1.0.1" license: Apache License 2.0 license_treatment: permissive maintenance: dormant --- # InstructorEmbedding — Text embedding tool License: permissive · Maintenance: dormant · Downloads: 636.0K/mo ## What it is and what it does InstructorEmbedding is a Python wrapper around instruction-finetuned embedding models that generate text representations tailored to specific tasks and domains. Instead of using a one-size-fits-all embedding model, you provide a natural-language instruction alongside your text—for example, 'Represent the Science title:' or 'Represent the Financial statement for retrieval:'—and the model produces embeddings optimized for that context. The package handles model loading and encoding, supporting multiple checkpoint sizes (base, large, xl) hosted on Hugging Face. The typical workflow is to instantiate a model, prepare text-instruction pairs, call encode(), and receive numpy arrays of embeddings suitable for downstream tasks like similarity computation, clustering, or information retrieval. No fine-tuning or training is required; the instruction acts as a prompt to steer the pre-trained model's output. Use it for: - Build domain-specific semantic search systems by instructing the model to optimize embeddings for retrieval in science, finance, or medicine. - Compute similarity scores between text pairs using task-aware embeddings (e.g., 'for duplicate detection' vs. 'for paraphrase matching'). - Cluster documents or sentences with embeddings tailored to your classification or grouping objective. - Implement information retrieval pipelines where queries and documents are encoded with matching instructions for better ranking. - Generate embeddings for text evaluation tasks by specifying the evaluation criterion in the instruction. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. InstructorEmbedding generates task-specific text embeddings by accepting natural-language instructions alongside text, without requiring model fine-tuning. Yes, if you need task-specific embeddings without fine-tuning and can work with a dormant package. The zero-dependency install and permissive license are advantages. However, the lack of maintenance since May 2023 and unspecified Python version support mean you should test compatibility in your environment and be prepared to maintain a fork if critical issues arise. ## Install pip install instructorembedding uv add instructorembedding poetry add instructorembedding ## Installing InstructorEmbedding Before you install: Installation is straightforward with no runtime dependencies and a pure-Python wheel distribution. The package is dormant (last release May 2023, last commit January 2025), so expect no active maintenance or bug fixes. License in practice: Apache License 2.0 is permissive, allowing commercial use, modification, and distribution with minimal restrictions—suitable for most projects. Quickstart: pip install InstructorEmbedding from InstructorEmbedding import INSTRUCTOR model = INSTRUCTOR('hkunlp/instructor-large') embeddings = model.encode([['Represent the Science title:', 'Example text']]) Model weights are downloaded from Hugging Face on first use; requires internet access and sufficient disk space for the chosen checkpoint. Verify before relying: - Whether the package works with modern Python versions (requires_python is unspecified in metadata). - Performance characteristics and memory requirements for different model sizes (base, large, xl). - Compatibility with recent versions of underlying NLP libraries after 18+ months of dormancy. ## Package facts - License: Apache License 2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 636.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags instruction-based text embeddings, task-specific embedding generation, text embedding without fine-tuning, domain-aware sentence embeddings, customizable NLP embeddings, embedding model with instructions, semantic text representation, retrieval and clustering embeddings, text-embeddings, instruction-tuning, semantic-search [View on SkillFed](https://skillfed.io/packages/instructorembedding) · [View on PyPI](https://pypi.org/project/instructorembedding/)