Qwen (Alibaba) - Open weights - verified
Qwen3-Embedding-8B embeddings
Qwen3-Embedding-8B is a current embedding model from Qwen (Alibaba), with open weights on Hugging Face at Qwen/Qwen3-Embedding-8B. It returns 4,096-dimension vectors by default and accepts up to 32,768 input tokens, for text and code input. There is no API price: the weights download from Hugging Face under Apache 2.0, and you pay for the compute you run them on.
CurrentModel id: Qwen/Qwen3-Embedding-8B- weights: Qwen/Qwen3-Embedding-8B
- Default dims
- 4,096
- Max input
- 32,768 tok
- Price / 1M
- Self-hosted
- Inputs
- Text, Code
Dimensions
Flexible output size- 4,096default
Default output: 4,096 dimensions.
Qwen (Alibaba) documents shorter output vectors for this model (Matryoshka-style), so you can store smaller embeddings by asking for fewer dimensions instead of re-embedding with another model.
Pricing
No API price: the weights are on Hugging Face and you run them on your own hardware or host.
Open weights
- Hugging Face repo
- Qwen/Qwen3-Embedding-8B
- License
- Apache 2.0
apache-2.0 - Commercial use
- Commercial use allowedCommercial use is allowed, per the license.
- Parameters
- 7.57B (7,567,295,488)
Worth knowing
The card supports user-defined output dimensions from 32 to 4096 (MRL), a 32k context, 100+ languages, and recommends a task instruction on the query side only.
Released . Multilingual: yes.
Usage
Copied verbatim from the page linked below. Placeholders such as project ids and API keys are the source's own.
# Requires transformers>=4.51.0
# Requires sentence-transformers>=2.7.0
from sentence_transformers import SentenceTransformer
# Load the model
model = SentenceTransformer("Qwen/Qwen3-Embedding-8B")
# We recommend enabling flash_attention_2 for better acceleration and memory saving,
# together with setting `padding_side` to "left":
# model = SentenceTransformer(
# "Qwen/Qwen3-Embedding-8B",
# model_kwargs={"attn_implementation": "flash_attention_2", "device_map": "auto"},
# tokenizer_kwargs={"padding_side": "left"},
# )
# The queries and documents to embed
queries = [
"What is the capital of China?",
"Explain gravity",
]
documents = [
"The capital of China is Beijing.",
"Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.",
]
# Encode the queries and documents. Note that queries benefit from using a prompt
# Here we use the prompt called "query" stored under `model.prompts`, but you can
# also pass your own prompt via the `prompt` argument
query_embeddings = model.encode(queries, prompt_name="query")
document_embeddings = model.encode(documents)
# Compute the (cosine) similarity between the query and document embeddings
similarity = model.similarity(query_embeddings, document_embeddings)
print(similarity)FAQ
How many dimensions does Qwen3-Embedding-8B output?
Default output: 4,096 dimensions. Qwen (Alibaba) documents shorter output vectors for this model (Matryoshka-style), so you can store smaller embeddings by asking for fewer dimensions instead of re-embedding with another model.
What is the max input length of Qwen3-Embedding-8B?
32,768 tokens per input, per the model card. Longer text has to be chunked before you embed it.
Can I use Qwen3-Embedding-8B commercially?
Qwen3-Embedding-8B is released under Apache 2.0, and commercial use is allowed. The license text is at https://www.apache.org/licenses/LICENSE-2.0.
What can Qwen3-Embedding-8B embed?
Text and code input, per the provider. It is documented as multilingual.
Sources
Last verified from the pages below.
- Hugging Face model card - huggingface.co
- Hugging Face API (safetensors, cardData) - huggingface.co
More Qwen (Alibaba) embedding models
Default dimensions, max input tokens and list price per 1M tokens.
All embedding models - Open-weight embedding models
Newsletter
New models, every week
One email per week. New model releases, embedding and retrieval updates and what they mean for what you build.
Keep exploring
Model API pricing and specs
First-party prices per 1M tokens for chat and reasoning models.
Local models
Open-weight LLMs you can download and run, with sizes and licenses.
What is RAG?
Where embeddings fit in a retrieval pipeline, end to end.
Vector databases compared
Where the vectors go once you have picked a model.