DEV.co
Open-Source LLM · unsloth

Qwen3-Embedding-4B

Qwen3-Embedding-4B is a 4-billion-parameter text embedding model from Alibaba's Qwen team (served via unsloth). It converts text into dense vectors for retrieval, ranking, and similarity tasks. Supports 100+ languages, handles 32k token context, and can output embeddings of customizable dimensions (32–2560). Apache 2.0 licensed, ungated, with 332k downloads.

Source: HuggingFace — huggingface.co/unsloth/Qwen3-Embedding-4B
4B
Parameters
apache-2.0
License (OSI-approved)
Unknown
Context (tokens)
332.3k
Downloads (30d)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Developerunsloth
Parameters4B
Context windowUnknown
Licenseapache-2.0 — OSI-approved
Modality / taskfeature-extraction
Gated on HuggingFaceNo
Downloads332.3k
Likes2
Last updated2026-01-22
Sourceunsloth/Qwen3-Embedding-4B

What Qwen3-Embedding-4B is

Feature-extraction pipeline model based on Qwen3-4B-Base. 36 transformer layers, supports instruction-aware input, multi-representation learning (MRL) with dimension flexibility, and flash attention 2. Inference compatible with sentence-transformers (≥2.7.0), transformers (≥4.51.0), and vLLM (≥0.8.5). Last updated 22 Jan 2026.

Quickstart

Run Qwen3-Embedding-4B locally

Load the open weights with 🤗 Transformers and generate — the same model, self-hosted.

quickstart.pypython
from transformers import pipelinepipe = pipeline("text-generation", model="unsloth/Qwen3-Embedding-4B")out = pipe("Explain retrieval-augmented generation in one sentence.",           max_new_tokens=128)print(out[0]["generated_text"])

Swap in vLLM or Ollama for production-grade serving. DEV.co can stand up the inference stack.

Deployment

How you'd run it

A typical self-hosted path — open weights, an inference server, your application.

DEV.co builds each layer — from GPU infrastructure to the application.

Best use cases

Semantic Search & Retrieval

Generate embeddings for documents and queries to rank relevant passages. Instruction support allows task-specific fine-tuning (web search, FAQ retrieval, etc.). 32k context enables embedding of long documents.

Multilingual & Cross-lingual Applications

100+ language support and multilingual MTEB performance (claimed #1 ranking for 8B variant) make it suitable for global search, code retrieval across languages, and cross-lingual clustering.

Text Classification & Clustering

Dense embeddings enable downstream classifiers and clustering pipelines. Flexible dimensions (32–2560) allow trade-offs between expressiveness and latency for production systems.

Running & fine-tuning it

ESTIMATE: ~8–12 GB VRAM for FP32 inference (4B params). Flash attention 2 + FP16 reduces to ~4–6 GB. Batch inference (e.g., 32 documents) may require 16+ GB. CPU inference feasible but slow (100–500ms per document without quantization).

Model card does not mention LoRA/QLoRA or fine-tuning recipes. Based on sentence-transformers integration, LoRA fine-tuning is likely feasible via the library, but unsloth distribution may require downloading and retraining locally. No official instruction-learning guide provided.

When to avoid it — and what to weigh

  • Need Sparse Embeddings or BM25 Hybrids — This is a dense-only embedding model. If you require sparse embeddings for lexical matching or explicit BM25 fallbacks, combine with a separate lexical system.
  • Extremely Low-Latency Inference (<5ms) — 4B parameters require GPU acceleration for sub-second latency. CPU inference will be slow. Mobile/edge deployment requires quantization and will trade quality for speed.
  • No Instruction Engineering Capacity — The model improves 1–5% with task-specific instructions. If your pipeline cannot provide clear instructions or requires instruction-free embeddings, gains may be lower than expected.
  • Strongly Proprietary/Commercial Constraints — While Apache 2.0 allows commercial use, Alibaba/Qwen may update or deprecate unsloth-hosted versions. Requires review if you need multi-year stability guarantees on this specific distribution.

License & commercial use

Apache 2.0 license (OSI-approved, permissive). Grants permission to use, modify, and distribute for commercial and private purposes, provided original copyright and license notice are retained.

Apache 2.0 explicitly permits commercial use. No gating, no enterprise tiers mentioned. However, the model is distributed via unsloth's HuggingFace account (not official Qwen/Alibaba account). For production deployments requiring SLAs, multi-year stability, or vendor support, contact Alibaba directly or mirror the model in your infrastructure. Commercial viability confirmed, but support/stability outside Apache terms requires separate negotiation.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

No security audit, privacy policy, or adversarial robustness claims provided. Model accepts free-form text input; standard LLM safety considerations apply (prompt injection, jailbreaking, bias). No mention of data retention, logging, or privacy for unsloth-hosted inference. For sensitive data, self-host on private infrastructure. Apache 2.0 license does not include security guarantees.

Alternatives to consider

Qwen3-Embedding-8B (same series, larger)

Claims #1 on MTEB multilingual leaderboard (70.58 score). Use if accuracy > latency, and hardware budget allows ~16–24 GB VRAM.

Qwen3-Embedding-0.6B (same series, smaller)

600M parameters, lower latency/memory (~2–3 GB VRAM). Trade-off: lower quality for cost-constrained / edge deployments.

Sentence-BERT / all-MiniLM-L6-v2 (alternative family)

Lighter (22M–66M params), mature ecosystem, simpler to fine-tune. Multilingual variants exist but may have lower accuracy on non-English benchmarks. No instruction support.

Software development agency

Ship Qwen3-Embedding-4B with senior software developers

Evaluate this model for your retrieval pipeline. Download from HuggingFace (ungated), test locally with sentence-transformers, and integrate into your RAG or search infrastructure. For commercial deployments, review Alibaba's terms and consider self-hosting.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

Qwen3-Embedding-4B FAQ

Can I use this commercially?
Yes. Apache 2.0 license permits commercial use. The unsloth distribution is ungated. However, verify with Alibaba for SLAs, support, and long-term stability outside the license terms. Self-hosting is recommended for mission-critical systems.
What VRAM do I need to run this?
Estimate 8–12 GB for FP32 (4B params), 4–6 GB with FP16 + flash attention 2. Batch inference (32+ documents) may require 16+ GB. Use `device_map='auto'` to auto-shard across GPUs if needed.
Should I use instructions?
Yes. Model card states 1–5% improvement with task-specific instructions. Example: 'Instruct: Given a web search query, retrieve relevant passages that answer the query' (see Usage section). Write instructions in English for best results.
Can I fine-tune this for my custom dataset?
Likely yes via sentence-transformers or transformers, but no official fine-tuning guide provided. You may need to download the model locally and retrain. LoRA feasibility is unknown; requires experimentation.

Software developers & web developers for hire

From first prototype to production, DEV.co delivers software development services around tools like Qwen3-Embedding-4B. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source llms and beyond.

Deploy Qwen3-Embedding-4B for Production Search

Evaluate this model for your retrieval pipeline. Download from HuggingFace (ungated), test locally with sentence-transformers, and integrate into your RAG or search infrastructure. For commercial deployments, review Alibaba's terms and consider self-hosting.