all-MiniLM-L12-v2
all-MiniLM-L12-v2 is a sentence embedding model from Sentence Transformers with a 512-token context window.
Compact sentence embeddings for semantic search
all-MiniLM-L12-v2 is a sentence embedding model developed by Sentence Transformers and released in February 2023. It is based on the MiniLM architecture with 12 transformer layers, and it maps input text to dense 384-dimensional vector representations. The model was trained on a large dataset of over one billion sentence pairs using a contrastive learning objective, making it well-suited for tasks that require comparing or retrieving text by meaning.
This model is designed for use cases such as semantic search, sentence similarity scoring, clustering, and information retrieval. Its 512-token context window accommodates most short-to-medium length text inputs, and its compact size relative to larger transformer models makes it practical for applications where inference speed and resource efficiency matter. It is available through DeepInfra and is widely used in retrieval-augmented generation (RAG) pipelines as a text encoder.
What all-MiniLM-L12-v2 supports
Text Embeddings
Converts input text into dense 384-dimensional vector representations suitable for downstream similarity and retrieval tasks.
Semantic Search
Encodes queries and documents into a shared vector space so that semantically related texts score higher in nearest-neighbor lookups.
Sentence Similarity
Produces embeddings that can be compared with cosine similarity to score how closely two sentences match in meaning.
Text Clustering
Generates fixed-size vectors that allow grouping of large text collections by topic or meaning using standard clustering algorithms.
RAG Encoding
Serves as the retrieval encoder in retrieval-augmented generation pipelines, embedding passages within a 512-token context window.
Ready to build with all-MiniLM-L12-v2?
Get Started FreeCommon questions about all-MiniLM-L12-v2
What is the context window for all-MiniLM-L12-v2?
The model supports a maximum of 512 tokens per input. Text longer than this limit will be truncated before encoding.
What size are the embeddings this model produces?
all-MiniLM-L12-v2 outputs 384-dimensional dense vectors for each input text.
What is the pricing for using this model on DeepInfra?
Pricing information is not included in the available metadata. Check the DeepInfra model page directly for current pricing details.
Does this model support image or video inputs?
No. all-MiniLM-L12-v2 is a text-only embedding model and does not accept image or video inputs.
What tasks is all-MiniLM-L12-v2 best suited for?
The model is designed for semantic search, sentence similarity, text clustering, and as a retrieval encoder in RAG pipelines. It is not a generative model and does not produce text responses.
Explore similar models
Start building with all-MiniLM-L12-v2
No API keys required. Create AI-powered workflows with all-MiniLM-L12-v2 in minutes — free.