Serve Qwen3 with vLLM or Ollama. Qwen3 8B fits a 24 GB RTX 4090, Qwen3 32B fits a 48 GB L40S in AWQ 4-bit or an 80 GB card in FP8, the 30B-A3B mixture-of-experts model runs fast on 48 GB, and Qwen3 235B-A22B in FP8 fits one 288 GB B300.
- Qwen3 dense sizes
- 0.6B, 1.7B, 4B, 8B, 14B, 32B
- Qwen3 MoE models
- 30B-A3B (3B active) and 235B-A22B (22B active)
- Native context
- 32,768 tokens; up to 131,072 with YaRN (2507 releases: 262,144 native)
- Qwen3 32B KV cache
- About 0.26 MB per token in FP16
- Qwen3 235B-A22B FP8 weights
- About 235 GB: fits one B300 (288 GB) or four 80 GB GPUs
- Thinking mode
- On by default; turn off with enable_thinking false or /no_think
- Licence
- Apache 2.0
Qwen3 is the most flexible open model family to self-host. It spans dense models from 0.6B to 32B and two mixture-of-experts models, ships under Apache 2.0, and switches between a step-by-step thinking mode and fast direct answers. This guide matches each Qwen3 model to a GPU and gives the exact commands to serve it with vLLM or Ollama. It also covers the Qwen-specific settings: thinking mode, long context and tool calling.
Commands target a recent vLLM release (written against the vLLM 0.10/0.11-era command line) on Ubuntu with NVIDIA drivers. Speeds and costs are estimates with the method shown. For how inference works underneath, see the complete guide to LLM inference.
Which Qwen model should you run?
Choose by task and by VRAM. Qwen3 8B is the cheap all-rounder. Qwen3 32B is the strongest dense model in the family. Qwen3 30B-A3B gives near-32B quality at small-model speed. Qwen3 235B-A22B is the flagship open model in the family.
| Model | Hugging Face ID | Total / active params | BF16 weights | Typical GPU |
|---|---|---|---|---|
| Qwen3 8B | Qwen/Qwen3-8B | 8.2B dense | ~16 GB | RTX 4090 |
| Qwen3 14B | Qwen/Qwen3-14B | 14.8B dense | ~30 GB | L40S; RTX 4090 in FP8 |
| Qwen3 32B | Qwen/Qwen3-32B | 32.8B dense | ~66 GB | L40S (AWQ), H100 (FP8 or BF16) |
| Qwen3 30B-A3B | Qwen/Qwen3-30B-A3B | 30.5B / 3.3B | ~61 GB | L40S (FP8), H100 (BF16) |
| Qwen3 235B-A22B | Qwen/Qwen3-235B-A22B | 235B / 22B | ~470 GB | B300 (FP8), 4–8× 80 GB GPUs |
| Qwen2.5 Coder 14B (AWQ) | Qwen/Qwen2.5-Coder-14B-Instruct-AWQ | 14.7B dense | ~10 GB at 4-bit | RTX 4090 |
Qwen publishes official FP8 and AWQ versions of most of these, for example Qwen/Qwen3-32B-FP8, Qwen/Qwen3-32B-AWQ and Qwen/Qwen3-235B-A22B-FP8. July 2025 updates split the large MoE models into separate instruct and thinking variants, such as Qwen/Qwen3-235B-A22B-Instruct-2507, with a 262,144-token native context. There are also coding models such as Qwen/Qwen3-Coder-30B-A3B-Instruct. The repositories are not gated. See the Qwen3-32B model card for the full specification.
How much VRAM does each Qwen3 model need?
Weights take parameters × bytes per parameter. The KV cache depends on layers and KV heads, and you need 10–20% headroom on top. Qwen3's MoE models use only 4 KV heads, so their KV cache is small for their size.
KV per token = 2 × layers × KV heads × head dim (128) × 2 bytes
Qwen3 8B: 2 × 36 × 8 × 128 × 2 ≈ 0.15 MB
Qwen3 32B: 2 × 64 × 8 × 128 × 2 ≈ 0.26 MB
Qwen3 30B-A3B: 2 × 48 × 4 × 128 × 2 ≈ 0.10 MB
Qwen3 235B-A22B: 2 × 94 × 4 × 128 × 2 ≈ 0.19 MB| Setup | Weights | KV for one 32k sequence | Total with ~15% headroom | Fits |
|---|---|---|---|---|
| Qwen3 8B BF16 | 16.4 GB | 4.8 GB | ~24 GB | RTX 4090 only with a 16k cap; L40S comfortably |
| Qwen3 8B FP8 | 8.2 GB | 4.8 GB | ~15 GB | RTX 4090 |
| Qwen3 32B AWQ | ~19 GB | 8.6 GB | ~32 GB | L40S |
| Qwen3 32B FP8 | ~33 GB | 8.6 GB | ~48 GB | H100; L40S with a 16k cap |
| Qwen3 30B-A3B FP8 | ~31 GB | 3.2 GB | ~39 GB | L40S |
| Qwen3 235B-A22B FP8 | ~235 GB | 6.3 GB | ~278 GB | B300; 4× H100 |
| Qwen3 235B-A22B BF16 | ~470 GB | 6.3 GB | ~548 GB | 8× H100, 4× H200 (tight) |
Multiply the KV column by concurrent users for a shared endpoint. The GPU memory for LLMs guide works through concurrency in detail, and the quantisation guide covers what AWQ and FP8 cost in quality.
Option 1: How do you run Qwen without setting anything up?
Wandering Giants Compute serves several Qwen models one-click: Qwen3 8B on a 24 GB card, Qwen2.5 Coder 14B AWQ on a 24 GB card, Qwen3 32B AWQ on a 48 GB card and Qwen3 235B-A22B FP8 on a 288 GB B300. Pick the GPU, choose Chat or API, choose the model and launch. API gives you an OpenAI-compatible base URL and your own key.
export WG_BASE_URL="https://YOUR-ENDPOINT/v1" # placeholder: copy yours from the dashboard
export WG_API_KEY="your-key"
curl -s "$WG_BASE_URL/models" -H "Authorization: Bearer $WG_API_KEY"import os
from openai import OpenAI
client = OpenAI(base_url=os.environ["WG_BASE_URL"], api_key=os.environ["WG_API_KEY"])
model = client.models.list().data[0].id
# Fast answer, no thinking
r = client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": "Write a SQL query for the top 5 customers by revenue in 2026."}],
temperature=0.7, top_p=0.8,
extra_body={"top_k": 20, "chat_template_kwargs": {"enable_thinking": False}},
)
print(r.choices[0].message.content)Option 2: How do you run Qwen yourself with vLLM?
With root access, install vLLM, pick the checkpoint that fits your card, and start it with the Qwen3 reasoning parser. Add the tool-call flags if agents will call it.
Step 1: Connect and install
ssh -L 8000:localhost:8000 root@<your-gpu-address>
python3 -m venv ~/vllm-env && source ~/vllm-env/bin/activate
pip install -U pip && pip install -U vllm
export VLLM_API_KEY="$(openssl rand -hex 24)"; echo "$VLLM_API_KEY"Step 2: Start the model that fits your GPU
Qwen3 8B on an RTX 4090:
vllm serve Qwen/Qwen3-8B \
--max-model-len 16384 \
--gpu-memory-utilization 0.90 \
--reasoning-parser qwen3 \
--host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"Qwen3 32B AWQ on an L40S, with tool calling for agents:
vllm serve Qwen/Qwen3-32B-AWQ \
--served-model-name qwen3-32b \
--max-model-len 32768 \
--gpu-memory-utilization 0.92 \
--reasoning-parser qwen3 \
--enable-auto-tool-choice --tool-call-parser hermes \
--host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"Qwen3 30B-A3B in FP8 on an L40S (fast MoE):
vllm serve Qwen/Qwen3-30B-A3B-FP8 \
--max-model-len 32768 \
--gpu-memory-utilization 0.92 \
--reasoning-parser qwen3 \
--host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"Qwen3 235B-A22B in FP8 on one B300:
vllm serve Qwen/Qwen3-235B-A22B-FP8 \
--served-model-name qwen3-235b \
--max-model-len 32768 \
--gpu-memory-utilization 0.92 \
--reasoning-parser qwen3 \
--host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"The same model on four 80 GB H100s in one machine uses tensor parallelism. Qwen's FP8 MoE checkpoints can hit a block-size divisibility error when experts are split by tensor parallelism; expert parallelism avoids it:
vllm serve Qwen/Qwen3-235B-A22B-FP8 \
--tensor-parallel-size 4 \
--enable-expert-parallel \
--max-model-len 32768 \
--gpu-memory-utilization 0.92 \
--reasoning-parser qwen3 \
--host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"The 235B FP8 download is about 235 GB, so check df -h before you start.
Step 3: Extend the context to 128k with YaRN
Qwen3's original releases are trained for 32,768 tokens and extend to 131,072 with YaRN rope scaling. Only turn it on when you need it: Qwen notes that static YaRN can slightly reduce quality on short texts.
vllm serve Qwen/Qwen3-32B-FP8 \
--rope-scaling '{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":32768}' \
--max-model-len 131072 \
--gpu-memory-utilization 0.92 \
--reasoning-parser qwen3 \
--host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY"A full 131k-token sequence on Qwen3 32B needs about 131,072 × 0.26 MB ≈ 34 GB of FP16 KV cache. That fits beside FP8 weights on an RTX PRO 6000 or an H200, but not on an H100 without --kv-cache-dtype fp8. Some vLLM versions take this setting through --hf-overrides instead; vllm serve --help shows which. The 2507 releases have a 262,144-token native context and need no YaRN flag.
Step 4: Call it with thinking on or off
# Thinking on (default). The reasoning comes back in a separate field.
curl -s http://localhost:8000/v1/chat/completions \
-H "Authorization: Bearer $VLLM_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "qwen3-32b",
"messages": [{"role": "user", "content": "How many r letters are in strawberry?"}],
"temperature": 0.6, "top_p": 0.95, "top_k": 20, "max_tokens": 4096}'
# Thinking off for a fast direct answer
curl -s http://localhost:8000/v1/chat/completions \
-H "Authorization: Bearer $VLLM_API_KEY" -H "Content-Type: application/json" \
-d '{"model": "qwen3-32b",
"messages": [{"role": "user", "content": "Translate to French: the invoice is overdue."}],
"temperature": 0.7, "top_p": 0.8, "top_k": 20,
"chat_template_kwargs": {"enable_thinking": false}}'The sampling values follow Qwen's model card: temperature 0.6, top-p 0.95, top-k 20 with thinking; temperature 0.7, top-p 0.8 without. Qwen advises against greedy decoding in thinking mode because it can loop.
A tool-calling request from Python, against a server started with the tool flags:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="YOUR_VLLM_API_KEY")
tools = [{
"type": "function",
"function": {
"name": "get_gpu_price",
"description": "Get the hourly price of a GPU",
"parameters": {"type": "object",
"properties": {"gpu": {"type": "string"}},
"required": ["gpu"]},
},
}]
r = client.chat.completions.create(
model="qwen3-32b",
messages=[{"role": "user", "content": "What does an L40S cost per hour?"}],
tools=tools,
extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)
print(r.choices[0].message.tool_calls)Option 3: How do you run Qwen with Ollama?
Ollama serves 4-bit GGUF builds of Qwen3 with one command, which suits one person chatting or testing prompts.
curl -fsSL https://ollama.com/install.sh | sh
OLLAMA_CONTEXT_LENGTH=16384 ollama serve > ~/ollama.log 2>&1 & # if no service was started
ollama pull qwen3:32b # ~20 GB
ollama run qwen3:32b "Summarise the CAP theorem. /no_think"
ollama ps # check it says 100% GPU
curl -s http://localhost:11434/v1/chat/completions -H "Content-Type: application/json" \
-d '{"model": "qwen3:32b", "messages": [{"role": "user", "content": "Hello /no_think"}]}'The /no_think soft switch works in the prompt with any server. Other tags, such as qwen3:8b, qwen3:30b and qwen3:235b, are on the Ollama Qwen3 page. For multi-user serving, use vLLM instead.
How fast is Qwen3 on each GPU, and what does it cost?
Dense models follow the bandwidth rule directly. Mixture-of-experts models read only their active parameters per token, so they decode much faster than their size suggests, although routing overhead means real speeds land below the rule.
| Setup | Our price | Single-stream tok/s (est.) | $ per M tokens, one stream | Assumed batched tok/s | $ per M tokens, batched |
|---|---|---|---|---|---|
| Qwen3 8B BF16 on RTX 4090 | $1.59/hr | 37–46 | $10.64 | 800 | $0.55 |
| Qwen3 32B AWQ on L40S | $1.89/hr | 27–34 | $17.21 | 300 | $1.75 |
| Qwen3 30B-A3B FP8 on L40S | $1.89/hr | up to 157–196 | from $2.97 | 1,000 | $0.53 |
| Qwen3 32B FP8 on H100 | $4.99/hr | 36–45 | $34.23 | 600 | $2.31 |
| Qwen3 235B-A22B FP8 on B300 | $18.09/hr | up to 218–273 | from $20.47 | 2,000 | $2.51 |
Method: tokens/s ≈ 0.6–0.75 × bandwidth ÷ GB read per token (weights at the chosen precision; active parameters only for MoE), and cost per million = hourly price ÷ (tokens/s × 3,600 ÷ 1,000,000) at the midpoint. For the MoE rows, treat the speed as an upper bound and the cost as a lower bound. Dollar figures are calculated from the live prices in the price column. Batched throughput is an assumption for chat traffic with 16–64 concurrent requests, not a measurement.
Two conclusions. Qwen3 30B-A3B on a 48 GB L40S is one of the cheapest ways to get capable, fast output. And the 235B model on one B300 avoids tensor-parallel communication entirely, which is worth more than the raw price suggests. See where to rent a B300 for alternatives.
Which Qwen setup suits which job?
- Customer chat or internal assistant: Qwen3 32B AWQ on an L40S, thinking off by default, on for hard questions.
- Coding assistant: Qwen2.5 Coder 14B AWQ on an RTX 4090, or Qwen3-Coder-30B-A3B on an L40S or H100.
- Agents with tool calls: Qwen3 32B or 30B-A3B with
--tool-call-parser hermes. What AI agent infrastructure is explains the rest of the stack. - Best open quality on one GPU: Qwen3 235B-A22B FP8 on a B300.
- Reasoning comparison: test Qwen3 thinking mode against the DeepSeek R1 distills on your own tasks.
If you already run Llama, the commands are almost identical; running Llama on a cloud GPU covers its differences, mainly the gated download. For every flag used here, the vLLM documentation and the Qwen documentation are the references.
When renting from Wandering Giants Compute fits
Wandering Giants Compute fits Qwen well because the family spans our whole range. Qwen3 8B runs on an RTX 4090 at $1.59/hr, Qwen3 32B AWQ on an L40S at $1.89/hr, and Qwen3 235B-A22B FP8 on a single B300 at $18.09/hr, all one-click in Chat or behind an OpenAI-compatible API with your own key. Root gives you the machine for any other Qwen checkpoint, context length or engine. Billing is by the minute from prepaid credit, prices are shown in your own currency, and the machine stops itself when credit runs out.
If you need autoscaling endpoints that scale to zero between requests, a serverless provider will suit you better; we rent dedicated GPUs that bill while they run.
Frequently asked questions
What GPU do I need for Qwen3 32B?
In BF16 the weights are about 66 GB, so an 80 GB A100 or H100 with a modest context. The official FP8 build is about 33 GB and the AWQ 4-bit build about 19 GB, which runs on a 48 GB L40S with room for long contexts and several users.
Can Qwen3 235B run on one GPU?
Yes, in FP8 on a 288 GB B300: the weights are about 235 GB, leaving room for KV cache. On 80 GB cards you need four of them in one machine for FP8, or eight for comfortable long contexts.
Why is Qwen3 30B-A3B so fast?
It is a mixture-of-experts model with about 30 billion parameters in total but only about 3 billion active per token. Decode speed depends on the bytes read per token, so it generates text at small-model speed while needing the VRAM of a 30B model.
How do I turn off Qwen3 thinking?
Pass chat_template_kwargs with enable_thinking set to false in the request (extra_body in the OpenAI Python client), or add /no_think to the user message. Start vLLM with --reasoning-parser qwen3 so any thinking that does appear is returned separately from the answer.
Does Qwen3 support tool calling with vLLM?
Yes. Start vLLM with --enable-auto-tool-choice and --tool-call-parser hermes, and send tools in the standard OpenAI format. This is what most agent frameworks expect from an OpenAI-compatible endpoint.
Qwen3 or Llama 3.3 70B: which should I self-host?
Qwen3 32B needs less than half the memory of Llama 3.3 70B and offers a thinking mode, so it is often the better value on one GPU. Test both on your own prompts; the right choice depends on language, task and output style.
Rent the GPU for this, by the minute.
Launch Qwen3 32B AWQ on a 48 GB L40S or Qwen3 235B-A22B FP8 on a single B300, served privately behind an OpenAI-compatible API and billed by the minute.
Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.
Keep reading
- Complete guideWhat Is LLM Inference? A Complete Technical Guide
- TutorialHow to Run Llama on a Cloud GPU: Step-by-Step Guide
- TutorialHow to Run DeepSeek on Your Own GPU Infrastructure
- GuideQuantization Explained: Running Large AI Models on Smaller GPUs
- GuideHow Much GPU Memory Do You Need to Run LLMs?
- ComparisonWhere to Rent NVIDIA B300 GPUs
About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.
Last reviewed 25 November 2026.