Abstract

We replaced Qwen3.8-27B, a dense 27-billion-parameter model, with Qwen4-35B-A3B, a sparse mixture-of-experts model with about 3 billion active parameters. The deployment is a self-hosted vLLM server with two NVIDIA RTX 5060 Ti cards (16 GB each), and the upgrade took place one day after the model was released.

Both systems were measured with the same benchmark on the same machine. The new deployment generates text 3.2× faster in a single stream, reads long prompts 3.3–4.7× faster, and uses about a quarter of the GPU energy per generated token. On a small functional test suite both models answered every task correctly. Qwen4 needed half to a third of the tokens to get there, so answers arrived 5–9× sooner.

The gains have a price. The usable context window shrank from 262,144 to 213,312 tokens and start-up time doubled. The system now also depends on a pre-release inference engine and a community quantization that nobody has evaluated independently yet.

1. Introduction

For more than eight months, a small self-hosted inference server has been doing real production work for us. It runs two mid-range consumer graphics cards and a single open-weights language model behind an OpenAI-compatible API. Coding agents send it multi-file changes. It reviews merge requests and drafts documentation. Agent harnesses keep it busy with long, tool-heavy conversations that can run for hours.

The model behind that API has changed twice. In the summer the server ran Qwen3.6-35B-A3B, a fast mixture-of-experts (MoE) model. In September we replaced it with the dense Qwen3.8-27B. That trade gave up generation speed for noticeably better agentic behaviour and the model’s full 262k-token context window; the story is told in our earlier report [1].

On 3 December 2026 Qwen released Qwen4-35B-A3B. On paper it reverses the last trade once more: a sparse model again, with vendor-reported agentic scores above those of the dense model it would replace. It also brings components that are new to self-hosting: a 20-billion-parameter n-gram embedding table, sparse attention with a learned indexer, and a built-in multi-token-prediction (MTP) module for speculative decoding.

The question we wanted to answer was practical: what does this upgrade actually change on this machine, and at what cost? To answer it, we measured the old system before touching it, then repeated the same measurements after the switch.

2. System and Models

The server has two NVIDIA GeForce RTX 5060 Ti cards. They have 16 GB of memory each and the Blackwell architecture, are connected only through PCIe (no direct GPU-to-GPU link), and each is capped at 180 W. A 16-core AMD Ryzen 9 9950X with 64 GB of RAM and an NVMe SSD complete the machine.

Both models run in vLLM and are split across the two GPUs (tensor parallelism), with an 8-bit (fp8) KV cache. The deployment is managed with Ansible and supervised by systemd and a health-check watchdog.

Qwen3.8-27B (before) Qwen4-35B-A3B (after)
Type dense mixture of experts (256 experts, 8 + 1 active)
Parameters 27B, all active per token 35B total, ~3B active; plus a 20B n-gram table and a 2B MTP module
Layers 64 (48 linear-attention, 16 full attention) 40 (30 linear-attention, 10 sparse attention)
Native context 262,144 tokens 1,048,576 tokens
Deployed weights 4-bit, all linear layers experts 4-bit; n-gram table 8-bit; the rest 16-bit
Size on disk 19 GB 45.8 GB

The n-gram table is unusual. It is a lookup table of ten million bigram and trigram embeddings. Because the model only looks entries up rather than multiplying with the whole table, vLLM can leave it on the SSD and read just the rows each step needs. This is the only reason a 46 GB checkpoint can be served from 32 GB of GPU memory at all.

3. Method

We wrote a small benchmark and ran it on the server itself, so that network latency does not affect the results. It has two parts.

The performance part uses deterministic (greedy) decoding with thinking switched off and fixed output lengths. It measures:

  • generation speed for a single request;
  • how quickly prompts of about 8,000 and 30,000 tokens are read, both from scratch and with the prompt already in the prefix cache;
  • throughput with one, two and four parallel requests.

GPU power and memory are sampled twice per second throughout.

The functional part runs six tasks with thinking switched on and the model card’s recommended sampling settings. Each task is repeated three times, and every answer is checked automatically:

  • two programming functions, validated by hidden unit tests;
  • a counting problem with a known answer;
  • a logic puzzle with exactly one solution;
  • a request that requires two tool calls with correct arguments;
  • extraction of a short e-mail into a given JSON schema;
  • retrieval of a code hidden in roughly 28,000 tokens of text.

Both runs used identical prompts and seeds on an otherwise idle machine. To separate the effect of speculative decoding from that of the model itself, we repeated the performance part for Qwen4 with MTP switched off.

One limitation applies throughout: we compare deployments, not models in isolation. The two models use different 4-bit quantizations and run on different builds of vLLM.

4. The Upgrade

4.1 Planning

The first constraint was memory. Qwen’s official 8-bit checkpoint needs almost 40 GB of GPU memory, more than our 32 GB. Within a day of the release, the community had already published dozens of smaller variants. We chose one that keeps Qwen’s own 8-bit n-gram table and compresses only the experts to 4 bits. Its author had validated it with vLLM on two consumer cards without a direct GPU link, the closest match to our setup we could find.

The second constraint was software. Qwen4 support had been merged into vLLM’s development branch on the day of the upgrade, but no released version contained it. We therefore ran vLLM from the project’s preview container image, pinned to an exact version. The Ansible role was extended to start vLLM either from the existing Python installation or from that container. The service name, the port, the logs and the watchdog all stayed the same, and the old installation remained in place for a rollback.

4.2 What the baseline revealed

Measuring the old system first turned out to be worthwhile in its own right, because it uncovered two problems that had nothing to do with the upgrade.

The first was configuration drift. The server was running with settings that no longer matched the repository: more GPU memory reserved, a larger prefill batch, and CUDA graphs switched on, although the repository disabled them deliberately.

The second was more serious. Our first benchmark run aborted with a GPU fault on the second card (Xid 13, “unspecified launch failure”), and the logs showed the same fault six times in the preceding nine days. We could not determine the cause. A second run completed cleanly, and its numbers matched the partial first run to within 0.1 %.

4.3 Making it fit

Loading the new model was easy. Serving it was not.

After the weights, little more than 3 GB per card remained, and the first attempt left almost nothing for the KV cache, the memory that holds the conversation context. We worked through the usual levers one at a time:

  • reserving more GPU memory;
  • reading prompts in smaller chunks;
  • capturing fewer CUDA graphs, then none at all;
  • disabling image input;
  • moving the vision encoder to system RAM, which costs nothing for text-only requests.

Each step freed a little memory, yet every attempt ended the same way: vLLM reported that not even a single sequence would fit.

The solution came from vLLM’s own start-up log. This build sizes the KV cache only after warming up, and it keeps a safety reserve for the memory allocator’s growth. On a 16 GB card carrying 12 GB of weights, that reserve swallowed the entire cache, even though about 2 GB were actually free. The log line that reported the failure also printed the cache size the older, profiling-based planner would have accepted. Setting that size explicitly made the model fit.

In hindsight, that line should have been the first thing we read. Instead it came after about a dozen restarts.

The result is a working server with two compromises:

  • The full 262k-token context does not fit. The largest window that works is 213,312 tokens, enough for one full-length conversation at a time.
  • Because the cache size is fixed by hand, vLLM’s protection against running out of memory during unusual load peaks is weaker. Our full benchmark, including 30k-token prompts, four parallel streams and image input, did not trigger an error, but that is limited evidence.

We kept both MTP and image input. Dropping either would have bought only a few thousand tokens of extra context.

Memory per GPU before and after

Figure 1. Memory use per GPU. Qwen4’s larger weights leave about a third of the previous KV-cache space.

4.4 Deployment

The final configuration was written into the Ansible variables, rendered and syntax-checked for both the container and the rollback variant, and deployed with the playbook. The service becomes ready after about three minutes, twice as long as before, mostly because the new kernels are compiled at start-up.

5. Results

5.1 Speed

The headline result is generation speed. A single request now runs at 144 tokens per second instead of 45, a factor of 3.2.

The ablation without MTP shows where that factor comes from:

  • The model and runtime alone account for ×2.2 (45 → 101 tokens/s).
  • Speculative decoding (MTP) adds ×1.4 on top. 84.7 % of the drafted tokens were accepted.

Speed-up decomposition

Figure 2. Single-stream decode speed, with and without speculative decoding.

The architectural gain is smaller than the ratio of active parameters (27B vs. ~3B) would suggest. Two explanations are plausible, though we did not isolate them. First, decoding on these cards is limited by memory bandwidth. Our checkpoint keeps the attention layers, shared experts and embeddings in 16-bit precision, so the bytes read per token fall much less than the active parameter count. Second, the new architecture adds per-token work the dense model does not have, such as hyper-connections and the n-gram lookups from system memory.

With several parallel requests the advantage remains but shrinks (Figure 3). The MTP gain in particular drops from ×1.3–1.4 for one request to ×1.1 for four. This is expected: speculative decoding uses spare GPU compute, and parallel requests use up that spare compute.

Throughput by concurrency

Figure 3. Aggregate generation throughput with one, two and four parallel requests.

Reading long prompts improved even more than generation: 3.3× faster at 8,000 tokens and 4.7× faster at 30,000. Prompt reading is limited by compute rather than memory bandwidth, so it benefits directly from the much smaller number of active parameters. For agent harnesses, which resend large contexts on every turn, this is arguably the more important improvement. A cold 30,000-token prompt now waits 4.7 s for its first token instead of 22 s.

Time to first token

Figure 4. Time to first token for long prompts, without and with a prefix-cache hit.

Energy fell as well. During single-stream generation both cards together drew 216 W instead of 266 W. Combined with the higher speed, energy per generated token dropped from 5.9 J to 1.5 J.

5.2 Answers

Both models solved all 18 functional runs. Our suite therefore cannot say which model gives better answers; it is simply too easy for both.

What it does show is how much each answer costs. For the same verified result, Qwen4 used 2.7× fewer tokens on the maths problem and about half as many on coding and extraction. Token use also varied less between runs: Qwen3.8 needed between 12,455 and 15,793 tokens for the maths task, Qwen4 between 3,389 and 5,405. This matches the model card’s claim of “markedly more concise” thinking.

Tokens per task

Figure 5. Tokens spent per task, including reasoning.

Shorter reasoning and faster generation multiply. The maths task used to take almost five minutes and now takes about thirty seconds. Across all tasks the time to a verified answer fell by a factor of 5–9.

Latency per task

Figure 6. Time to a verified answer per task (logarithmic scale).

5.3 What the vendor reports

Because our own suite cannot rank the two models, we refer to the vendor’s comparison for capability. The Qwen4 model card evaluates Qwen3.8-27B in the same release, which avoids comparing numbers from different evaluation rounds.

Vendor benchmarks

Figure 7. Vendor-reported scores for the unquantized models.

The pattern is clear. Qwen4 leads on agentic and professional-workflow benchmarks, in some cases by a wide margin; on a terminal-agent benchmark it scores 21.2 against 5.6. It trails the dense model slightly on GPQA, a knowledge-heavy reasoning test (86.9 vs. 89.2).

These are vendor measurements on full-precision weights, and some of the benchmarks are internal to the vendor. We did not reproduce any of them, and they need not carry over to our 4-bit deployment.

6. Threats to Validity

Quantization. Both deployments use 4-bit weights, but compressed in different ways. The new checkpoint was quantized without calibration data, and so far only its author has evaluated it: on a small text sample, its output agrees with Qwen’s official 8-bit release on 92.7 % of next-token predictions.

Runtime. The vLLM build and the underlying libraries changed together with the model. Part of the speed-up may come from newer kernels. Separating the two would require running Qwen3.8 on the new runtime, which we did not do.

Test coverage. Eighteen runs on six tasks detect gross regressions, not subtle differences in quality.

Decoding mode. The speed figures use deterministic decoding. Speculative decoding usually accepts fewer drafts at the higher sampling temperatures used in everyday work, so the MTP gain in practice is probably somewhat lower.

Stability. The old system failed six times in nine days. The new one ran without a fault for the duration of our measurements, about fifteen minutes of load. That says nothing yet about long-term stability.

Hardware. All results apply to this machine. The memory findings in particular depend on the exact 16 GB budget; on 24 GB cards the same model fits with a 262k window and room to spare.

7. Discussion

For our workloads the upgrade is clearly worthwhile, but it is not free.

What improved. Interactive work became faster by roughly an order of magnitude, because three effects multiply:

  • the faster model itself (×2.2);
  • speculative decoding (×1.1–1.4, depending on load);
  • shorter reasoning (×2–2.7 fewer tokens).

Long prompts are read 3–5× faster and energy per token fell to a quarter. According to the vendor, agentic capability also improved substantially.

What got worse. The context window lost a fifth of its size and gave back part of what the previous upgrade had gained. Start-up takes twice as long. The server now runs a pre-release engine and a day-old quantization, both of which will change. The memory budget is tight, with 15.7 of 16.3 GB per card in use under load.

A lesson about process. On a memory-constrained machine, whether a model “fits” depends on the inference engine’s memory planner as much as on the model’s size. Here a conservative default made a model that fits by about 1.5 GB per card look as if it did not fit at all. The information needed to resolve this was in the logs from the first attempt.

For anyone operating agent harnesses against such a server, three practical changes follow:

  • Clients configured for a 262k window must be lowered to at most 213k.
  • The served model name and the response parsers changed.
  • Thinking is now controlled with reasoning_effort (xhigh, high, low or none). As the model card cautions, lower effort is not always faster end to end in multi-turn agentic work.

8. Conclusion

Replacing a dense 27B model with a sparse 35B-A3B successor on two 16 GB consumer GPUs tripled generation speed and made long-prompt reading four to five times faster. Together with more concise reasoning, it cut the time to a verified answer by a factor of 5–9 in our tests.

The price is a smaller context window, slower start-up, and dependence on day-one software whose quality has not yet been evaluated independently. Our own tests cannot separate the two models on answer quality; the vendor’s benchmarks favour the new model on agentic tasks, though not on every reasoning task.

The most transferable lessons concern process rather than models. Measure the old system before changing it: in our case, that measurement also uncovered configuration drift and a latent hardware fault. And when a model seems not to fit, read the memory planner’s diagnostics before concluding that the hardware is too small.


References

[1] T. Seidel. Upgrading the Local LLM Stack: From Qwen3.6-35B-A3B to Qwen3.8-27B. https://remus-software.org/articles/qwen3.6-to-qwen3.8-upgrade/

[2] Qwen Team. Qwen4-35B-A3B (model card). Hugging Face, December 2026. https://huggingface.co/Qwen/Qwen4-35B-A3B

[3] vLLM project. Qwen4-35B-A3B serving recipe. https://recipes.vllm.ai/Qwen/Qwen4-35B-A3B

[4] Tech2wild. Qwen4-35B-A3B W4A16 with FP8 n-gram table (quantized checkpoint). https://huggingface.co/Tech2wild/Qwen4-35B-A3B-W4A16-FP8PLE

[5] Deployment configuration and documentation of this setup: https://github.com/tmseidel/local-llm-setup