Qwen3.8-27B spills past 16 GB GPUs. Here is what actually fits
Compare 4-bit and 8-bit Qwen3.8-27B GGUF on 16-32 GB GPUs and Macs, set up mmproj vision and reasoning_effort in llama.cpp and Ollama, and pick between DaisyRose-27B and the pi LoRA.
9 minutes read Czytaj po polsku

On this page (8)
- Key takeaways
- Qwen3.8-27B architecture and why hybrid attention matters for local VRAM
- 4-bit vs 8-bit GGUF on 16 GB, 24 GB, and 32 GB GPUs and Macs
- Loading the mmproj vision projector in llama.cpp and Ollama
- Tuning reasoning_effort and preserve_thinking per request
- DaisyRose-27B: a drop-in pure-RL upgrade for long-horizon coding and vision
- Qwen3.8-27B-pi-adapted: LoRA speedups for the pi coding agent
- FAQ
Key takeaways
- Qwen3.8-27B uses 48 Gated DeltaNet and 16 Gated Attention layers, keeping FP16 KV cache at 64 KiB per token.
- Four-bit GGUF fits 24 GB GPUs comfortably, spills past 16 GB cards, and Q8_0 needs 32 GB VRAM.
- Omit the mmproj file to save VRAM, and tune reasoning_effort per request to cut thinking latency.
- Use DaisyRose-27B for stronger coding with vision, or Qwen3.8-27B-pi-adapted for fast thinking-off pi agent loops.
At 27B dense parameters, Qwen3.8-27B sits right on the boundary between consumer 16 GB cards, 24 GB workstation GPUs and Macs, and 32 GB flagships. Deciding between a 4-bit quant (Q4_K_M or UD-Q4_K_M) and an 8-bit quant (Q8_0) comes down to how much room you need for its hybrid KV cache, its optional mmproj vision projector, and per-request thinking tokens. Once the base model runs smoothly, you can also swap in two Apache-2.0 RL variants - DaisyRose-27B for long-horizon coding with vision, or Qwen3.8-27B-pi-adapted for fast pi terminal loops.
Qwen3.8-27B architecture and why hybrid attention matters for local VRAM
Qwen/Qwen3.8-27B is an Apache-2.0 licensed, dense 27B-parameter causal language model with a native vision encoder (image-text-to-text). Out of the box it handles text alongside image and video inputs - including STEM diagrams, documents, and hour-scale videos - across a 262,144-token native context window extensible up to 1,000,000 tokens (the upcoming hosted Qwen Cloud release lists 1M by default). On the vendor's text evaluations against Qwen3.6-27B, coding and agentic scores climb sharply: Terminal Bench 2.1 (Terminus) rises from 63.4 to 73.0, SWE-bench Pro moves from 53.5 to 61.7, NL2Repo-Bench increases from 36.2 to 42.3, and DeepSWE 1.1 jumps from 13.3 to 42.2 (with QwenSWEBench rising from 49.3 to 79.0).
For local hardware, the key detail is its 64-layer hybrid layout. Rather than running standard attention in every block, Qwen3.8-27B repeats a 4-layer pattern 16 times: 16 x (3 x (Gated DeltaNet -> FFN) -> 1 x (Gated Attention -> FFN)), with a hidden dimension of 5,120, an FFN intermediate dimension of 17,408, a padded vocabulary of 248,320, and Multi-Token Prediction (MTP) trained with multiple steps. That yields 48 Gated DeltaNet linear-attention layers (48 V heads, 16 QK heads, head dimension 128) and only 16 full Gated Attention layers (24 Q heads, 4 KV heads, head dimension 256, RoPE dimension 64).
Because the 48 Gated DeltaNet layers maintain a fixed-size recurrent state that does not grow per token, only those 16 Gated Attention layers contribute to the growing KV cache. In FP16, the exact KV-cache cost per token is:
16 layers x 2 (K and V) x 4 KV heads x 256 head_dim x 2 bytes = 65,536 bytes/token (64 KiB/token)That puts FP16 KV-cache growth at 0.50 GiB at 8K (8,192 tokens), 2.00 GiB at 32K (32,768 tokens), 4.00 GiB at 64K (65,536 tokens), 8.00 GiB at 128K (131,072 tokens), and 16.00 GiB at 256K (262,144 tokens). If you want a refresher on how base weight quantization interacts with KV cache and compute buffers, see How much VRAM do you need? GGUF quantization in practice.
Qwen3.8-27B FP16 Attention KV Cache by Context
Exact FP16 KV memory for the 16 Gated Attention layers (64 KiB/token); excludes weights, mmproj, and fixed DeltaNet state.
Show data
| Attention KV cache (FP16) | |
|---|---|
| 8K | 0.5 GiB |
| 32K | 2 GiB |
| 64K | 4 GiB |
| 128K | 8 GiB |
| 256K | 16 GiB |
4-bit vs 8-bit GGUF on 16 GB, 24 GB, and 32 GB GPUs and Macs
In GGUF format, 4-bit builds (Q4_K_M or dynamic UD-Q4_K_M) typically weigh roughly 16 to 19 GB on disk, while 8-bit (Q8_0) sits around 26 to 28 GB. That ~10 GB gap draws hard lines across common local machines once you add runtime compute buffers, KV cache, and an optional vision projector.
| Hardware tier | Practical GGUF choice | Realistic FP16 context budget | Expected residency |
|---|---|---|---|
| 16 GB discrete GPU | 4-bit (Q4_K_M / UD-Q4_K_M) | 4K to 16K | Partial GPU offload (-ngl) to system RAM |
| 24 GB discrete GPU | 4-bit (Q4_K_M / UD-Q4_K_M) | 32K to 64K | Full VRAM fit with vision headroom |
| 24 GB unified-memory Mac | 4-bit (Q4_K_M / UD-Q4_K_M) | 8K to 32K | Tight fit inside macOS memory budget |
| 32 GB discrete GPU | Q8_0 or 4-bit | 8K-32K (Q8_0) / 128K+ (4-bit) | Full VRAM fit for both quants |
On a 16 GB card such as an RTX 5060 Ti 16 GB, a 4-bit GGUF at roughly 16 to 19 GB already meets or exceeds total VRAM before you allocate a single token of KV cache or compute workspace. Full residency is out of reach unless you step down to smaller 3-bit or IQ quants, so expect to run Q4_K_M with partial layer offload (-ngl) into system RAM and keep your context window modest (around 4K to 16K) to limit PCIe transfers.
Stepping up to 24 GB creates a clear split between discrete GPUs and unified-memory Macs. On a 24 GB RTX 3090, a 16 to 19 GB 4-bit GGUF leaves roughly 5 to 8 GB of dedicated VRAM, which comfortably covers 32K (2.00 GiB) or 64K (4.00 GiB) of FP16 KV cache plus the vision projector. On a 24 GB Apple Mac mini M5 Pro, unified memory is shared with macOS wired and system allocations, leaving a smaller usable pool for Metal buffers; 4-bit still fits at modest 8K to 32K contexts if you keep background apps quiet, whereas Q8_0 at 26 to 28 GB spills out of memory on both 24 GB GPUs and 24 GB Macs.
With 32 GB of VRAM on an RTX 5090, you get a genuine precision-versus-context choice. Q8_0 (26 to 28 GB) fits fully in VRAM with enough room left for moderate context (roughly 8K to 32K at 0.50 to 2.00 GiB of FP16 KV cache) when you want near-lossless weights for complex code edits. Dropping to 4-bit (16 to 19 GB) leaves roughly 13 to 16 GB of VRAM headroom, unlocking 128K+ context (8.00 GiB KV cache) alongside the vision projector without touching system RAM. If 27B still feels tight on your card, Inkling-2-Mini GGUF: picking quants for 16-32 GB GPUs and Macs covers smaller alternatives in the same VRAM brackets.
Loading the mmproj vision projector in llama.cpp and Ollama
Multimodal GGUF releases split the vision encoder out of the language weights into a separate mmproj projector file. That separation is useful locally: if you only run text prompts, omitting mmproj keeps the server text-only and avoids loading the vision projector and image compute buffers into VRAM. Loading mmproj enables image and video understanding (such as diagrams and screenshots) at the cost of that extra VRAM overhead.
In llama.cpp, llama-server loads the vision projector via --mmproj alongside your main GGUF, -c context size, and -ngl layer offload count. On a 24 GB or 32 GB GPU running 4-bit weights, pass -ngl 99 to keep every layer on the GPU; on a 16 GB card, drop -ngl (for example -ngl 40, tuning downward until allocations succeed) and skip --mmproj when you do not need vision:
llama-server \
-m ./Qwen3.8-27B-UD-Q4_K_M.gguf \
--mmproj ./mmproj-Qwen3.8-27B-F16.gguf \
-c 32768 -ngl 99 --jinja --port 8080
llama-server \
-m ./Qwen3.8-27B-Q4_K_M.gguf \
-c 8192 -ngl 40 --jinja --port 8080In Ollama, multimodal builds bundle the vision projector in the model manifest alongside the base weights. After pulling or creating your model with ollama create, run ollama ps right after a prompt (or in another terminal while a session is active) to confirm the context length and verify whether the model sits 100% on GPU or has spilled onto CPU:
ollama run qwen3.8:27b "Summarize this error log."
ollama psFor a deeper breakdown of when to pick llama.cpp, Ollama, or vLLM, check llama.cpp vs vLLM vs Ollama: which inference server should you pick?, and see Your first local LLM in 15 minutes with Ollama and Open WebUI in Docker if you want a browser chat interface wired up over Ollama.
Tuning reasoning_effort and preserve_thinking per request
According to the model card, Qwen3.8-27B turns thinking mode on by default, lets you disable thinking per request, scales reasoning depth via reasoning_effort, and can keep prior reasoning traces across multi-turn chats via preserve_thinking. Leaving high thinking enabled on every prompt burns time and context tokens on trivial requests, so controlling these flags per call makes a noticeable difference on local GPUs.
In llama.cpp, start llama-server with --jinja so it honors the model's native chat template, then pass reasoning_effort or chat_template_kwargs (enable_thinking and preserve_thinking) on /v1/chat/completions:
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-27b",
"messages": [{"role": "user", "content": "Rename foo to bar in this function."}],
"chat_template_kwargs": {"enable_thinking": false}
}'
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-27b",
"messages": [{"role": "user", "content": "Trace why this race condition happens across worker restarts."}],
"reasoning_effort": "high",
"chat_template_kwargs": {"enable_thinking": true, "preserve_thinking": true}
}'In Ollama, you can toggle thinking directly in /api/chat with "think": false (or pass "reasoning_effort" on the OpenAI-compatible /v1/chat/completions endpoint):
curl http://localhost:11434/api/chat \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8:27b",
"messages": [{"role": "user", "content": "Write a systemd unit for llama-server."}],
"think": false,
"stream": false
}'DaisyRose-27B: a drop-in pure-RL upgrade for long-horizon coding and vision
If you use Qwen3.8-27B primarily for coding agents and complex tool use, RadixArk/DaisyRose-27B (Apache-2.0) is a drop-in pure reinforcement-learning finetune trained without SFT or distillation. RadixArk trained it on roughly 1,200 curated long-horizon agent tasks with sessions up to 1M tokens for 18 days on 144 H200 GPUs. Because it keeps the exact base architecture, tokenizer, chat template, native image understanding, and 256K-token context, your existing prompts, mmproj setup, and hardware VRAM math stay identical.
RadixArk reports consistent gains over base Qwen3.8-27B across agentic coding, instruction following, and reasoning benchmarks:
| Benchmark | Qwen3.8-27B | DaisyRose-27B | Evaluation setup |
|---|---|---|---|
| Terminal Bench 4.1 | 5.6 | 12.0 | 8 reps, mini-swe-agent |
| Terminal Bench 2.1 | 73.0 | 75.5 | 5 reps, Terminus 2 |
| DeepSWE v1.1 | 42.2 | 46.2 | 8 reps, mini-swe-agent |
| SWE Bench Pro v2 | 91.3 | 94.7 | 5 reps, mini-swe-agent (642 tasks) |
| IFBench | 79.5 | 82.4 | 4 reps, 300 prompts, loose accuracy |
| GPQA Diamond | 89.2 | 90.7 | 8 reps, 198 questions |
For local inference, RadixArk/DaisyRose-27B-GGUF drops straight into llama.cpp or Ollama with the same 4-bit and 8-bit VRAM footprints. If you run vLLM or SGLang on higher-memory GPUs, RadixArk also publishes BF16 (RadixArk/DaisyRose-27B), FP8 (RadixArk/DaisyRose-27B-FP8), and NVFP4 (RadixArk/DaisyRose-27B-NVFP4) checkpoints, plus a matching speculative draft model (RadixArk/Qwen3.8-27B-DSpark) for speculative decoding when you have spare VRAM.
Qwen3.8-27B-pi-adapted: LoRA speedups for the pi coding agent
For terminal coding loops driven by the pi coding agent (github.com/earendil-works/pi), harness-hub/Qwen3.8-27B-pi-adapted (Apache-2.0) takes a narrower approach: it is a PEFT LoRA adapter trained with GRPO / async-GRPO specifically for the pi harness. You can load it as a LoRA adapter in transformers or vLLM, merge it into base weights, or pull pre-built GGUFs from harness-hub/Qwen3.8-27B-pi-adapted-GGUF for llama.cpp, macOS Llama.app, and vLLM.
In author-reported pi-harness evaluations (single attempt per task, 100-step budget, text-only with the vision tower not served, temperature 0.8, top-p 1.0), the biggest shift shows up with thinking turned off:
- SWE-bench Pro (hard 51): thinking-off pass@1 rises from 39.2% to 64.7% (+25.5 points; 15 newly solved, 2 lost), while enabling
xhighthinking brings both base and adapter to 74.5%. - Terminal-Bench 2.1: thinking-off pass@1 jumps from 39.5% to 55.8% (+16.3 points; 16 newly solved, 2 lost; the card summary also notes 56.6% vs 54.2% for base
xhigh). - Token and turn efficiency: on tasks both solve, the thinking-off adapter generates roughly 4.5x fewer tokens per task and takes under half as many turns as base
xhighthinking.
On local hardware where xhigh thinking traces quickly stall throughput or eat into a 16-24 GB context budget, getting near-xhigh results with thinking disabled is a practical win.
SWE-bench Pro (hard 51) under the pi harness
Pass@1 (%) with 100-step budget, text-only. The pi-adapted LoRA with thinking off generates ~4.5x fewer tokens than xhigh thinking.
Source: harness-hub/Qwen3.8-27B-pi-adapted
Show data
| Base (no think) | 39.2 % |
| pi-adapted (no think) | 64.7 % |
| Base (xhigh think) | 74.5 % |
| pi-adapted (xhigh) | 74.5 % |
FAQ
Can a 16 GB GPU run Qwen3.8-27B Q4_K_M without offloading to system RAM?
Not comfortably with usable context. The 4-bit weights alone take roughly 16 to 19 GB, so adding KV cache, compute buffers, or the mmproj vision projector pushes past 16 GB VRAM and requires partial layer offload via -ngl.
Do you need to load the mmproj file if you only send text prompts?
No. Skipping the --mmproj flag in llama.cpp or using a text-only configuration avoids loading the vision encoder into memory, which leaves more VRAM for context length on 16 GB and 24 GB systems.
When should you pick DaisyRose-27B over Qwen3.8-27B-pi-adapted?
Pick DaisyRose-27B when you want higher agentic coding accuracy while keeping native image understanding and 256K context intact. Pick Qwen3.8-27B-pi-adapted when running text-only pi coding loops with thinking turned off, where it improves pass@1 while generating roughly 4.5x fewer tokens than base xhigh thinking.


