Running Qwen4 Locally: How Much Context Can Your Computer Handle?

Geöffneter Laptop auf einem Holztisch
Photo by Kari Shea on Unsplash

Alibaba’s Qwen team released Qwen4-35B-A3B for download on December 4. It handles text and images, and its model card lists a context window of about one million tokens, the chunks of text the model draws on when answering. On suitable hardware, that makes it possible to review a long manual alongside its amendments. How well it works on your own computer depends as much on the runtime and its memory needs as on the model itself.

Key takeaways

  • Qwen4-35B-A3B offers downloadable weights under Apache 2.0. Its name refers to 35 billion parameters in the language model, of which about three billion are active per token.
  • The model card also lists 20 billion parameters in a lookup table for token sequences and two billion for predicting multiple tokens.
  • One million tokens describes the model’s capacity. The usable context length depends on the model package, the software, and the memory available.
  • For a first local run, a representative set of documents, verifiable passages, and a shorter initial context setting will tell you more than the maximum token count.

Why three billion active parameters tell you little about memory

Qwen4 uses a group of specialized subnetworks, an approach known as a mixture of experts. For each processing step, the model selects some of them. That limits the computation per token while leaving other subnetworks available for the next step. The computer still needs to keep their weights accessible. A small active parameter count helps explain why a model can run relatively quickly, but offers little guidance about download size or memory requirements.

There is also a large table for short sequences of tokens, known as n-grams. The model looks up patterns in it and reads only a few rows per token. The whole table still takes up space. In the documented FP8 package, the developers of the vLLM server software keep the table in the computer’s system memory and fetch the rows they need for computation. That shows how hardware requirements can shift with the software. Capacity tells you whether the data fits. Speed also depends on how quickly the computer can move that data between types of memory.

Ollama, for example, lists its downloadable qwen4:35b-a3b-q4_K_M variant at 37 GB. That figure is the size of the model package. While running, the software needs extra space for working data and context. Our earlier look at computers with shared memory explains how that design differs from the traditional split between system memory and dedicated graphics memory.

What a long context window can do in practice

A context window holds the material available to a model for a particular request. That might include the manual, a question about it, and the conversation so far. Qwen combines two approaches to keep long inputs manageable. One part of the model compresses the history into a compact internal state. Another selects a subset of earlier text blocks to examine more closely in the next step. This reduces the amount of work while letting the model process a long source as a whole.

Consider a service manual that states the basic rules up front and lists exceptions in an appendix. With both sections available, you can ask for the rule, the exception, and the passages that support each. You can then check the answer against the chapters. This illustrates the limit of using the token count as a measure of usefulness. An entire source can fit in context while the model still picks the wrong paragraph or mixes up two versions when answering a specific question.

How to get started locally

If you already use Ollama and have enough disk space, the model is in its official catalog and launches with ollama run qwen4. Start with a short passage and a narrow question. Then try a real document where you already know the answers. If you ask which exception applies in a rulebook, ask for the specific passage as well and check it in the original. From there, increase the context gradually and weigh the time it takes for the first answer to arrive against the benefit of providing more material.

For its own model variant, the LiteRT-LM team cites an Apple silicon Mac with at least 36 GB of unified memory as an example that can handle up to one million tokens without using swap. That figure applies to that particular runtime and model package. On another system, start by watching whether the software moves parts into slower storage and how the response time changes with the next larger document.

The next question is how much material the same machine can take before more context stops paying off. For a single manual with exceptions scattered throughout, extra context may yield better-supported answers. For a folder full of different versions, searching for the relevant documents first may still be faster and make the result easier to check.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top