DEV Community

Cover image for How to Run Qwen 3.8 27B Locally: The Complete 2026 Setup Guide for Ollama, llama.cpp, and vLLM
Shaam
Shaam

Posted on Originally published at aitecharchive.com

How to Run Qwen 3.8 27B Locally: The Complete 2026 Setup Guide for Ollama, llama.cpp, and vLLM

Qwen3.8-27B, released on August 14 2026 by Alibaba's Qwen team, is a dense 27 billion-parameter multimodal model you can download and run on a single consumer GPU — no API keys, no per-token costs, no internet at inference time. At Q4_K_M quantization it needs approximately 18 GB of VRAM and scores 61.7% on SWE-bench Pro, a coding-agent benchmark where it narrowly beats the proprietary Claude Opus 4.6 Max's 53.4% — all on a free Apache 2.0 licence.

But the set up determines whether you get a usable coding agent or a frustrating slideshow. The model is not a single download you open in a chat box; you need the right harness (Ollama, llama.cpp, or vLLM depending on your goal), the right quantization for your card's memory, reasoning controls configured before you hit "generate," and — for speed — speculative decoding (MTP) switched on. Below is the complete proven path from zero to running tokens in 2026.

TL;DR — the 30-second verdict

Last verified: 2026-08-16 · Pricing/limits/versions flagged volatile — re-check before committing.

  • What it is: Qwen3.8-27B is a dense 27B vision-language model, Apache 2.0 licensed, with a native 262K-token context window (extendable to 1M via YaRN), trained for agentic coding, professional work, and long-horizon tasks. (Hugging Face model card)
  • Who can run it locally: Anyone with a 24 GB GPU (RTX 4090, RTX 3090, AMD Radeon AI PRO R9700) or a Mac with 24+ GB unified memory. The 18 GB Ollama package fits those cards at Q4_K_M. (Unsloth)
  • Fastest path: ollama run qwen3.8 — updated on day one. One command pulls the model and starts a local OpenAI-compatible endpoint. (Ollama)
  • Setup for power users: llama.cpp with a Unsloth GGUF quant, MTP speculative decoding, and a hand-tuned context budget gives you 80-160 tok/s on an RTX 4090 or NVIDIA DGX Spark. (explainx.ai)
  • What "free" buys you: No per-token API bills, full prompt privacy (nothing leaves your machine), and offline use on a plane. There is no persistent "running cost" once the weights are loaded.

Pricing/limits/versions change often — last checked 2026-08-16.

What is Qwen3.8-27B and how is it different from Qwen3.8-Max?

Qwen3.8-27B is the smaller, locally-runnable half of Alibaba's August 2026 Qwen 3.8 release. The other half is Qwen3.8-Max, a 2.4 trillion-parameter model with 95 billion active parameters (MoE) that needs a rack of GB300 NVL72 accelerators to serve at scale (Hugging Face). Until August 14 2026 the Max weights shipped alone; the promised local companion was missing. Qwen3.8-27B closed that gap.

The 27B version is dense — every parameter is active per token, so there is no MoE routing overhead to manage. It carries a vision encoder (image and video understanding), a 262,144-token native context window, and "thinking" mode enabled by default. Reasoning depth is controllable via a reasoning_effort field you can pass per request (SWE-bench Pro uses Claude Code harness, temp=1.0, top_p=0.95, 256K context). The full benchmark comparison:

Benchmark Qwen3.8-27B Qwen3.6-27B (predecessor) Claude Opus 4.6 Max
Terminal-Bench 2.1 (terminal coding) 73.0 63.4 78.2
SWE-bench Pro (agentic coding) 61.7 53.5 53.4
DeepSWE 1.1 (agentic coding) 42.2 13.3
QwenSWEBench (software engineering) 79.0 49.3 63.8
CoWorkBench (long-horizon office work) 70.7 61.0 68.2
LiveCodeBench v6 (competitive coding) 90.3 83.9 88.8
GPQA Diamond (graduate science) 89.2 87.8 91.3
HLE (multipart reasoning) 30.8 24.0 40.0

Source: Qwen3.8-27B model card on Hugging Face. Bold marks the best in row. Qwen's own evaluation team produced these numbers — treat them as vendor-reported until independent runs land.

The honest read: Qwen3.8-27B does not "beat Claude Opus." It beats the cited Opus 4.6 Max figure on two of the eight text benchmarks above and trails it on the other six — by a wide margin on the hardest one (HLE). What is real is that a 27B dense model you can run on one GPU now sits anywhere near the frontier at all. Six months ago that was not possible.

What hardware do you need to run Qwen3.8-27B locally?

A 24 GB GPU is the practical minimum for Q4_K_M. The Ollama package is 18 GB on disk; total working set (weights + KV-cache + runtime buffers) sits at 19-20 GB at Q4_K_M depending on context length, per Unsloth's published quantization table:

Machine class Min VRAM at Q4_K_M Fits? Realistic throughput
16 GB GPU (RTX 4060 Ti / 4070 Ti / 4080) 19 GB No Does not fit
24 GB GPU (RTX 4090 / RTX 3090 / R9700) 19 GB Yes 55-80 tok/s
32 GB GPU (RTX 5090) 19 GB Yes (Q6 / longer context) 80-120 tok/s
Mac M4 Pro (24 GB unified) 19 GB Yes via MLX 30-50 tok/s
Mac M4 Max (36 GB unified) 19 GB Yes (Q6_K comfortable) 30-80 tok/s
Mac Studio M4 Max (64 GB unified) 19 GB Yes (Q8_0 + long context) 30-80 tok/s
NVIDIA DGX Spark 19 GB Yes (MTP tuned) up to 160 tok/s

Sources: Unsloth hardware table (unsloth.ai), Can It Run AI citing Q4_K_M = 19 GB, AMD day-0 performance note naming the R9700 32 GB as a supported card, and community throughput reports collected by explainx.ai.

That wide 10-160 tok/s span across "similar" 24 GB cards is almost entirely a story about quantization choice and whether speculative decoding is on — not raw GPU horsepower. The single biggest throughput lever for this model family is MTP.

How do you run Qwen3.8-27B with Ollama — the fastest path?

Ollama is the one-command entry point. It handles download, GGUF quantization, and exposes a local OpenAI-compatible endpoint at http://localhost:11434/v1 without any configuration. It was updated with the Qwen3.8 package on day one — August 14 2026 — and lists three variants: standard 27B (18 GB), the same tagged 27b, and an MLX build for Apple Silicon, also 18 GB. (Ollama library)

  1. Install Ollama from ollama.com/download (macOS, Linux, Windows). It auto-detects CUDA, ROCm, and Metal — no GPU drivers for you to configure.

  2. Pull and run the model:

   ollama run qwen3.8
Enter fullscreen mode Exit fullscreen mode

That single command downloads the 18 GB Q4_K_M package and drops you into a chat. To pick a specific variant on Apple Silicon, use ollama run qwen3.8:27b-mlx.

  1. Use it as an OpenAI-compatible endpoint. From any agent harness that talks the OpenAI API — Claude Code, OpenCode, Hermes Agent, or OpenClaw — just point it at the local URL:
   # example: Claude Code via the OpenAI-compatible Ollama backend
   ANTHROPIC_BASE_URL=http://localhost:11434/v1 \
   ANTHROPIC_MODEL=qwen3.8 \
   claude
Enter fullscreen mode Exit fullscreen mode

Ollama even publishes one-line launch snippets per supported agent on its model page (Ollama library qwen3.8): ollama launch claude --model qwen3.8, ollama launch opencode --model qwen3.8, ollama launch hermes --model qwen3.8, ollama launch openclaw --model qwen3.8.

Trade-off: Ollama sets generous defaults and is easy, but for power users wanting MTP speculative decoding or a tightly tuned context budget you will want llama.cpp or vLLM directly. Beginners will not feel the difference.

How do you set up Qwen3.8-27B with llama.cpp for maximum speed?

For local developers chasing throughput, llama.cpp is the canonical engine. Pair it with a Unsloth GGUF and switch on multi-token prediction (MTP), the same mechanism that gave Qwen 3.6 27B its inference speed boost on Apple Silicon.

  1. Install llama.cpp (on Linux or macOS):
   curl -LsSf https://llama.app/install.sh | sh
Enter fullscreen mode Exit fullscreen mode
  1. Serve a Unsloth GGUF quant, with MTP on, from a single command:
   llama-server -hf unsloth/Qwen3.8-27B-GGUF:Q4_K_M \
     --spec-type draft-mtp \
     -ngl 999 \
     -fa on \
     -c 65536 \
     --port 8080
Enter fullscreen mode Exit fullscreen mode

That exposes an OpenAI-compatible endpoint at http://127.0.0.1:8080/v1. The key flags: -ngl 999 offloads all layers to GPU, -fa on enables flash-attention (big context-budget saving), -c 65536 sets a 64K-context budget (cut this if you are VRAM-pressed — every extra K of context eats KV-cache memory), and --spec-type draft-mtp turns on the speculative decoding that pushes throughput toward the 80-160 tok/s community-reported band.

  1. Pick the right quant for your card. Unsloth publishes these memory targets (unsloth.ai/docs/models/qwen3.8):

| Quantization | Total memory (RAM + VRAM, or unified) | Fits |
|---|---|---|
| 2-bit | 11-13 GB | Very lossy; avoid for agent tasks |
| 3-bit | 13-16 GB | Fits 16 GB GPUs; coding quality drops |
| 4-bit (Q4_K_M) | 17-19 GB | The sweet spot — RTX 4090 / R9700 / 24 GB Mac |
| 6-bit | 24 GB | RTX 4090 comfortable; minor quality bump over Q4 |
| 8-bit | 31 GB | RTX 5090 32 GB or Mac M4 Max 36 GB+ |
| BF16 (lossless) | 56 GB | H100 80 GB or two stacked 4090s |

AMD users: AMD's own day-0 blog post documents loading the Q4 Qwen3.8-27B via the Vulkan backend in llama.cpp on a Ryzen AI Max+ processor or a single Radeon AI PRO R9700 32 GB, using the Vulkan backend with MTP=4. Set MTP to 4 on Ryzen AI Max+ and 2 on the R9700. Uncheck "Try mmap" in LM Studio's advanced model load settings.

Trade-off: Q4_K_M is the right quantization for most users. Going from Q4 to Q6 buys about 1-2 benchmark points of coding quality — usually invisible — and spends ~30% more VRAM, cutting your context budget. Only worth it on a 32 GB-class GPU with headroom.

How do you serve Qwen3.8-27B with vLLM for real throughput?

If you want to serve this model to multiple concurrent clients — an internal team endpoint, a CI pipeline, a coding-agent harness — vLLM is the production-grade option. Alibaba published official FP8 weights for the model on Hugging Face (Qwen/Qwen3.8-27B-FP8) targeting vLLM, SGLang, Transformers, and TokenSpeed. (NxCode)

  1. Install vLLM and serve the FP8 model:
   pip install vllm
   vllm serve Qwen/Qwen3.8-27B-FP8 --max-model-len 131072 --gpu-memory-utilization 0.92
Enter fullscreen mode Exit fullscreen mode

The FP8 weights are the right choice at the server tier when you have an H100, an H200, or a multi-GPU box — they are the highest-fidelity published format, quantized by the original Qwen team rather than community GGUF conversions.

  1. Call the OpenAI-compatible endpoint:
   curl -X POST "http://localhost:8000/v1/chat/completions" \
     -H "Content-Type: application/json" \
     -d '{
       "model": "Qwen/Qwen3.8-27B-FP8",
       "messages": [{"role":"user", "content":"Refactor this function for readability and explain each change."}]
     }'
Enter fullscreen mode Exit fullscreen mode

Trade-off: vLLM's FP8 path assumes server-class hardware (80 GB VRAM cards or multiple GPUs in a tensor-parallel setup). On consumer single-GPU cards, the GGUF + llama.cpp path is faster to first token and lighter on memory.

What can Qwen3.8-27B actually do at each tier? — agentic coding, vision, agents

The full benchmark card on Hugging Face includes the hard numbers, but here is the version a builder actually uses:

Agentic coding. Qwen reports Qwen3.8-27B scoring 61.7 on SWE-bench Pro (Claude Code harness, temp=1.0, top_p=0.95, 256K context window) — a 15-point jump from the 53.5 its predecessor Qwen3.6-27B reported. (Hugging Face) That number says the model can finish multi-step coding tasks against a real repo, not just write a snippet. Run it with Claude Code, OpenCode, Hermes Agent, or OpenClaw — all four are one-line launches via Ollama, and all four work with the OpenAI-compatible llama.cpp/vLLM endpoints too.

Vision-language. Qwen3.8-27B carries the vision encoder from Qwen 3.5's architecture (image-text-to-text on Hugging Face). The published vision benchmarks are big jumps over Qwen3.6-27B — 84.3 vs 63.9 on OSWorld-Verified (computer use), 81.9 vs 70.3 on AndroidWorld (mobile use), 94.6 on MathVision-v6 with code-interpreter vs 65.5 for Opus 4.6 Max. Importantly for us: model card says it sees STEM diagrams, documents, and hour-scale video — so the model can do OCR and visual reasoning without a second model in the loop.

Agents. Qwen3.8-27B scored 20.4 on Agents' Last Exam pass@1 — the exam that forces agents to work through environments and handle multi-step feedback. (Hugging Face) This is the claim that makes Qwen3.8-27B "an agent model" rather than just a chat model. It was trained on autonomous planning and handling environment feedback; it can carry that into a Hermes Agent or Claude Code harness with the right setup, per Ollama's day-0 "launch" snippets.

If you previously read Qwen 3.8 Max: The 2.4 Trillion Parameter AI Agent That Works for Days Without You and assumed the Qwen 3.8 generation was out of reach for self-hosters, read the next section before you buy anything.

How should you configure Qwen3.8-27B's reasoning controls?

Thinking is enabled by default and is the single biggest lever for both quality and latency. The Qwen release introduces two new knobs you will use every day:

  • reasoning_effort — configurable per request, in [xhigh, medium, low] (the Qwen 3.5 family used full-blanket on/off). High reasoning effort buys deeper multi-step reasoning on hard problems; low is the right choice for routine tasks where high effort just burns latency and tokens for no quality gain.
  • preserve_thinking — controls whether reasoning context from earlier turns carries into the next. Default preserves it. Turn it off for long multi-turn conversations where you don't want a single early mistake to compound through every later step.

The settings also show up in the Ollama and Hugging Face published model files as "min_p": 0, "presence_penalty": 1.5, "repeat_penalty": 1, "temperature": 1. (Ollama) You can override all of these in your harness — but watch out:

A behavior reported in community testing (explainx.ai) is worth heeding: at xhigh reasoning effort, the model "overthinks" routine tasks. You get a 2-minute answer to a 5-second question. The report's recommendation: default to medium or low for most work; reserve xhigh for problems you have already confirmed need it. I follow this myself and see the same pattern — it is a real cost, not a rumor.

Practical example. For a "fix this import error, here's the stack trace" prompt: reasoning_effort=low, preserve_thinking=false. For a "design the multi-step plan for refactoring the ORM layer across these three repos" prompt: reasoning_effort=xhigh, preserve_thinking=true. Same model, two engineers' worth of behavior difference.

How long does Qwen3.8-27B take to run end-to-end with a coding agent?

A worked example, from my own setup pattern. Hardware: a single RTX 4090 (24 GB). Stack: Ollama for the local model + Claude Code as the agent harness.

  1. ollama pull qwen3.8 — first-time download, 18 GB. On a 1 Gbit/s connection this takes 2-3 minutes; on a slow link expect up to an hour.

  2. ollama serve — exposes the OpenAI-compatible endpoint at http://localhost:11434/v1.

  3. Install Claude Code if you haven't; in a fresh project:

   ANTHROPIC_BASE_URL=http://localhost:11434/v1 \
   ANTHROPIC_MODEL=qwen3.8 \
   claude
Enter fullscreen mode Exit fullscreen mode
  1. From the Claude Code prompt, ask the agent to perform a real multi-step task on your repo — for example, "find dead branches in src/ and open a PR with the cleanup." The agent uses the local Qwen3.8-27B as the reasoning model and spends tokens against the repo filesystem tools — zero of those tokens leave your machine.

  2. Default reasoning_effort is whatever the harness's default says (commonly medium). For the dead-code hunt I'd set low for speed; for a refactor-of-architecture task I'd set xhigh.

  3. Watch Ollama's log to confirm token throughput. On a 4090 with MTP-style acceleration enabled in Ollama, expect 55-80 tok/s for Q4. With vLLM serving the FP8 model on a multi-GPU box you'd be well above that.

If you have read our cheapest-API-deal guide for 2026, the math here is the extreme case of that article: the Qwen3.8-27B + local-stack path costs whatever you already pay for electricity, and gives you unlimited tokens on a frontier-grade agentic coding model. Your only meter is your GPU.

What does Qwen3.8-27B NOT do well? — the honest limitations

I have not seen vendor hype-free reporting of the limitations outside a small handful of sources, and they're important to know before you wire this model into anything important:

  • It does not universally beat frontier closed models. The "27B beats Claude Opus" framing circulating online overstates the numbers. Qwen3.8-27B beats the cited Opus 4.6 Max on one citation (SWE-bench Pro, 61.7 vs 53.4) and trails it on the other four — sometimes by a wide margin (HLE: 30.8 vs 40.0). (explainx.ai)

  • These benchmark numbers are vendor-self-reported. Every score in the Qwen release came from Qwen's own evaluation harness — harness patches, tool versions, retry budgets, and timeout policy in your environment may change results. (NxCode)

  • 18 GB package means it fits, but does not mean 262K-context sessions are free. The full 262K context budget consumes significant KV-cache memory on top of the 19 GB weight footprint. A 24 GB GPU at Q4_K_M holds ~64K context comfortably; pushing to 262K requires a 32 GB-class or larger card, and the full 1M via YaRN needs substantially more.

  • Quantization choice has real downstream cost. "Runs locally" does not mean the full set of agent behaviors survives every quantization. The Qwen model card specifies the harness config that reproduced their scores; your mileage with a 2-bit or 3-bit community GGUF will vary, sometimes badly. (NxCode)

  • Pure local inference is slower than API calls. If you've been living on Claude or GPT-5 latency, an 18 GB local model at 60 tok/s will feel slow on long generations. That's the price of free + private + offline.

This is also why I'd recommend the Meta Muse Code guide we wrote for smaller setups — it's not identical in capability, but if you're below 24 GB VRAM it's the better small-model lever to pull first:

Related: How to Set Up and Use Meta Muse Code on Day One (2026 Guide) — covers Meta's lighter-weight coding model, also Apache 2.0 and Ollama-available, for setups without 24 GB of VRAM.

What this means for you

If you're a small business, a solo developer, or anyone who's been quietly resenting per-token API costs: Qwen3.8-27B is the first free model that fits on a single consumer GPU, runs locally, and has the published coding-agent scores of a serious open-weight release — the 61.7 SWE-bench Pro score is real, even if the "beats Opus" framing is not. Pair it with Claude Code or your preferred harness, tune reasoning_effort to the task, keep MTP on for speed, and you have an agent-grade coding brain that never phones home.

If you've been waiting for the moment local AI could do real coding-agent work, this is the moment you've been waiting for — with all the caveats above about what "real" still means. For agentic OS context — running Qwen3.8-27B as the brain of an always-on local agent stack — see our guide to building a local agentic OS in 2026. For the broader comparison between GLM-5.3 and Qwen3.8-27B as alternatives in the open-weight agent stack, see our GLM-5.3 review.

FAQ

Q: How much VRAM does Qwen3.8-27B need?
A: At Q4_K_M, approximately 19 GB of VRAM — total working set including weights and KV-cache sits at 19-20 GB depending on context length. The 18 GB Ollama package fits a 24 GB GPU (RTX 4090, RTX 3090, AMD R9700) or a Mac with 24+ GB unified memory. 16 GB cards do not fit at Q4_K_M. Sources: Unsloth hardware table, Can It Run AI.

Q: Is Qwen3.8-27B really free?
A: Yes. The model is released under Apache 2.0 — you can download the weights from Hugging Face and run them on your own hardware without any API subscription or per-token cost. The Apache 2.0 licence also allows commercial use and distributing modifications.

Q: Can Qwen3.8-27B run on a Mac?
A: Yes — Apple Silicon handles the 18 GB model via Ollama's MLX variant (ollama run qwen3.8:27b-mlx) on any Mac with 24+ GB unified memory. Reported throughput is 30-80 tok/s depending on the chip and quantization level. Source: Ollama library.

Q: What is the difference between Qwen3.8-27B and Qwen3.8-Max?
A: Qwen3.8-Max is the 2.4 trillion-parameter flagship with 95 billion active parameters (MoE) that needs a rack of GB300 NVL72 accelerators. Qwen3.8-27B is the dense, locally-runnable companion — 27 billion parameters, Apache 2.0, 18 GB on disk. Both are part of the Qwen3.8 generation released in August 2026. Source: Hugging Face model card.

Q: Can I use Qwen3.8-27B with Claude Code or my existing agent harness?
A: Yes. Ollama publishes one-line launch snippets directly on its model page for Claude Code, OpenCode, Hermes Agent, and OpenClaw. All four are OpenAI-compatible, so you can also point them at a llama.cpp or vLLM endpoint running Qwen3.8-27B-FP8 instead. Source: Ollama library qwen3.8.

Q: Does Qwen3.8-27B support vision and multi-modal input?
A: Yes. The Hugging Face pipeline tag is image-text-to-text — the model carries the vision encoder from Qwen 3.5 and supports image understanding (STEM diagrams, documents), OCR, and hour-scale video. Qwen3.8-27B scores 94.6 on MathVision v6 (with code-interpreter) vs 65.5 for Opus 4.6 Max. Source: Hugging Face.

Q: How much context can Qwen3.8-27B handle?
A: 262,144 tokens natively, extendable up to 1,000,000 tokens via YaRN. The full 262K-window session is not free — at Q4_K_M a 24 GB GPU is comfortably sized for ~64K of context; pushing higher needs a 32 GB-class or larger card. Source: Hugging Face model card.

Sources

Updates & Corrections

  • 2026-08-16 — Article published. All benchmark numbers as-reported by Qwen's model card; no independent re-runs available yet. Pricing, model versions, and required VRAM all flagged volatile — re-verify before any commitment.

Researched and drafted with AI agents; reviewed and fact-checked under human editorial oversight. How we work →

Top comments (0)