LLM VRAM
Alibaba · 27B hybrid-linear (48 linear-attention + 16 full-attention) · vision projector shipped separately · Apache-2.0 · 256K context

Qwen3.8-27B VRAM requirements

18.9 GiB provisional
at Q4_K_M · bartowski build · 32K context · RTX 4090 24GB
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

TL;DR
Run it: 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.
Baseline: 32K context, 22.5 GiB usable on a 24GB card — the one config this page promises. The quant table's main column prices the full 32K load (weights + overhead + the KV term at 32K); at 4K context the context-scaling full-attention part of the KV term shrinks eightfold (the linear-attention state does not scale), ≈0.39 GiB, so Q4_K_M at 4K ≈ 17.1 GiB. KV@32K = 2.14 GiB assumes the checkpoint's declared float32 state (config mamba_ssm_dtype); running --mamba-ssm-dtype bfloat16 halves that state slot and brings the same total to 2.07 GiB. The short form 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

Chart: one column per VRAM platform from 12GB up to 48GB-class (usable VRAM, GiB), zoned green = comfortable, amber = tight under 2.5 GiB of headroom, red = no fit; an accent staircase traces each card's 32K ceiling quant, with the 24GB × Q4_K_M sweet spot marked by a highlight bar at 3.6 GiB of headroom
One column per GPU, colored by verdict zone; the accent staircase is the only line that matters: each card's 32K ceiling quant (16GB clears it comfortably at 2.8 GiB spare and the dual-24GB column sits 13.1 GiB clear; everything else is tight — the 12GB column only with the unsloth UD_IQ2_S build, 10.4 GiB against 10.5 usable, 0.1 spare, while the bartowski IQ2_S build is a different, larger file and reaches about 14K). The highlighted level, 24GB × Q4_K_M with 3.6 GiB of headroom, is the 24GB sweet spot. The 48GB-class column drawn here is the 2× 3090 pair (45.0 GiB usable); the other way into that class is a single workstation card (RTX 6000 Ada, 46.5 GiB), which is not a column on this chart. Two cards are not one card doubled: topology, power and tensor-parallel overhead apply. Beyond that: 64GB 2× 5090, 80GB H100, 96GB PRO 6000. A tier guide, not a void.

How much VRAM at each quantization? (listed file size + runtime allowance + 32K KV)

Main column totals are the full 32K load: each row's weights + runtime overhead + the reported KV term at 32K. The KV column repeats that 32K term so you can see what it costs — it is already inside the left column, so do not add it again. Weights are actual file sizes at pinned revisions. KV@32K uses the checkpoint's declared float32 state (config mamba_ssm_dtype); with --mamba-ssm-dtype bfloat16 the state slot halves and every total drops by about 0.07 GiB.
QuantizationVRAM needed @32KKV @32K reported i · already in the left columnSmallest tracked fit (context noted)Note
UD_IQ1_S8.4 GiB2.14329 GiBRTX 3060 12GBlisted file size 5.8 GiB · estimated total includes 32K KV
UD_IQ2_S10.4 GiB2.14329 GiBRTX 3060 12GBlisted file size 7.8 GiB · estimated total includes 32K KV
IQ2_S11.7 GiB2.14329 GiBRTX 3060 12GB · ≤~13K ctxlisted file size 9.0 GiB · estimated total includes 32K KV
IQ3_XS14.6 GiB2.14329 GiBRTX 4060 Ti 16GB · ≤~31K ctxlisted file size 11.9 GiB · estimated total includes 32K KV
Q4_K_M18.9 GiB2.14329 GiBRTX 3090 24GBlisted file size 16.2 GiB · estimated total includes 32K KV
UD_Q5_K_XL22.1 GiB2.14329 GiBRTX 3090 24GBlisted file size 19.4 GiB · estimated total includes 32K KV
Q5_K_M22.1 GiB2.14329 GiBRTX 3090 24GBlisted file size 19.5 GiB · estimated total includes 32K KV
Q6_K24.9 GiB2.14329 GiBRTX 5090 32GBlisted file size 22.2 GiB · estimated total includes 32K KV
Q8_029.3 GiB2.14329 GiBRTX 5090 32GBlisted file size 26.6 GiB · estimated total includes 32K KV
FP831.4 GiB2.14329 GiBRTX 5090 32GB · ≤~10K ctxlisted file size 28.7 GiB · estimated total includes 32K KV
UD_Q8_K_XL31.9 GiB2.14329 GiB2× RTX 3090 24GB (48GB aggregate)listed file size 29.3 GiB · estimated total includes 32K KV
BF1654.4 GiB2.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)

Ceilings at 32K context (the stricter case), using usable VRAM (nominal minus 1.5 GiB on 24GB-class, minus 2.0 GiB at 32GB). Rows are ceilings — the biggest build that fits, not the page's pick. The recommended build lives in the hero, the buy section, and the chart's highlighted band. UD_* = unsloth dynamic quants: same quant name, different file per publisher — a ceiling row may cite a UD build smaller than its same-name row in the quant table.
Your GPUVRAMBiggest quant that fits (ceiling)How it feels
RTX 3060 12GB12 GBUD_IQ2_S (2-bit) · 10.4 GiB0.06 GiB spare at 32K (KV counted)
RTX 4060 Ti 16GB16 GBIQ2_S (2-bit) · 11.7 GiB2.8 GiB spare at 32K (KV counted)
RTX 3090 24GB24 GBQ5_K_M (5-bit) · 22.1 GiB0.4 GiB spare at 32K (KV counted)
RTX 4090 24GB24 GBQ5_K_M (5-bit) · 22.1 GiB0.4 GiB spare at 32K (KV counted)
RTX 5090 32GB32 GBQ8_0 (8-bit) · 29.3 GiB0.7 GiB spare at 32K (KV counted)
2× RTX 3090 24GB (48GB aggregate)48 GBUD_Q8_K_XL (8-bit) · 31.9 GiB13.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 sweet spot
24 GB
Buys you
Q4_K_M with room to spare — even Q5_K_M fits, tight
Representative hardware
RTX 3090 (used) / RTX 4090
The logic24GB 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 fitsHybrid-linear attention keeps KV cache at 2.14 GiB even at 32K context; a full-attention 28B would not come close to 24GB
Sourcebartowski 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)

One row per build we track. verified = we read the file listing; reported = community numbers, linked, not re-measured by us.
BuildPublisherFile size24GB @32KSource
UD_IQ1_Sunsloth5.8 GiBOK · 8.4HF @4ca72078 verified
UD_IQ2_Sunsloth7.8 GiBOK · 10.4HF @4ca72078 verified
IQ2_Sbartowski9.0 GiBOK · 11.7HF @0c92138c verified
IQ3_XSbartowski11.9 GiBOK · 14.6HF @0c92138c verified
Q4_K_Mbartowski16.2 GiBOK · 18.9HF @0c92138c verified
UD_Q5_K_XLunsloth19.4 GiBTIGHT · 22.1HF @4ca72078 verified
Q5_K_Mbartowski19.5 GiBTIGHT · 22.1HF @0c92138c verified
Q6_Kbartowski22.2 GiBNO · 24.9HF @0c92138c verified
Q8_0ggml-org26.6 GiBNO · 29.3HF @efbb3b1f verified
FP8Qwen28.7 GiBNO · 31.4HF @017b9c7a verified
UD_Q8_K_XLunsloth29.3 GiBNO · 31.9HF @4ca72078 verified
BF16Qwen51.7 GiBNO · 54.4HF @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

Every build here is the same architecture as the base model above, so the VRAM answer follows the file size — a build runs when the base runs at that size; the name does not change the physics. Rows are ordered by downloads as an adoption signal, not a recommendation; each size is the Q4-class file this page quotes for that repo (not necessarily the repo's smallest — several ship lower-bit or no-MTP files that are smaller), HF counts as of 2026-10-27, and mirror/CI pulls are included.
VariantWhat it isQ4-class buildAdoption (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 GiB2.73Mhuggingface
Huihui · abliteratedUncensored (abliterated) fine-tune, unsloth UD quants15.41 GiB2.64Mhuggingface
JonathanColetti · Uncensored
draft file is separate (1.68 GB) and adds VRAM
Uncensored fine-tune; ships an optional draft model for speculative decoding14.26 GiB2.44Mhuggingface
HauhauCS · AggressiveUncensored fine-tune with MTP14.63 GiB2.34Mhuggingface
DavidAU · NEO-CODER MAXMerged coder build (author-listed multi-model fusion) with MTP15.86 GiB1.69Mhuggingface
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 option18.27 GiB0.70Mhuggingface

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?

Compare an illustrative owned-GPU scenario with an API below. OpenRouter is the live price check; dated snapshots and editable examples are not standing rates.

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.

InputValue

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 costGPU price ÷ months you keep it
Monthly electricityaverage 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)

Weights: pinned file sizes at pinned revisions.
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.
Caliber: all figures in GiB (230 bytes) — VRAM is binary-native, so a "24GB" card holds 24 GiB, and a file quoted 17.4 GB in decimal is the same 16.2 GiB. Verify before buying hardware. How we compute these numbers →
What each number slot is made of. These tags are the legend for every badge on this page: they say what kind of evidence a number is, and what a verdict built on it can claim. Tag layers: measured = pinned file bytes (verified); projected totals = config-derived estimates; engine/door claims = publisher-reported; runtime-measured applies only where a row says so — no page here claims a runtime benchmark.
TagSlotWhat it isWhat the verdict can claim
reportedmodelHugging Face config.json (layer_types, vision_config, kv heads/dims — hypothesis-parameter carrier)Tight, conditional — stands on the linked source, re-checkable by you.
reportedruntime_parametersllama.cpp server README — --n-cpu-ffn for dense FFN tensors; --n-cpu-moe for MoE expert tensorsTight, conditional — stands on the linked source, re-checkable by you.
reportedstaticHugging Face model pageTight, conditional — stands on the linked source, re-checkable by you.
reportedstaticOllama FAQ — documents a 4096-token default and the num_ctx controls used on this pageTight, conditional — stands on the linked source, re-checkable by you.
reportedstaticOllama current context-length guide — selects 4K below 24 GiB VRAM, 32K at 24–48 GiB, and 256K at 48 GiB or moreTight, conditional — stands on the linked source, re-checkable by you.
reportedstaticllama.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 pageTight, conditional — stands on the linked source, re-checkable by you.
reportedkvKV 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 layersTight, conditional — stands on the linked source, re-checkable by you.
provisionaloverheadDeployment 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).