Qwen3.8-27B VRAM requirements
fits 24GB cards (3090 / 4090), 3.6 GiB to spare · official FP8 needs 31.4 GiB
Qwen3.8-27B needs 17.4 GiB at Q4_K_M (bartowski build) at 8K context and 18.9 GiB at 32K (reported KV counted) — 24GB cards (RTX 3090 or 4090, 22.5 GiB usable) run it with 3.6 GiB to spare. The official FP8 build needs 31.4 GiB and a 48GB-class card at 32K. 12–16GB cards run unsloth's dynamic low-bit builds — 1-bit is tight on 12GB (2.1 GiB spare, under the 2.5 GiB threshold), and 16GB tops out at 2-bit (IQ2_S, 11.7 GiB, 2.8 GiB spare). The 3-bit door is a knife-edge: Q3_K_S lands exactly on the 14.5 GiB line (0.00 spare) and IQ3_XS misses by 0.06 — do not buy a 16GB card expecting 3-bit at 32K.
Prepared by LLM VRAM · build · weights measured at pinned revisions, context and overhead explicit · sources below
ollama run hf.co/bartowski/Qwen3.8-27B-GGUF:Q4_K_M — comfortable on 24GB cards (3090 / 4090), even at 32K. In the session, /set parameter num_ctx 32768 selects the 32K configuration priced here.ollama run qwen3.8:27b pulls the official build; this page measures the bartowski file. Buying for it? On a budget, price a used RTX 3090 first.Why 4K and 32K?
4K is the lightweight first-run comparison. Ollama's FAQ documents a 4096-token default, and its current context guide uses 4K below 24 GiB of VRAM. That gives you a practical low-memory starting point, not a universal default on every machine.
32K is this site's comparison baseline. It answers the same longer-context question across models and quants instead of changing the ruler with each runtime default. On this page, Q4_K_M moves from about 17.1 GiB at 4K to 18.9 GiB at 32K, and still fits a 24GB card.
The model's 256K context is a different claim. It comes from the model configuration (max_position_embeddings=262144), not from a promise that your runtime or GPU can allocate it. Current llama.cpp uses -c 0 to load the context from the model by default. Set -c 4096 or -c 32768 explicitly to reproduce either configuration priced here.
Qwen3.8-27B is Alibaba's hybrid-linear model; the model card counts the language model at 27B; the published file index totals 27.78B once the built-in vision tower is included. The official config.json declares a vision_config, and the GGUF repos ship the projector separately as mmproj files (not counted in the sizes here). Its 48 linear-attention plus 16 full-attention layers (64 total, per the same config.json layer_types) are why its KV cache stays around 2.14 GiB even at 32K context (config-derived: 65,536 bytes/token across the 16 full-attention layers, consistent with the published SGLang calculator — plus a small linear-attention state): the reason a 27B-class model fits 24GB at all. Open weights, Apache-2.0, 256K context.
Page built · each pinned source carries its own access date in Where every number comes from
How much VRAM at each quantization? (listed file size + runtime allowance + 32K KV)
| Quantization | VRAM needed @32K | KV @32K reported i · already in the left column | Smallest tracked fit (context noted) | Note |
|---|---|---|---|---|
| UD_IQ1_S | 8.4 GiB | 2.14329 GiB | RTX 3060 12GB | listed file size 5.8 GiB · estimated total includes 32K KV |
| UD_IQ2_S | 10.4 GiB | 2.14329 GiB | RTX 3060 12GB | listed file size 7.8 GiB · estimated total includes 32K KV |
| IQ2_S | 11.7 GiB | 2.14329 GiB | RTX 3060 12GB · ≤~13K ctx | listed file size 9.0 GiB · estimated total includes 32K KV |
| IQ3_XS | 14.6 GiB | 2.14329 GiB | RTX 4060 Ti 16GB · ≤~31K ctx | listed file size 11.9 GiB · estimated total includes 32K KV |
| Q4_K_M | 18.9 GiB | 2.14329 GiB | RTX 3090 24GB | listed file size 16.2 GiB · estimated total includes 32K KV |
| UD_Q5_K_XL | 22.1 GiB | 2.14329 GiB | RTX 3090 24GB | listed file size 19.4 GiB · estimated total includes 32K KV |
| Q5_K_M | 22.1 GiB | 2.14329 GiB | RTX 3090 24GB | listed file size 19.5 GiB · estimated total includes 32K KV |
| Q6_K | 24.9 GiB | 2.14329 GiB | RTX 5090 32GB | listed file size 22.2 GiB · estimated total includes 32K KV |
| Q8_0 | 29.3 GiB | 2.14329 GiB | RTX 5090 32GB | listed file size 26.6 GiB · estimated total includes 32K KV |
| FP8 | 31.4 GiB | 2.14329 GiB | RTX 5090 32GB · ≤~10K ctx | listed file size 28.7 GiB · estimated total includes 32K KV |
| UD_Q8_K_XL | 31.9 GiB | 2.14329 GiB | 2× RTX 3090 24GB (48GB aggregate) | listed file size 29.3 GiB · estimated total includes 32K KV |
| BF16 | 54.4 GiB | 2.14329 GiB | — | listed file size 51.7 GiB · estimated total includes 32K KV |
GB vs GiB: card names are the manufacturer's nominal GB; totals here are GiB (230 bytes) — a "24GB" card holds 24 GiB, and a file quoted 17.4 GB in decimal is the same 16.2 GiB. Caliber →
The 48GB-class doors, spelled out: a dual-GPU combo (2× 24GB; not one card doubled: topology, power and tensor-parallel split overhead apply), a workstation card (RTX 6000 Ada), or a Mac Studio (unified memory; runs, slower tok/s).
How this page computes the numbers (reproduce any cell)
- usable VRAM = nominal minus reserve, per card: 12GB → 10.5 GiB, 16GB → 14.5 GiB, 24GB → 22.5 GiB, 32GB → 30.0 GiB, 2× RTX 3090 24GB (48GB aggregate) → 45.0 GiB.
- total@32K = listed file size + provisional runtime allowance + KV@32K; KV@32K = 2.14329 GiB (config-derived stacked upper bound — 70,231 B/token effective at 32K; actual ≤ value, composition in sources)
- total@32K (main column) = listed file size + provisional runtime allowance + config-derived KV@32K. The 4K figures in the FAQ are a secondary comparison scenario, not a runtime default.
- The "≤~XK ctx" note = 8K + 32K × (usable − total@8K) ÷ KV@32K — the context length that exactly fills the card (KV grows linearly with context on this model).
- A build fits a card at 32K when total@32K ≤ usable; tight = under 2.5 GiB of headroom, one site-wide threshold.
Is your GPU enough? (find your card: one row tells you)
| Your GPU | VRAM | Biggest quant that fits (ceiling) | How it feels |
|---|---|---|---|
| RTX 3060 12GB | 12 GB | UD_IQ2_S (2-bit) · 10.4 GiB | 0.06 GiB spare at 32K (KV counted) |
| RTX 4060 Ti 16GB | 16 GB | IQ2_S (2-bit) · 11.7 GiB | 2.8 GiB spare at 32K (KV counted) |
| RTX 3090 24GB | 24 GB | Q5_K_M (5-bit) · 22.1 GiB | 0.4 GiB spare at 32K (KV counted) |
| RTX 4090 24GB | 24 GB | Q5_K_M (5-bit) · 22.1 GiB | 0.4 GiB spare at 32K (KV counted) |
| RTX 5090 32GB | 32 GB | Q8_0 (8-bit) · 29.3 GiB | 0.7 GiB spare at 32K (KV counted) |
| 2× RTX 3090 24GB (48GB aggregate) | 48 GB | UD_Q8_K_XL (8-bit) · 31.9 GiB | 13.1 GiB spare at 32K (KV counted) |
Quants stack by size within the GGUF ladder: a card that runs a bigger build runs every smaller one. So each GPU has exactly one ceiling — the largest build that fits, whichever publisher's — and this table names it: nothing else to cross-reference. Ceilings are full-GPU at 32K — every layer on the card; shorter context raises them a step, and CPU offload runs bigger quants partially in system RAM, trading tok/s — on this dense model use llama.cpp --n-cpu-ffn N (or -ngl); --n-cpu-moe only moves MoE expert tensors and does nothing here (see the llama.cpp parameter reference).
What GPU should you buy for it? (the 24GB sweet spot logic)
| The logic | 24GB is the cheapest tier that runs Q4_K_M comfortably (18.9 GiB at 32K, 3.6 GiB to spare). Below it, 12–16GB cards save money but top out at 2-bit quants (3-bit now misses 16GB). Above it, a 32GB RTX 5090 buys Q8_0 (tight) and Q6_K comfortably; nice, not necessary. |
| Why it fits | Hybrid-linear attention keeps KV cache at 2.14 GiB even at 32K context; a full-attention 28B would not come close to 24GB |
| Source | bartowski GGUF (pinned) + official config · 2026-09 · official files verified |
⚠ Tight is a site-wide threshold: under 2.5 GiB of headroom. This config leaves 3.6 GiB at 32K (comfortable). The tightest fit on 24GB is the Q5_K_M build: 22.1 GiB, about 0.4 GiB to spare.
Tracked builds (actual file sizes, not theory)
| Build | Publisher | File size | 24GB @32K | Source |
|---|---|---|---|---|
| UD_IQ1_S | unsloth | 5.8 GiB | OK · 8.4 | HF @4ca72078 verified |
| UD_IQ2_S | unsloth | 7.8 GiB | OK · 10.4 | HF @4ca72078 verified |
| IQ2_S | bartowski | 9.0 GiB | OK · 11.7 | HF @0c92138c verified |
| IQ3_XS | bartowski | 11.9 GiB | OK · 14.6 | HF @0c92138c verified |
| Q4_K_M | bartowski | 16.2 GiB | OK · 18.9 | HF @0c92138c verified |
| UD_Q5_K_XL | unsloth | 19.4 GiB | TIGHT · 22.1 | HF @4ca72078 verified |
| Q5_K_M | bartowski | 19.5 GiB | TIGHT · 22.1 | HF @0c92138c verified |
| Q6_K | bartowski | 22.2 GiB | NO · 24.9 | HF @0c92138c verified |
| Q8_0 | ggml-org | 26.6 GiB | NO · 29.3 | HF @efbb3b1f verified |
| FP8 | Qwen | 28.7 GiB | NO · 31.4 | HF @017b9c7a verified |
| UD_Q8_K_XL | unsloth | 29.3 GiB | NO · 31.9 | HF @4ca72078 verified |
| BF16 | Qwen | 51.7 GiB | NO · 54.4 | HF @1d4bf0f2 verified |
Q4 is the sweet spot this page anchors on, and the build decides the size within it. At Q4_K_M the spread between publishers is real: unsloth's dynamic build (15.3 GiB of weights) vs bartowski's canonical (16.2 GiB) vs ggml-org's (17.7 GiB) — 2.3 GiB on the same quant name (17.67 − 15.33; the one-decimal labels round to 17.7 and 15.3). unsloth's UD-Q4 family is calibrated against the standard Q4_K_* ladder: UD Q4_K_S (14.3 GiB) undercuts every standard Q4 build, and UD Q4_K_XL (16.4 GiB) reaches Q4_K_L territory for less than bartowski's Q4_K_L (17.5 GiB). At the smaller Q4 names the publishers track each other closely: unsloth's and bartowski's Q4_0 and Q4_1 builds sit within 2% of each other (near-mirror builds — and neither is in this page's build table, which prices the builds we quote). At 32K on a 24GB card, everything through Q5_K_M fits; the two standard Q4_K_M builds fit with room (18.9 and 20.3 GiB).
Other builds of this 27B: what changes, what doesn't
| Variant | What it is | Q4-class build | Adoption (downloads) | Repo |
|---|---|---|---|---|
| cdiamond · iMatrix NVFP4 downloads/likes ratio far above the others (2.98M pulls against 45 likes) — treat the count as an upper bound, not as human adoption | NVFP4 quantization with imatrix calibration (single ~16 GiB file, plus a 0.93 GB vision projector) | 15.95 GiB | 2.73M | huggingface |
| Huihui · abliterated | Uncensored (abliterated) fine-tune, unsloth UD quants | 15.41 GiB | 2.64M | huggingface |
| JonathanColetti · Uncensored draft file is separate (1.68 GB) and adds VRAM | Uncensored fine-tune; ships an optional draft model for speculative decoding | 14.26 GiB | 2.44M | huggingface |
| HauhauCS · Aggressive | Uncensored fine-tune with MTP | 14.63 GiB | 2.34M | huggingface |
| DavidAU · NEO-CODER MAX | Merged coder build (author-listed multi-model fusion) with MTP | 15.86 GiB | 1.69M | huggingface |
| nerkyor · Coder390 MTP head 0.85 GB or DFlash2 draft 2.41 GB, mutually exclusive | SFT + RLOO post-train aimed at runaway thinking, with MTP and a DFlash2 draft option | 18.27 GiB | 0.70M | huggingface |
What does move VRAM: a separate MTP head or draft model is extra memory on top of the file size — but a file whose name already carries MTP (several rows here) has those weights inside it, so do not add the draft again; a vision projector is separate and only needed for images.
Self-host or API?
Estimate owned-GPU vs API breakeven
This is a token-cost sensitivity exercise, not a purchase recommendation. The model still has to meet your quality and throughput needs.
Worked example: a $1,200 GPU kept 30 months plus 350W for 4 hours/day at $0.15/kWh costs about $46 per month. At a blended API price of $0.49/1M, breakeven is about 94M tokens/month. Replace every input with your own numbers.
| Input | Value |
|---|---|
Monthly cost $46 · Breakeven tokens/month 94M
The static defaults and the script use the same formula. Nothing leaves this page.
Formula and evidence
| Monthly hardware cost | GPU price ÷ months you keep it |
| Monthly electricity | average watts × hours/day × 30 ÷ 1000 × your kWh price |
| Breakeven usage | (hardware + electricity) ÷ blended API price per 1M tokens |
OpenRouter lists qwen/qwen3.8-27b at $0.04 input / $2.30 output per 1M tokens in the 2026-10-31 snapshot; the 4:1 blend is $0.49. The $1,200 GPU input is an editable example, not a market quote. Check the live provider page before committing budget. OpenRouter
Where every number comes from (every figure carries its tag)
Totals: measured weights + reported KV (per-token constant config-derived from the official config.json) + reported overhead (borrowed, not measured on this model) — labeled, additive.
| Tag | Slot | What it is | What the verdict can claim |
|---|---|---|---|
| reported | model | Hugging Face config.json (layer_types, vision_config, kv heads/dims — hypothesis-parameter carrier) | Tight, conditional — stands on the linked source, re-checkable by you. |
| reported | runtime_parameters | llama.cpp server README — --n-cpu-ffn for dense FFN tensors; --n-cpu-moe for MoE expert tensors | Tight, conditional — stands on the linked source, re-checkable by you. |
| reported | static | Hugging Face model page | Tight, conditional — stands on the linked source, re-checkable by you. |
| reported | static | Ollama FAQ — documents a 4096-token default and the num_ctx controls used on this page | Tight, conditional — stands on the linked source, re-checkable by you. |
| reported | static | Ollama current context-length guide — selects 4K below 24 GiB VRAM, 32K at 24–48 GiB, and 256K at 48 GiB or more | Tight, conditional — stands on the linked source, re-checkable by you. |
| reported | static | llama.cpp current CLI context flag — -c / --ctx-size defaults to 0, meaning loaded from model metadata; set -c 4096 or -c 32768 to reproduce the two comparison configurations on this page | Tight, conditional — stands on the linked source, re-checkable by you. |
| reported | kv | KV cache @32K — 65,536 bytes/token config-derived from the official config.json (2 × 4 KV heads × 256 head_dim × 2 bytes × 16 full-attention layers), consistent with the SGLang cookbook: 2.0 GiB across the 16 full-attention layers + GDN linear-attention constant state 78.4 MB published by SGLang (= 2.14329 GiB); growth is linear in context on the full-attention layers | Tight, conditional — stands on the linked source, re-checkable by you. |
| provisional | overhead | Deployment overhead — borrowed allowance from a Gemma 2 9B / 4K / FA-off log (507 MiB; provisional, not measured on this model) | Very likely right, order of magnitude only — replaced the moment measured values land. |
FAQ
Does Qwen3.8-27B fit in 24GB VRAM?
Yes. The bartowski Q4_K_M build totals 18.9 GiB at 32K context against 22.5 GiB usable on an RTX 3090 24GB or 4090 24GB — 3.6 GiB to spare. The standard bartowski Q5_K_M (22.1 GiB) is the last build that still fits, tight. Official FP8 (31.4 GiB) does not: it needs a 48GB-class card at 32K.
How much VRAM does Qwen3.8-27B need at Q4_K_M?
18.9 GiB at 32K context: 16.2 GiB weights + 0.5 GiB runtime overhead + 2.1 GiB KV cache. The KV figure is config-derived from the official config.json (65,536 bytes/token across the 16 full-attention layers, consistent with the SGLang calculator), plus the linear-attention constant state. At 4K context the linear part of the KV term shrinks eightfold (the constant state does not scale), landing at ≈0.39 GiB, so the same build runs in ≈17.1 GiB. The short form (ollama run qwen3.8:27b) pulls the ollama Q4_K_M build.
What is the smallest GPU that runs Qwen3.8-27B?
At 32K context an RTX 3060 12GB tops out at UD_IQ2_S (fits, tight); at 8K context the smallest build (UD_IQ1_S) drops to 6.9 GiB and fits with headroom. A 16GB card reaches IQ3_XS. Q4_K_M, the standard 4-bit build, needs a 24GB card.
Can an RTX 4090 run Qwen3.8-27B above Q4?
Q5_K_M is the last standard build that fits at 32K (22.1 GiB, 0.4 GiB to spare, tight); from Q6_K up it does not — Q6_K totals 24.8 GiB, 2.3 GiB over the 22.5 GiB usable — at 8K context it still misses, 23.3 GiB against 22.5 GiB usable. The 24GB ceiling at 32K is the Q5_K_M build at 22.1 GiB (0.4 GiB to spare, tight). An RTX 5090 32GB reaches Q8_0 at 29.2 GiB (tight); official FP8 (31.4 GiB at 32K) needs a 48GB-class card.
Three Q4_K_M builds exist — which one do I get?
The quant label does not decide the size; the build does. This page prices bartowski's Q4_K_M (16.2 GiB, pinned at the revision in the sources table); unsloth's dynamic Q4_K_M measures 15.3 GiB of weights and ggml-org's 17.7 GiB — 2.3 GiB of spread at the same quant name, different tensor coverage. The ollama short form serves its own Q4_K_M build; whichever file you pull, read its bytes, not its label.
Why is the KV cache only 2.1 GiB and not the classic full-attention estimate?
Because 48 of the 64 layers are linear attention (GDN) and hold a constant recurrent state instead of growing KV. The 2.1 GiB @32K is the bound for the 16 full-attention layers only (65,536 bytes/token config-derived from the official config.json, consistent with the SGLang calculator, linked) × 32K tokens, plus a small constant state for the linear layers. A classic all-layers bound would overstate what the 16 layers actually hold.
How does this site compute these VRAM numbers?
Weights are measured file sizes at pinned revisions (sources below); totals add runtime overhead plus the KV cache at 32K context. Here KV@32K = 2.14329 GiB: 65,536 B/token across the 16 full-attention layers, plus the GDN linear layers' 0.143 GiB constant state (SGLang's published float32 constant). A build fits a card at 32K when the total clears usable VRAM (nominal minus reserve), and tight means under 2.5 GiB of headroom — the full formula lives in the method box under the quantization table.
Which state dtype does your KV math assume?
The checkpoint's default. Qwen3.8-27B's config declares mamba_ssm_dtype=float32, and the published SGLang calculator prices the flat GDN state slot at 153.9 MB in that precision (2.00 GiB of growing full-attention KV + 0.143 GiB of state = 2.14 GiB at 32K). Passing --mamba-ssm-dtype bfloat16 halves that slot to 78.4 MB, which brings KV@32K to 2.07 GiB and every total down by about 0.07 GiB. The row that cares: IQ3_XS on a 16GB card is 14.56 GiB with the float32 default (misses 14.5 GiB usable by 0.06) and 14.49 GiB in bf16 (fits with 0.01 to spare — tight, and only if your runtime really runs bf16 state).