I built an environment that runs Qwen4-35B-A3B on my own GPU workstation. The inference engine is NVIDIA’s Hyperflare (flare and selene). I left the assembly to AI agents, running them on Familiar, a multi-agent platform I built myself. The coordinator was Antigravity (agy, with the Gemini 4 Neon model).

I registered the finished environment as an Ancestor preset (a bundle of launch settings). Ancestor is a service I built that manages which inference server runs with which settings on the GPU workstation. When you pick the quantization, the GPU and the input length from a preset, Ancestor writes the container’s configuration file, starts it, and checks that the model responds. You can make that choice, and start or stop the server, with the :ancestor command in the Familiar TUI or the smartphone app. The presets and Quadlet containers in the second half of this article are the ones Ancestor handles.

Once the environment was ready, I had this Qwen4 itself write up the work as a 3-page HTML report. I recorded that on video.

What I built

The model is Qwen/Qwen4-35B-A3B. All of its parts together come to 57B.

  • A 35B language model. It is a MoE model (a design that uses only a few of many specialist parts). It uses about 3B at a time and has 256 specialist parts.
  • A 20B N-gram PLE embedding table. This is a large table kept in main memory (RAM), not on the GPU. Below, I call it the PLE table.
  • A 2B MTP-1 draft head. This small part guesses the next words ahead of time.
  • A 27-layer image encoder (the part that reads images)
  • Long inputs of up to 1M tokens (a token is the unit the model splits text into)

The machine is the GPU workstation in my homelab (Compute). It runs Ubuntu 24.04 LTS.

PartDetails
CPUAMD EPYC 9175F (16 cores)
Memory768 GiB DDR5-6400 ECC
GPUNVIDIA RTX PRO 6000 Blackwell Max-Q 96GB × 2 (PCIe 5.0, no NVLink)

I did not modify or fork the upstream NVIDIA/hyperflare-inference and hyperflare-recipes. The work needed to fit Qwen4 went into a separate package, qwen4-hyperflare-recipe. To convert the model, this package’s command (qwen4-ignition export) calls the upstream tools.

There are 2 kinds of quantization. W4A16 shrinks the weights to 4 bits and computes in 16 bits. W4A4 uses 4 bits for both the weights and the computation. For W4A16, I converted Qwen’s official original weights (BF16). For W4A4, I used the 4-bit version that RadixArk publishes (NVFP4, RadixArk/Qwen4-35B-A3B-NVFP4).

There are also 2 ways to use the GPUs: run on one GPU (TP1), or split one model across two GPUs (TP2). The 2 quantizations and the 2 GPU setups give 4 configurations, and I converted all of them ahead of time. Each one handles 1M-token inputs and up to 64 requests at the same time.

The prefix cache lets the next request reuse the first part of an input that was already read. It lives only in RAM, and SSDs are not used. The server runs as a Podman Quadlet (a configuration file that runs a container as a systemd service).

Letting the coordinator plan and assign the work

In Familiar, each task has one coordinator, called root. Root makes the plan, assigns work to other agents, and checks the results. I explain how this works in Familiar, a multi-agent development platform: how it works and how to build it.

This task was called “Build Qwen4-Hyperflare”. Root was Antigravity (Gemini 4 Neon, with reasoning effort set to medium). Root first started 3 lookouts, the agents that investigate. They looked into the differences between the recipe and the model, the Hyperflare runtime, and the Gitea issues. Root then put out an 8-step plan with 7 checks.

The plan’s steps and who handled them are below. A lookout investigates, and an operator implements one piece of work. Steps 4 and 5, which are not in the table, were also handled by operators.

StepWorkAgent
1Create an issue for the work in Gitealookout
2Build Hyperflare itself (flare and selene) and check that it supports the PLE tableoperator
3Create the qwen4-hyperflare-recipe package and its testsoperator
6The 8-item acceptance test, and speed measurements on one GPU and on two GPUsoperator
7Review the diff, clean up the files left by the builds, and write the final reportroot
8Record the decisions and results in the Gitea Wikilookout

The 7 checks covered these points: Hyperflare itself builds and runs; the external package; converting the one-GPU and two-GPU configurations; the acceptance test and speed measurements; a review of the deployment drafts and the command that applies them to production; and Ancestor’s cargo build and cargo test.

The Familiar TUI. The 8 steps of the task Build Qwen4-Hyperflare have completion marks, and in the chat in the center, root agy reports the W4A4 and W4A16 results on one GPU in a table
The screen for the task that built the environment (Build Qwen4-Hyperflare). In the plan on the right, all 8 steps have completion marks. The header at the top shows 6 checks passed and 1 on hold. In the chat in the center, root agy (Gemini 4 Neon) reports the W4A4 and W4A16 results on one GPU as a table. The bar at the bottom shows when root, the investigating agents and the operator writing the deployment drafts were running.

In the chat on the screen, root reports that W4A4 on one GPU with 64 requests at once reached 2,167.68 tok/s in total (44.34 tok/s per request). It is moving on to converting and measuring W4A4 on two GPUs.

Changes to host settings (such as systemd units) were written out as drafts in deploy_drafts. One of the checks is to review them together with the command that applies them to production.

The results went into Ancestor’s development branch as a PR. In step 8, a lookout saved the decisions as a decision record in the Gitea Wiki.

Decisions made while building

From the decision record in the Wiki, I picked the ones most likely to help if you build the same thing.

DecisionOption not chosenReason
Leave upstream untouched and keep the Qwen4-specific differences in a separate packageCustom CUDA kernels, or a fork of upstreamUpstream already had the parts Qwen4 needs
Cap requests at 64 at a time. Beyond that, start 2 servers and split the load (DP2)Take 96 requests in one serverUpstream Ignition accepts only up to 64
Keep the prefix cache only in RAM: 256G for the one-GPU configuration and 480G for twoKeep it on SSD, or in a file in RAM (tmpfs)With 768 GiB of RAM, an SSD is not needed. With tmpfs, the same data would sit in RAM twice
Run it in a Podman Quadlet containerRun it directly as a systemd service on the hostIt matches the other presets, and the container stays small
Default to W4A16, one GPU, 1M tokensW4A4, two GPUsIt gives the fastest single-request speed among the one-GPU configurations (225 tok/s). The second GPU stays free for other uses
Keep PCIe ACS (a mechanism that controls direct traffic between devices) enabled in the BIOSTurn ACS offJudging from the measured GPU-to-GPU transfer speed and the gain from adding the second GPU, it is not slowing things down

The two-GPU configuration starts with --bypass-performance-check, which skips the upstream performance check. Tuning the kernel and driver settings should make it possible to drop this flag, but I have not done that tuning yet.

There were a few stumbling points. During model conversion, setting parallel compilation to 16 ran out of memory on one GPU, so it was lowered to 4. In the Quadlet of Podman 4.9.3, writing 2 Ulimit= lines keeps only the last one. The limit on open files was moved to PodmanArgs instead.

The work also retired 11 presets that were no longer used. That freed about 1.1 TiB on the disk that holds the models.

Inside the preset

The preset qwen4-35b-a3b-hyperflare has 24 launch settings (profiles). They combine 2 quantizations, 3 GPU choices (the first, the second, or both) and 4 input lengths (256k, 512k, 768k, 1M).

The default is W4A16, the first GPU, 1M tokens and 2 requests at a time. GPU memory use is held to 75%. With this setting, about 24.4 GiB stayed free on the first GPU (GPU 0).

An editor showing runtime/inference/presets/qwen4-35b-a3b-hyperflare.toml. interface is hyperflare, core_path is qwen4-w4a16-tp2-c64, prefix_cache_memory is 480G, embedding_table_storage is ram, and gpu_devices is 0 and 1
Ancestor's preset file qwen4-35b-a3b-hyperflare.toml. The screen shows the second half of the profile that runs W4A16 on two GPUs with 768k-token inputs (w4a16-all-768k). It loads the converted qwen4-w4a16-tp2-c64, gives the prefix cache 480G, and keeps the PLE table in RAM. The next profile, w4a16-all-1m, starts at line 1589.

These are the settings on the screen that are specific to Hyperflare.

KeyValueMeaning
interface"hyperflare"Start as Hyperflare
core_path.../cores/qwen4-w4a16-tp2-c64The configuration converted in advance (W4A16, two GPUs, 64 at a time)
prefix_cache_memory"480G"How much RAM the prefix cache uses
embedding_table_storage"ram"Keep the PLE table in RAM
gpu_devices[0, 1]Use both GPUs

Speed results

Each run produced 128 tokens of output, with temperature (how much the output varies) set to 0.0. During the measurements, the prefix cache was 16G for the one-GPU configuration and 32G for two.

“tok/s” is the number of tokens produced per second. “Time to first token” in the table is the time from sending a request until the first token comes back (TTFT). “At once” is the number of requests sent at the same time.

ConfigurationAt onceTotal (tok/s)Per request (tok/s)Time to first tokenGPU power and temperature
One GPU / W4A161213225.233 ms289 W, 81°C
One GPU / W4A41177186.336 ms148 W, 55°C
One GPU / W4A16161,13388.9213 ms293 W, 81°C
One GPU / W4A4161,10397.0285 ms254 W, 58°C
One GPU / W4A4642,16844.3544 ms299 W, 64°C
Two GPUs / W4A161230249.644 ms258 W + 218 W
Two GPUs / W4A41212223.432 ms98 W + 156 W
Two GPUs / W4A16321,81785.6405 ms280 W + 267 W
Two GPUs / W4A4322,045100.6393 ms227 W + 236 W
Two GPUs / W4A4643,02262.4291 ms252 W + 251 W

For one request at a time, W4A16 was faster: 225 tok/s on one GPU and 250 tok/s on two.

As more requests are sent at once, W4A4 pulls ahead. On two GPUs with 64 requests at once, it reached 3,022 tok/s in total. W4A4 also ran at lower power and temperature than W4A16.

This is only part of the results. The table for all 18 configurations is on page 2 of the report in the video.

Acceptance test

I prepared an 8-item acceptance test, and every item passed. These are the main results.

  • Startup time: 18.5 to 19.0 seconds on one GPU, and 23.0 to 24.0 seconds on two.
  • Prefix cache: with an input of about 44K tokens, a cache hit cut the time from 2,358 ms to 42.4 ms (55.67 times faster).
  • Long input: in a test that hides one piece of information in a 717K-token text and asks the model to find it (NIAH), one GPU passed in 49.8 seconds and two GPUs in 27.6 seconds. The GPUs did not run out of memory (OOM).
  • Output on one GPU and on two GPUs: at temperature=0.0, the most likely next token matched 100%.
  • Images: passed with a single image and with a prompt that passes several frames.
  • GPU switching: while the server ran on the first GPU only, the second GPU was not in use. After switching between one GPU and two GPUs and back 3 times, free RAM stayed steady at about 752.5 GiB.

The screen below shows the inference server running on Compute. On the left is the usage of the two GPUs (nvtop). On the right are values pulled from the inference server’s /metrics.

A terminal with nvtop showing the state of two RTX PRO 6000 Blackwell Max-Q cards on the left, and values starting with flare_ fetched with curl on the right
The terminal on Compute. In nvtop on the left, GPU 0 is using 72,456MiB (74%) of its memory. The right side shows values starting with flare_, picked from the output of curl http://127.0.0.1:8000/metrics.

The values on the right show 138 completed requests and 0 failures. Of 139 cache lookups, 133 were hits, and 7,244,094 tokens were reused. The two cache counters with host in their names are both 0. The median time to the first response was 0.1588 seconds.

Having the same model write a report

Next, I used the finished Qwen4 as a Familiar worker. I asked it to write up the work above as a 3-page HTML report. The video shows about 25 minutes as they happened, from the instruction until the pull request opened.

Video link: https://www.youtube.com/watch?v=rpZhPst_KVU

The coordinator here was again Antigravity (Gemini 4 Neon). Root read the decision record in the Wiki and made a 5-step plan.

StepWorkAgent
1Page 1: overview, and the machine and model specsQwen4 worker
2Page 2: speed table, charts, and the acceptance testQwen4 worker
3Page 3: decision record and what has not been tried yetQwen4 worker
4Check the structure of the 3 pages, the links between them, and that they match the WikiQwen4 verifier
5Review the overall look and content, and record the outputsroot

The workers ran on dsh, my own coding agent, with this Qwen4 preset as the model. Root gave each worker the numbers and facts for its page, the design rules shared by the 3 pages, and the commands to run as a check after writing. The 3 pages were written in parallel, each in its own worktree (a Git feature that gives each piece of work its own working directory).

Along the way, 3 problems were found: a wrong table heading on page 2, and how the table descriptions (captions) were added on pages 1 and 3. The Qwen4 workers made the fixes too, and the verifier checked the fixes on pages 1 and 3.

The plan had 9 checks. Of these, 6 were checked with commands, and all of them passed: the files and content of each page, the links between the pages, and Ancestor’s cargo build and cargo test. The other 3 are for a person to check how each page looks. The video ends when the pull request opens.

What I have not tried yet

  • I have not measured running 2 inference servers at the same time (DP2) yet. The figure of about 4,335 tok/s with 128 requests at once is an estimate: the result for one GPU with 64 requests at once, doubled.
  • I have not yet compared the output in detail (a logit comparison) against the original weights (BF16) running in transformers. So far, I have only checked that one GPU and two GPUs give the same output.