EveryDev.ai
Subscribe
Home
Tools

4,838+ AI tools

  • New
  • Trending
  • Featured
  • Rate tools
  • Compare
  • Arena
Categories
  • Agents2451
  • Coding1813
  • Infrastructure849
  • Projects696
  • Research594
  • MCP564
  • Marketing486
  • Analytics472
  • Design400
  • Testing389
  • Data362
  • Security303
  • Integration250
  • Communication239
  • Prompts233
  • Extensions216
  • Commerce167
  • Voice162
  • DevOps161
  • Web117
  • Learning113
  • Finance33
AI Tools by Topic
  • AI Coding Assistants
  • Agent Frameworks
  • MCP Servers
  • AI Prompt Tools
  • Vibe Coding Tools
  • AI Design Tools
  • AI Database Tools
  • AI Website Builders
  • AI Testing Tools
  • LLM Evaluations
Follow Us
  • X / Twitter
  • LinkedIn
  • Reddit
  • Discord
  • Threads
  • Bluesky
  • Mastodon
  • YouTube
  • GitHub
  • Instagram
Get Started
  • Users
  • Rate Tools
  • About
  • Editorial Standards
  • Corrections & Disclosures
  • Community Guidelines
  • Advertise
  • Contact Us
  • Newsletter
  • Submit a Tool
  • Start a Discussion
  • Write A Blog
  • Share A Build
  • Terms of Service
  • Privacy Policy
Explore with AI
  • ChatGPT
  • Gemini
  • Claude
  • Grok
  • Perplexity
Agent Experience
  • llms.txt
Theme
With AI, Everyone is a Dev. EveryDev.ai ©
    1. Home
    2. Tools
    3. LLM2Vec
    LLM2Vec icon

    LLM2Vec

    Retrieval-Augmented Generation
    Featured

    Open-source Python library and recipe for converting decoder-only LLMs into text encoders that produce text embeddings.

    Visit Website

    At a Glance

    Pricing
    Open Source

    LLM2Vec library released under the MIT License; free to use, copy, modify, and distribute.

    Engagement

    Available On

    API
    SDK
    CLI

    Resources

    WebsiteDocsGitHubllms.txt

    Topics

    Retrieval-Augmented GenerationAI Development LibrariesModel Management

    Alternatives

    Hugging FaceHugging Face Transformersflash-moe
    Developer
    McGill NLPMontreal, Canada

    Listed Oct 2026

    About LLM2Vec

    LLM2Vec is an open-source project from McGill NLP that turns decoder-only large language models into text encoders. It ships as a Python package (llm2vec) with training scripts, evaluation tooling, and a collection of pretrained model checkpoints on Hugging Face. The latest listed release is version 0.2.3.

    What It Is

    LLM2Vec is a three-step recipe: enable bidirectional attention, train with masked next token prediction (MNTP), and apply unsupervised contrastive learning (SimCSE). The resulting models can be fine-tuned further with supervised contrastive training. The LLM2Vec class wraps Hugging Face models to handle bidirectionality, sequence encoding, and pooling.

    How the Workflow Runs

    Users load a base model plus an optional PEFT/LoRA adapter through from_pretrained, then call encode on text or on [instruction, text] pairs to get embeddings. Mean pooling is the default and can be changed, and the maximum sequence length defaults to 512. Embeddings can be compared with cosine similarity for retrieval, classification, clustering, and sentence similarity tasks, with examples in the repository.

    Training and Evaluation

    The repository includes scripts for MNTP training, SimCSE training on Wikipedia sentences, supervised contrastive training on public E5 data, and word-level tasks such as POS, NER, and chunking. Configuration files cover Meta-Llama-3-8B, Mistral-7B, Llama-2-7B, and Sheared-Llama-1.3B. MTEB evaluation is supported through an evaluation script and per-task instructions.

    Recent Updates

    The README notes support for newer transformers versions covering Llama 3.1 and 3.2, plus Gemma and Qwen-2 models. It also announces LLM2Vec-Gen, a separate recipe for generative embeddings that encode a potential answer to a query.

    LLM2Vec - 1

    Community Discussions

    Be the first to start a conversation about LLM2Vec

    Share your experience with LLM2Vec, ask questions, or help others learn from your insights.

    Pricing

    OPEN SOURCE

    Open Source (MIT)

    LLM2Vec library released under the MIT License; free to use, copy, modify, and distribute.

    • MIT License
    • Install via pip install llm2vec
    • Python library wrapping HuggingFace decoder-only models for text encoding
    • Self-hosted; base model/compute costs are external

    Capabilities

    Key Features

    • Converts decoder-only LLMs into text encoders
    • Bidirectional attention enabling
    • Masked next token prediction (MNTP) training
    • Unsupervised contrastive learning with SimCSE
    • Supervised contrastive training
    • Instruction-aware text encoding
    • Configurable pooling mode and max sequence length
    • Word-level task training (POS, NER, chunking)
    • MTEB benchmark evaluation script
    • Pretrained checkpoints for Llama-3, Mistral, Llama-2, Sheared-Llama

    Integrations

    Hugging Face Transformers
    PEFT/LoRA
    Hugging Face Hub
    MTEB
    PyPI
    Flash Attention
    API Available
    View Docs

    Ratings & Reviews

    No ratings yet

    Be the first to rate LLM2Vec and help others make informed decisions.

    Rate other tools you’ve used

    Developer

    McGill NLP

    McGill NLP is a research group within McGill University and Mila focusing on various topics in natural language processing. It is made up of faculty members, researchers and students based in Montreal, Canada. The group publishes code for its models and datasets on GitHub so others can reproduce and build on its work.

    Montreal, Canada
    Read more about McGill NLP
    WebsiteGitHubX / Twitter
    1 tool in directory

    Similar Tools

    Hugging Face icon

    Hugging Face

    The AI community platform for collaborating on machine learning models, datasets, and applications, with over 2 million models and 500k datasets hosted.

    Hugging Face Transformers icon

    Hugging Face Transformers

    An open-source Python library serving as the model-definition framework for state-of-the-art machine learning models across text, vision, audio, video, and multimodal tasks.

    flash-moe icon

    flash-moe

    A Mixture of Experts (MoE) implementation in Python, enabling efficient sparse model inference by routing inputs to specialized expert sub-networks.

    Browse all tools

    Related Topics

    Retrieval-Augmented Generation

    RAG Systems that enhance LLM outputs by retrieving relevant information from external knowledge bases, combining the power of generative AI with information retrieval for more accurate and contextual responses.

    174 tools

    AI Development Libraries

    Programming libraries and frameworks that provide machine learning capabilities, model integration, and AI functionality for developers.

    452 tools

    Model Management

    Tools for managing, versioning, and deploying AI models.

    94 tools
    Browse all topics
    Back to all toolsSuggest an edit
    ratings
    discussions