Skip to content
Qwen logo

qwen3-embedding-0.6b

Text EmbeddingsQwenHosted

The Qwen3 Embedding model series is the latest proprietary model of the Qwen family, specifically designed for text embedding and ranking tasks.

Model Info
Context Window8,192 tokens
Unit Pricing$0.012 per M input tokens

Usage

export interface Env {
AI: Ai;
}
export default {
async fetch(request, env): Promise<Response> {
// Can be a string or array of strings]
const stories = [
"This is a story about an orange cloud",
"This is a story about a llama",
"This is a story about a hugging emoji",
];
const embeddings = await env.AI.run(
"@cf/qwen/qwen3-embedding-0.6b",
{
text: stories,
}
);
return Response.json(embeddings);
},
} satisfies ExportedHandler<Env>;

Parameters

instruction
stringdefault: Given a web search query, retrieve relevant passages that answer the queryOptional instruction for the task

API Schemas

{
"type": "object",
"properties": {
"queries": {
"oneOf": [
{
"type": "string",
"description": "A single query string",
"minLength": 1
},
{
"type": "array",
"description": "An array of query strings",
"items": {
"type": "string",
"minLength": 1
},
"maxItems": 32
}
]
},
"instruction": {
"type": "string",
"default": "Given a web search query, retrieve relevant passages that answer the query",
"description": "Optional instruction for the task"
},
"documents": {
"oneOf": [
{
"type": "string",
"description": "A single document string",
"minLength": 1
},
{
"type": "array",
"description": "An array of document strings",
"items": {
"type": "string",
"minLength": 1
},
"maxItems": 32
}
]
},
"text": {
"oneOf": [
{
"type": "string",
"description": "Alias for documents: a single text string",
"minLength": 1
},
{
"type": "array",
"description": "Alias for documents: an array of text strings",
"items": {
"type": "string",
"minLength": 1
},
"maxItems": 32
}
]
}
}
}