How to Run Qwen3.8 Locally with Ollama (2026 Guide)
Qwen3.8 is a 27.8B dense model with a 262K context window and vision input. Install Ollama, pick the right quant tag, and run it on a single GPU or Mac.

Qwen3.8 is Alibaba's latest update to the Qwen3 line, a 27.8 billion parameter dense model, meaning every parameter activates on every token rather than routing through a mixture of experts. It pairs a hybrid attention design, linear attention layers mixed with full attention layers, with a native 262,144 token (256K) context window that Alibaba says extends to 1 million tokens with the right configuration. Unlike some recent flagship releases that only ship as an Ollama cloud tag, Qwen3.8 has real local pull tags starting at 18GB, small enough for a single high-end consumer GPU or a Mac with enough unified memory.
The model also ships as multimodal, accepting text and image input, and runs with thinking mode on by default, meaning it shows its reasoning before answering. A `reasoning_effort` parameter controls how much thinking it does per request, and `preserve_thinking` controls whether that reasoning carries over across turns in a conversation. Alibaba built it for coding, professional research, and longer-horizon agentic tasks, the kind of work where a model needs to plan several steps ahead rather than answer a single question.
This guide covers picking the right quantization tag for your hardware, installing Ollama, running your first prompt, using the vision and thinking-mode features from the command line and the API, and wiring Qwen3.8 into an agentic coding workflow through Ollama's OpenAI-compatible endpoint. The alternatives section compares it to GLM 4.6, Laguna XS 2.1, and DeepSeek R1 for readers whose hardware or use case fits a different model better.
Prerequisites
- Ollama, updated to its latest release (run `ollama --version`; re-run the install command below if the model is not recognized)
- 17-24 GB or more of combined RAM and VRAM for the default q4_K_M tag (18GB download), 40 GB+ for q8_0 (30GB), and 64 GB+ for the full-precision bf16 tag (56GB)
- 18-56 GB of free disk space depending on which tag you pull
- An Apple Silicon Mac with 24 GB+ unified memory can use the MLX-optimized tag instead of a discrete GPU
- Basic terminal familiarity for `ollama pull` and `ollama run` commands
- (Optional) A rented GPU if your machine cannot handle the q8_0 or bf16 tags locally
Need more GPU power?
Rent a RTX 4090 on Vast.ai from $0.20/hr. On-demand GPU rentals by the hour, useful for running larger models without buying hardware.
In This Guide
What Qwen3.8 Is and Which Tag to Run
Qwen3.8 is Alibaba's newest release in the Qwen3 family, a dense 27.8 billion parameter model. Dense means every one of those parameters is active on every token, unlike a mixture-of-experts design that only activates a fraction of its total parameters per token. That makes Qwen3.8 more predictable to size for hardware: whichever quantization tag you pull is the actual memory footprint during inference, with no separate "active parameters" figure to account for.
The attention design underneath mixes two mechanisms. Some layers use linear attention, which scales more efficiently with sequence length, and others use full attention, which captures longer-range dependencies more precisely. Alibaba pairs this hybrid design with a native 262,144 token (256K) context window, extendable to 1 million tokens with additional configuration. Qwen3.8 also ships as multimodal, accepting both text and image input, and thinking mode is on by default, meaning the model writes out its reasoning before producing a final answer. Two request-level parameters control this: `reasoning_effort` sets how much reasoning the model does, and `preserve_thinking` controls whether prior reasoning carries into later turns of the same conversation.
On Ollama's library, the `qwen3.8` tag holds several real quantizations:
| Tag | Download Size | Recommended RAM/VRAM | Best For |
|---|---|---|---|
| qwen3.8 (= 27b = q4_K_M) | 18 GB | 17-24 GB+ | A single 24 GB consumer GPU (RTX 4090) or a 24 GB+ unified-memory Mac |
| qwen3.8:27b-q8_0 | 30 GB | 40 GB+ | Dual GPUs or a 48-64 GB workstation |
| qwen3.8:27b-bf16 | 56 GB | 64 GB+ | A single 80 GB datacenter GPU or a rented multi-GPU instance |
| qwen3.8:27b-mlx | 18 GB | 24 GB+ unified memory | Apple Silicon Macs, MLX-optimized instead of GGUF |
The plain `qwen3.8` tag, the explicit `27b` tag, and `27b-q4_K_M` all point at the identical 18GB download. Ollama's library also lists a few more specialized tags, `27b-mtp-q4_K_M`/`27b-mtp-q8_0`/`27b-mtp-bf16` (multi-token prediction variants at the same sizes as their non-MTP counterparts), `27b-mxfp8` (32GB), and `27b-nvfp4` (18GB, for NVIDIA Blackwell-class GPUs with native FP4 support). The four tags in the table above cover what almost everyone running this locally actually needs.
Install Ollama and Run Your First Qwen3.8 Prompt
Getting Qwen3.8 running takes about ten minutes on a normal connection, most of it spent downloading the 18GB default tag.
Step 1: Install Ollama
# Linux and macOS, one-command installer
curl -fsSL https://ollama.com/install.sh | shOn Windows, download the installer from ollama.com/download, or use winget:
winget install Ollama.OllamaConfirm Ollama is on its latest release, since Qwen3.8 was added recently:
ollama --versionStep 2: Pull and Run qwen3.8
The plain tag pulls the 18GB q4_K_M build, a reasonable starting point for a single 24GB GPU or a Mac with enough unified memory:
ollama run qwen3.8Expected output on first run:
pulling manifest
pulling 8a3f21c9... 100% ââââââââââââââââââ 18 GB
pulling tokenizer... 100% ââââââââââââââââââ 4.1 MB
success
>>> Send a message (/? for help)On an Apple Silicon Mac, pull the MLX-optimized tag instead for better performance on the same hardware:
ollama run qwen3.8:27b-mlxStep 3: Send a Test Prompt
>>> Write a Python function that merges two sorted lists into one, then explain its time complexity.Since thinking mode is on by default, the terminal shows the model's reasoning first, then the final answer. Expect the first response to take longer than later ones while the model and its context load fully into memory.
Step 4: Verify the Model
ollama list`qwen3.8:latest` appears in the list at its full download size, 18 GB for the default tag. Unlike a cloud-only model, this confirms the weights are actually on your disk.
Using Vision Input and Controlling Thinking Mode
Qwen3.8 accepts image input alongside text, and its reasoning depth is adjustable per request. Both are useful for anyone building on top of the model rather than only chatting with it interactively.
Send an Image from the Terminal
ollama run qwen3.8 "What is shown in this screenshot? ./error-log.png"Ollama reads the image file, encodes it, and sends it to the model alongside the text prompt in a single request.
Control Reasoning Depth via the API
curl http://localhost:11434/api/chat -d '{
"model": "qwen3.8",
"messages": [
{ "role": "user", "content": "Outline a plan to migrate a Django app from SQLite to Postgres." }
],
"think": true,
"reasoning_effort": "high",
"stream": false
}'Lower `reasoning_effort` values trade reasoning depth for faster, cheaper responses on simpler prompts. `preserve_thinking` (boolean) controls whether the model's reasoning from earlier turns stays in context for later turns in the same conversation, useful for long agentic sessions where earlier reasoning informs later steps, and something to turn off for shorter exchanges where it would only waste context.
Use Qwen3.8 in Your Own Scripts and Agents (API Access)
Beyond the interactive `ollama run` session, Qwen3.8 is reachable through Ollama's REST API and its OpenAI-compatible endpoint, the same interface used by agentic coding tools.
Python Example
from ollama import chat
response = chat(
model="qwen3.8",
messages=[{"role": "user", "content": "Refactor this function to use type hints."}],
think=True,
)
print(response["message"]["content"])OpenAI-Compatible Endpoint for Existing Agent Tools
Ollama exposes an OpenAI-compatible layer at `http://localhost:11434/v1`, the same endpoint used in the Hermes Agent and OpenClaw setups. Point that configuration at `qwen3.8` instead of a local model name, and the agent runs on Qwen3.8's 256K context window without any other config changes:
model:
default: qwen3.8
provider: custom
base_url: http://localhost:11434/v1
context_length: 262144Troubleshooting
`ollama run qwen3.8` fails or the model is not recognized
Cause: The installed Ollama version predates Qwen3.8 support
Fix: Update Ollama by re-running the install command (`curl -fsSL https://ollama.com/install.sh | sh` on Linux/macOS, or re-download on Windows), then retry.
Out-of-memory error or the model fails to load
Cause: The chosen tag exceeds available combined RAM and VRAM
Fix: Confirm you are using the 18GB q4_K_M tag (the default), not q8_0 (30GB) or bf16 (56GB), unless your hardware genuinely has 40 GB+ or 64 GB+ available. Drop to a smaller tag or rent a GPU with enough memory on Vast.ai rather than buying hardware.
Responses are slower than expected
Cause: Thinking mode is generating reasoning tokens before the final answer, or `reasoning_effort` is set high
Fix: Lower `reasoning_effort` for simpler prompts, or disable thinking entirely with `/set nothink` (interactive) or `"think": false` (API) when you only need a direct answer.
Image input is ignored or returns an error
Cause: The image path is wrong, or the request was sent to a text-only tag
Fix: Double-check the file path is correct and readable, and confirm you are running one of the standard `qwen3.8` tags (all listed tags support text and image input as of this model's release, but always confirm on the Ollama library page for the tag you pulled).
The MLX tag will not load on a non-Apple-Silicon machine
Cause: `qwen3.8:27b-mlx` is built specifically for Apple Silicon's Metal/MLX stack
Fix: Use the standard `qwen3.8` (GGUF) tag on Linux, Windows, or Intel Macs instead. MLX tags only run on Apple Silicon.
Context window errors past a certain length
Cause: The application or agent config caps `context_length` below the model's native 262,144 tokens
Fix: Set `context_length` to 262144 explicitly in the agent or API config, as shown in the OpenAI-compatible endpoint example above. Extending past that to the full 1 million tokens requires additional configuration beyond Ollama's default setup, check Alibaba's own documentation for that path.
Alternatives to Consider
| Tool | Type | Price | Best For |
|---|---|---|---|
| GLM 4.6 | Local (Ollama) | Free | A larger 357B parameter model for long-context agentic coding, small enough to run locally at low quantization on a single high-VRAM GPU. |
| Laguna XS 2.1 | Local (Ollama) | Free | A smaller-footprint mixture-of-experts coding model (33B total, ~3B active) with a 256K context window, for hardware closer to 24 GB total. |
| DeepSeek R1 | Local (Ollama) or VPS | Free | Reasoning-heavy tasks with visible chain-of-thought output, on hardware from 4 GB (1.5B distilled) up to 64 GB or more (70B). |
| GLM 5.2 via Ollama Cloud | Cloud (Ollama) | Free within Ollama Cloud limits | A 1M token context window and frontier-scale coding benchmarks, for tasks too large for any locally-hosted model regardless of hardware. |
Frequently Asked Questions
Can I run Qwen3.8 locally with Ollama?
Yes. Unlike some recent flagship releases that only ship as an Ollama cloud tag, Qwen3.8 has real local pull tags starting at 18GB for the default q4_K_M quantization. That fits on a single 24GB consumer GPU (an RTX 4090, for example) or an Apple Silicon Mac with 24GB or more of unified memory.
Higher-precision tags exist for more capable hardware: q8_0 at 30GB (40GB+ RAM/VRAM recommended) and full-precision bf16 at 56GB (64GB+ recommended). The plain `ollama run qwen3.8` command pulls the default 18GB tag.
How much RAM or VRAM do I need for Qwen3.8?
For the default 18GB q4_K_M tag, plan on 17-24 GB of combined RAM and VRAM. For q8_0 (30GB download), plan on 40GB or more. For the full-precision bf16 tag (56GB), plan on 64GB or more.
Since Qwen3.8 is a dense model rather than a mixture of experts, the tag's download size is a reliable proxy for its memory footprint during inference, there's no separate "active parameters" figure that lowers the requirement below the full model size.
What is the difference between qwen3.8 and qwen3.8:27b-mlx?
Both are the same 18GB download at the same q4_K_M-equivalent quantization. The difference is the underlying format: `qwen3.8` (and its `27b`/`27b-q4_K_M` aliases) uses the standard GGUF format that runs through llama.cpp-based inference, while `27b-mlx` is built specifically for Apple's MLX framework, which takes fuller advantage of Apple Silicon's unified memory and Metal acceleration.
Use `27b-mlx` on any Apple Silicon Mac for better performance on the same hardware. Use the plain `qwen3.8` tag everywhere else, including Intel Macs.
Does Qwen3.8 support images, or only text?
Qwen3.8 is multimodal and accepts both text and image input. From the terminal, pass an image file path alongside your text prompt: `ollama run qwen3.8 "Describe this image ./photo.jpg"`. Through the API, image data is included in the message content alongside text.
This applies across all the standard `qwen3.8` tags covered in this guide, not a separate vision-only variant.
What does thinking mode do, and can I turn it off?
Thinking mode, on by default, makes Qwen3.8 write out its reasoning before producing a final answer, visible in the terminal or returned separately in API responses. It generally improves accuracy on harder problems at the cost of slower, longer responses.
To disable it, run `/set nothink` at the start of an interactive session, or pass `"think": false` in an API request. The `reasoning_effort` parameter offers a middle ground, lowering it reduces reasoning depth and response time without disabling thinking entirely.
Can I use Qwen3.8 with an agent like Hermes Agent or OpenClaw?
Yes. Both Hermes Agent and OpenClaw connect to Ollama's OpenAI-compatible endpoint at `http://localhost:11434/v1`. Point the agent's model configuration at `qwen3.8` and set `context_length` to 262144 to use the model's full native context window.
Keeping `preserve_thinking` enabled for these sessions lets the model's reasoning from earlier steps carry into later tool calls and edits, which fits how the model was designed for long-horizon agentic work.
How is Qwen3.8 different from earlier Qwen3 releases?
Qwen3.8 is a dense 27.8 billion parameter model with a hybrid linear-and-full attention design, a native 262K token context window, and multimodal (text and image) input built in from release, along with thinking mode and adjustable reasoning effort. Exact comparisons to specific earlier Qwen3 point releases depend on which one you're comparing against, since Alibaba has shipped several Qwen3 variants at different sizes and architectures throughout 2026.
For a smaller local footprint than Qwen3.8's 18GB minimum, check Ollama's library for smaller Qwen3-family tags, or see the alternatives section of this guide for other models sized for lighter hardware.
Related Guides
How to Run Ollama Locally: Complete Setup Guide (2026)
How to Run Laguna XS 2.1 on Ollama: Local Setup Guide (2026)
How to Run GLM 5.2 on Ollama: Cloud Setup Guide (2026)
How to Run DeepSeek R1 Locally with Ollama (2026 Guide)
Best Local LLM Models to Run in 2026 (Benchmarks + Use Cases)
Ollama vs LM Studio: Which Local LLM Tool Should You Use in 2026?