Using Qwen3-Embedding-8B on Chutes
Qwen3-Embedding-8B is Alibaba's flagship text embedding model, built on Qwen3-8B and ranked No.1 on the MTEB multilingual leaderboard per its model card (June 5, 2025, score 70.58). On Chutes it is served through an OpenAI-compatible /v1/embeddings endpoint inside a Trusted Execution Environment, so any OpenAI SDK works out of the box.
Overview
The Qwen3 Embedding series adapts the dense Qwen3 foundation models for embedding and ranking tasks, shipping in 0.6B, 4B, and 8B sizes plus matching rerankers. The 8B model is a 36-layer dense transformer with a hidden size of 4096 that produces embeddings via last-token pooling. Two properties are worth knowing before you integrate it:
- Flexible dimensions (MRL). Vectors are up to 4096 dimensions, and the model supports user-defined output dimensions anywhere from 32 to 4096, so you can truncate to fit your vector store.
- Instruction awareness. Queries formatted as
Instruct: <task description>\nQuery: <text>retrieve 1-5% better than bare queries, per the model card. Documents are embedded without an instruction. Write instructions in English even for multilingual corpora.
The model card reports support for more than 100 languages including programming languages, with strong results on code retrieval, cross-lingual retrieval, classification, and clustering. Reported benchmark scores: 70.58 mean (task) on MTEB multilingual, 75.22 on MTEB English v2, 73.84 on C-MTEB Chinese. The weights are Apache-2.0.
Model specifications
| Property | Value |
|---|---|
| Parameters | 8B (7.57B in safetensors) |
| Architecture | Dense Qwen3 transformer, 36 layers, hidden size 4096, last-token pooling |
| Max positions (config.json) | 40,960 tokens |
| Sequence length (model card) | 32K tokens |
| Embedding dimension | Up to 4096, user-definable 32-4096 (MRL) |
| Languages | 100+ |
| License | Apache-2.0 |
| Modalities | Text in, embedding vector out |
| Release | June 2025 |
Quick start
The chute runs on its own host with the OpenAI embeddings contract. The request body is flat JSON.
curl -X POST "https://chutes-qwen-qwen3-embedding-8b-tee.chutes.ai/v1/embeddings" \
-H "Authorization: Bearer $CHUTES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Instruct: Given a web search query, retrieve relevant passages that answer the query\nQuery: What is confidential computing?",
"model": "Qwen/Qwen3-Embedding-8B-TEE"
}'
import os
from openai import OpenAI
client = OpenAI(
base_url="https://chutes-qwen-qwen3-embedding-8b-tee.chutes.ai/v1",
api_key=os.environ["CHUTES_API_KEY"],
)
# Queries: prefix with a one-sentence task instruction (1-5% better retrieval).
# Documents: embed as-is, no instruction.
resp = client.embeddings.create(
model="Qwen/Qwen3-Embedding-8B-TEE",
input="Instruct: Given a web search query, retrieve relevant passages that answer the query\nQuery: What is confidential computing?",
)
vector = resp.data[0].embedding # up to 4096 floats
const resp = await fetch(
"https://chutes-qwen-qwen3-embedding-8b-tee.chutes.ai/v1/embeddings",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CHUTES_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: "The capital of France is Paris.",
model: "Qwen/Qwen3-Embedding-8B-TEE",
}),
}
);
const { data } = await resp.json();
console.log(data[0].embedding.length);
Parameters and tuning
The endpoint takes two fields per the chute's llms.txt:
input(string, required): the text to embed.model(string, optional, default null): passQwen/Qwen3-Embedding-8B-TEEfor OpenAI-SDK compatibility.
There are no sampling parameters; embeddings are deterministic for a given input. The main tuning levers live on your side of the API: the query-side instruction prefix described above, chunk size for documents (long inputs are supported up to the context limit, but passage-level chunks usually retrieve better), and vector truncation. If you truncate to fewer dimensions, re-normalize before cosine similarity.
What it's best at
Concrete fits, based on the model card's evaluation coverage:
- Multilingual RAG retrieval. 100+ language support and top-of-leaderboard MTEB multilingual scores make it a strong default embedder for mixed-language corpora.
- Code search. The series was evaluated on code retrieval and supports programming languages as input.
- Classification and clustering. The card reports 74.00 classification and 57.65 clustering means on MTEB multilingual.
- Confidential document pipelines. The TEE serving mode suits embedding contracts, medical records, or other regulated text.
- Paired reranking. Combine with a Qwen3-Reranker model as a cross-encoder second stage.
Not a fit: text generation or chat (it returns vectors, not tokens), image or audio embedding (text only), and edge deployments where the 0.6B or 4B siblings deliver most of the quality at a fraction of the compute.
How Chutes serves this model
The -TEE suffix means this deployment runs inside a Trusted Execution Environment: attested confidential-compute hardware that keeps your inputs encrypted in memory during processing. This is a serving-level property; the embedding vectors are those of the upstream Qwen/Qwen3-Embedding-8B model. The chute is served on a dedicated host (https://chutes-qwen-qwen3-embedding-8b-tee.chutes.ai) rather than the shared LLM router, exposes POST /v1/embeddings and GET /v1/models, and authenticates with Authorization: Bearer $CHUTES_API_KEY.
Related resources: the model page, the machine-readable llms.txt, and the callable OpenAPI spec.
FAQ
How many dimensions do the embeddings have?
Up to 4096. The model supports user-defined output dimensions from 32 to 4096 (MRL support per the model card), so you can truncate vectors to fit your vector database and latency budget with modest quality loss.
What is the maximum input length?
The Hugging Face config sets max_position_embeddings to 40,960 tokens, and the model card lists a 32K sequence length. For retrieval quality, chunking long documents into passages is still standard practice.
Do I need to add an instruction to my inputs?
For queries, yes, ideally: format them as Instruct: <one-sentence task description>\nQuery: <query>. The model card reports a 1-5% retrieval improvement from query-side instructions. Documents should be embedded as-is without an instruction.
Can I call it with the OpenAI SDK?
Yes. Point the SDK at base_url https://chutes-qwen-qwen3-embedding-8b-tee.chutes.ai/v1 with your Chutes API key and call client.embeddings.create. The endpoint follows the OpenAI embeddings contract.
What does the TEE suffix mean?
The model runs inside a Trusted Execution Environment: confidential-compute hardware that keeps prompts and outputs encrypted in memory and attestable. It is a serving-level property and does not change the embeddings the model produces.
What license is Qwen3-Embedding-8B under? Can I use it commercially?
Apache-2.0, per the Hugging Face repo Qwen/Qwen3-Embedding-8B. Apache-2.0 permits commercial use, modification, and redistribution with attribution and license notice.
How good is it compared to other embedding models?
Its model card reports 70.58 mean task score on MTEB multilingual (No.1 on the leaderboard as of June 5, 2025), 75.22 on MTEB English v2, and 73.84 on C-MTEB Chinese, ahead of gte-Qwen2-7B-instruct, NV-Embed-v2, and text-embedding-3-large in the card's comparison tables.