Qwen

Qwen3-Embedding-4B

4B parameters · Base · Qwen3 family

apache-2.0 hash verified source matched revision pinned
Good for: RAG & retrieval

Which version should I download?

Default pick: GGUF · Q4_K_M — Balanced size/quality — good default.

Set your rig to confirm it fits and to see if a higher-quality quant runs fully on your hardware.

Set your rig

GGUF · Q4_K_M

2.33 GB

Est. speed
Swarm
2S / 0L webseed OK

Balanced size/quality — good default.

Want a different quant? Request it on the board →

Runs fully on

Green = the model's best quant fits fully in GPU/unified memory at 8K context. Tap a card for its full "what runs on it" page.

Context

Advertised 40k · no independent evidence yet

No independent long-context evidence has been graded for this model yet — the advertised window above is the maintainer's number, not a usable-context claim.

Run it

Runtime completeness (Q4_K_M torrent): llama.cpp ✅ Ollama – vision sidecar –

  • Ollama — runs the GGUF directly; no Modelfile bundled
  • vision sidecar — not a vision model

Context / KV 8,192 tokens · FP16 set above the quant table

Generic commands (no rig set). GPU-offload values assume the model fits on your GPU — set your rig for values tuned to your hardware.

Start the server
llama-server -m Qwen3-Embedding-4B-Q4_K_M.gguf -c 8192 -ngl 999 --embeddings

Embedding model: POST to the /embedding endpoint (no chat completion).

Save as Modelfile next to the GGUF (Modelfile)
FROM ./Qwen3-Embedding-4B-Q4_K_M.gguf
PARAMETER num_ctx 8192
PARAMETER num_gpu 999
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"
# Chat template: Ollama uses the template embedded in the GGUF (no TEMPLATE directive needed).
Create
ollama create qwen-qwen3-embedding-4b -f Modelfile
Run
ollama run qwen-qwen3-embedding-4b

GGUF is not a first-class vLLM format.

vLLM GGUF support is experimental and single-file only; prefer safetensors/GPTQ/AWQ for production. If you must, pass the .gguf path to `vllm serve` with --load-format gguf on a recent vLLM.

transformers does not load GGUF weights.

GGUF weights run under llama.cpp, Ollama or LM Studio.

Load Qwen3-Embedding-4B-Q4_K_M.gguf, set the context length to 8192 tokens. Set GPU offload to Max (all layers).

MLX runs MLX-format weights only (Apple Silicon). This quant is a GGUF build.

GGUF weights run under llama.cpp, Ollama or LM Studio.

Technical details

Chat template

{%- if tools %}
    {{- '<|im_start|>system\n' }}
    {%- if messages[0]['role'] == 'system' %}
        {{- messages[0]['content'] }}
    {%- else %}
        {{- 'You are a helpful assistant.' }}
    {%- endif %}
    {{- "\n\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
    {%- for tool in tools %}
        {{- "\n" }}
        {{- tool | tojson }}
    {%- endfor %}
    {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
{%- else %}
    {%- if messages[0]['role'] == 'system' %}
        {{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
    {%- else %}
        {{- '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }}
    {%- endif %}
{%- endif %}
{%- for message in messages %}
    {%- if (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
        {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
    {%- elif message.role == "assistant" %}
        {{- '<|im_start|>' + message.role }}
        {%- if message.content %}
            {{- '\n' + message.content }}
        {%- endif %}
        {%- for tool_call in message.tool_calls %}
            {%- if tool_call.function is defined %}
                {%- set tool_call = tool_call.function %}
            {%- endif %}
            {{- '\n<tool_call>\n{"name": "' }}
            {{- tool_call.name }}
            {{- '", "arguments": ' }}
            {{- tool_call.arguments | tojson }}
            {{- '}\n</tool_call>' }}
        {%- endfor %}
        {{- '<|im_end|>\n' }}
    {%- elif message.role == "tool" %}
        {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
            {{- '<|im_start|>user' }}
        {%- endif %}
        {{- '\n<tool_response>\n' }}
        {{- message.content }}
        {{- '\n</tool_response>' }}
        {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
            {{- '<|im_end|>\n' }}
        {%- endif %}
    {%- endif %}
{%- endfor %}
{%- if add_generation_prompt %}
    {{- '<|im_start|>assistant\n' }}
{%- endif %}

Stop strings

<|im_end|> <|endoftext|>

Evidence & provenance

Source

Revision pin
5cf2132abc99cad020ac570b19d031efec650f2b
Manifest
Present

License

Name
apache-2.0
Commercial use
yes
Access
Open

How verification works →

File hashes (SHA-256)

  • qwen3-embedding-4b-q4-k-m/LICENSE cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30
  • qwen3-embedding-4b-q4-k-m/Qwen3-Embedding-4B-Q4_K_M.gguf 2b0cf8f17b4c723c27303015383c27ec4bf2d8314bb677d05e920dd70bb0f16b
  • qwen3-embedding-4b-q4-k-m/README.md f25406a76baf204223bd3b89dd0b7f09f97f1b21ad5bb1fa400617874ca31003

Explore further

Get an email when a better quant fits your rig.

Set your rig once; we'll alert you when a new or better-fitting build lands.

Set your rig

Performance reports

Real-world throughput reported by the community (and scraped sources).

Community

Reviews, sampler presets and community runtime reports. Be the first to contribute.

Reviews (0)

Log in to write a structured review of this model.

No reviews yet.

Sampler presets

Log in to share a sampler preset or vote on presets.

No presets yet.

Community runtime reports

Unofficial, community-submitted "it loads for me" reports. These are not the official verified-working badge — an admin reviews reports before anything is marked officially verified.

Log in to report whether a quant loads in your runtime.

No community reports yet.

selected to compare · pick at least 2