# Qwen3 Embedding 4b

**Qwen3 Embedding 4B** is a 4B-parameter multilingual embedding model (36 layers, 32K context) that outputs 2560‑dim vectors for text/code retrieval, classification, clustering, and bitext mining. It supports instruction-conditioned embeddings and is optimized for efficient, cross-lingual representation learning.

## Model details

| Category | Details |
|----------|----------|
| **Model Name** | Qwen/Qwen3-Embedding-4B |
| **Version** | Original |
| **Model Category** | Embedding |
| **Size** | 4B parameters |
| **HuggingFace Model** | [Qwen/Qwen3-Embedding-4B](https://huggingface.co/Qwen/Qwen3-Embedding-4B) |
| **OpenAI Compatible Endpoint**| [Embeddings](https://developers.openai.com/api/reference/resources/embeddings/methods/create) |
| **License** | [Apache 2.0](https://huggingface.co/datasets/choosealicense/licenses/resolve/main/markdown/apache-2.0.md) |

## Capabilities 

| Feature | Status |
|---------|--------|
| Context Length | 32k tokens |
| Input Data | Text |
| Output Dimensions | 256, 512, 1024, 2048, 4096 |

## Usage 

### Embedding

```ts
const modelResponse = await Azion.AI.run("Qwen/Qwen3-Embedding-4B", {
  "input": "The food was delicious and the waiter...",
  "encoding_format": "float"
})
```

Response example:

```json
{"id":"embd-84a83438abff420e9c785c1659ae8ad6","object":"list","created":1746821207,"model":"Qwen/Qwen3-Embedding-4B","data":[{"index":0,"object":"embedding","embedding":[0.01,...,0.005]}],"usage":{"prompt_tokens":11,"total_tokens":11,"completion_tokens":0,"prompt_tokens_details":null}}
```

Different dimensions can be selected by setting the `dimensions` parameter:

```ts
const modelResponse = await Azion.AI.run("qwen-qwen3-embedding-4b", {
  "input": "The food was delicious and the waiter...",
  "encoding_format": "float",
  "dimensions": 256
})
```

## JSON Schema

```json
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "required": [
        "input"
    ],
    "properties": {
        "encoding_format": {
            "type": "string",
            "enum": [
                "float",
                "base64"
            ]
        },
        "dimensions": {
            "enum": [
                256,
                512,
                1024,
                2048,
                4096
            ]
        },
        "input": {
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "type": "array",
                    "items": {
                        "oneOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "integer"
                            },
                            {
                                "type": "array",
                                "items": {
                                    "type": "integer"
                                }
                            }
                        ]
                    }
                }
            ]
        }
    }
}
```