
Qwen4-35B-A3B on an RTX 4090: coding, vision, and a Strata setup you can copy
On 4-5 December 2026 we ran Qwen4-35B-A3B on a home box with one RTX 4090 through Strata 0.2.26 (strata-q4-lite 0.1.74). We wanted solid coding, image and video inputs, and roughly 262k context.
The stack that covered coding and multimodal was Unsloth UD-Q4_K_XL + MTP + mmproj. After the A/B window we cut it over to :8080 (autostart + linger). Served / gateway id is qwen4-35b-a3b-ud-q4_k_xl, with no Flash-Next alias. Flash-Next (strata-iq3_s) stays disabled for rollback only; GPU0 is exclusive.
Later on 5 December we briefly brought Flash Stock back to finish a full Qualbench-50 (with long-ctx) and agentbench. The matrix previously only had 39/40 without long-ctx. After that parity window we restored Q4.
Below: the numbers, then a recipe you can mirror on similar hardware.
Numbers at a glance
All runs hit a local OpenAI-compatible endpoint with our own Bearer key; nothing went to the cloud. Qualbench is our 50-task suite (java/ts/sql/mcp/security + long-ctx). MMMU is a stratified 60-item subset, not full val. Video-MME is 15 clips.
| Suite | Flash Stock (IQ3_S) | Qwen4 Q4_K_XL+MTP | Qwen4 IQ4+MTP | Balanced+PLE-Q8+MTP |
|---|---|---|---|---|
| Qualbench | 49/50 (long-ctx 10/10; without long-ctx 39/40) | 48/50 | 47/50 | 46/50 |
| Agentbench default | 49p/6f | 49p/6f | 49p/6f | 49p/6f |
| HumanEval pass@1 | 0.994 | 0.951 | n/a | 0.970 |
| LiveCodeBench v5 | 0.766 | 0.595 | n/a | 0.597 |
| MM smoke (16) | 16/16 | 16/16 | 16/16 | n/a |
| MMMU-subset (60) | 90.0% | 83.3% | 78.3% | n/a |
| Video-MME (15) | 66.7% | 66.7% | 53.3% | n/a |
| Coding smoke tok/s | ~222 think-off median (hist. engine ~135) | ~251 | ~263 | ~141 |
On full Qualbench-50 Flash Stock is slightly ahead of Q4 (49/50 vs 48/50; same sql miss). Agentbench is 49p/6f for both. Flash still leads HumanEval, LCB, and MMMU. Q4 wins as the full stack: live MM on the same quant, clearly higher MM tok/s, and competitive coding-smoke decode. Balanced (native .strata + PLE Q8) is close on coding and even higher on HE, but CUDA vision for .strata is not ready in 0.2.26, so that MM column is invalid (HTTP 400 / flag ignored). The coding+MM+ctx pick is Q4_K_XL, not Balanced and not Flash.
Avg tok/s is Σ completion_tokens / Σ elapsed_s over suite items (or a think-off fib-probe median), not a chat-UI number.
Hardware
| Floor for this recipe | |
|---|---|
| GPU | NVIDIA RTX 4090 24 GiB (CUDA 12.9 / 13.x) |
| RAM | ~96-128 GiB (PLE/engram + expert cache; we run ~125 GiB) |
| Disk | NVMe: Q4 GGUF ~34 GiB + mmproj ~1 GiB + pack/MTP + logs |
| OS | Linux x86_64, user systemd + linger |
On 24 GiB without fat system RAM, long context and hot experts hurt immediately. Official vLLM/SGLang recipes for H200 / PRO 6000 / 5090 do not drop onto this card: the FP8 checkpoint alone is ~40 GiB+.
What to install
- Strata 0.2.26: control plus the
strata-q4-liteengine (the release ships separate binaries for.stratatiers and Unsloth GGUF). - Weights from
unsloth/Qwen4-35B-A3B-GGUF: theUD-Q4_K_XL/folder (two shards) plusmmproj-BF16.gguf. - MTP draft (usually beside the quant in Unsloth/Strata; we pass
--mtp …/mtp-rtand--spec 4). - After Strata prepare: pack,
trunk40.gguf,expert-profile-*.bin, PLE shard, whatever Qwen4 GGUF prepare emits.
Download sketch (keep HF tokens out of git):
hf download unsloth/Qwen4-35B-A3B-GGUF \
--include "UD-Q4_K_XL/*" "mmproj-BF16.gguf" \
--local-dir /mnt/data/qwen4/gguf/unsloth
Then run Strata’s normal Qwen4 prepare. Pin pack / model_name to something stable like qwen4-35b-a3b-ud-q4_k_xl. Pin binaries too: 0.2.26 / engine 0.1.74, not latest.
Do not rename model_name to an old Flash id to keep clients happy. Strata then fails to detect the Unsloth GGUF build and strips --vision. Point clients at the new id instead of adding aliases.
Serve config (what the flags mean)
The live profile is a JSON file for serve/server.py --engine strata --config …. The only secret is api_key (local, never committed). Field meanings:
| Knob | Winner value | Why |
|---|---|---|
| Quant / pack | Unsloth UD-Q4_K_XL | best measured coding+MM on 24 GiB |
--max-context | 262144 | large-ctx window |
--kv | int8 | room for experts; fp16 KV often slower on 24 GiB |
--mtp + --spec 4 | MTP on | speculative decode |
--vision + mmproj BF16 | images on | MM smoke / MMMU / Video |
--vram-reserve-mib | 2048 | headroom for elastic vision |
--expert-cache | auto | otherwise Q4_K_XL streams experts over PCIe |
host / port | 0.0.0.0 / 8080 | LAN + gateway front door |
model_name | qwen4-35b-a3b-ud-q4_k_xl | gateway id; no Flash alias |
drafting | mtp | next to args in JSON |
JSON skeleton (paths are yours; key is a placeholder):
{
"exe": "component:strata-q4-lite",
"model_name": "qwen4-35b-a3b-ud-q4_k_xl",
"arch": "qwen4exp_q4_lite",
"host": "0.0.0.0",
"port": 8080,
"gpu": 0,
"drafting": "mtp",
"thinking": "off",
"effort": "off",
"api_key": "CHANGE_ME",
"open_browser": false,
"args": [
"--pack", "/data/qwen4/packs/qwen4-35b-a3b-ud-q4_k_xl",
"--native", "/data/qwen4/staging-ud-q4_k_xl/trunk40.gguf",
"--native-dense-gguf", "/data/qwen4/staging-ud-q4_k_xl/trunk40.gguf",
"--ple-gguf", "/data/qwen4/staging-ud-q4_k_xl/Qwen4-35B-A3B-UD-Q4_K_XL-00002-of-00002.gguf",
"--expert-profile", "/data/qwen4/staging-ud-q4_k_xl/expert-profile-40x256.bin",
"--expert-cache", "auto",
"--prefill", "4096",
"--vram-reserve-mib", "2048",
"--kv", "int8",
"--max-context", "262144",
"--kv-resident", "32768",
"--conversation-cache-mib", "32000",
"--mtp", "/data/qwen4/mtp-rt",
"--spec", "4",
"--vision"
],
"vision": {
"exe": "/opt/strata-0.2.26/q4-lite/strata-vision",
"mmproj": "/data/qwen4/gguf/unsloth/mmproj-BF16.gguf",
"model": "/data/qwen4/staging-ud-q4_k_xl/trunk40.gguf",
"gpu": true,
"max_tokens": 1024
}
}
After start, the log should show roughly context 262144 tokens, images on and an MTP drafting line. If you see images off, the vision block or --vision did not stick.
systemd (user) + autostart
Two units: a firewall oneshot and the serve itself. Enable linger or the service dies after logout.
# ~/.config/systemd/user/strata-open-8080.service
[Unit]
Description=Open LAN TCP 8080 for Strata (iptables, no Docker)
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/sudo /usr/local/sbin/open-strata-8080.sh
RemainAfterExit=yes
[Install]
WantedBy=default.target
# ~/.config/systemd/user/strata-qwen4-ud-q4_k_xl-8080.service
[Unit]
Description=Strata Qwen4 UD-Q4_K_XL on :8080
After=network-online.target
Wants=network-online.target
Wants=strata-open-8080.service
[Service]
Type=simple
WorkingDirectory=/opt/strata-0.2.26/control
Environment=HOME=%h
Environment=PATH=/opt/strata-0.2.26/control/bin:/opt/strata-0.2.26/control/python/bin:/usr/local/cuda/bin:/usr/bin
Environment=CUDA_HOME=/usr/local/cuda
Environment=LD_LIBRARY_PATH=/usr/local/cuda/lib64
Environment=STRATA_COMPONENTS_DIR=/data/qwen4/components
ExecStart=/opt/strata-0.2.26/control/python/bin/python \
/opt/strata-0.2.26/control/serve/server.py \
--engine strata \
--config /data/qwen4/strata-qwen4-35b-a3b-ud-q4_k_xl-8080.json \
--port 8080
Restart=on-failure
RestartSec=10
TimeoutStartSec=1200
TimeoutStopSec=120
KillSignal=SIGINT
[Install]
WantedBy=default.target
Firewall script (root, /usr/local/sbin/open-strata-8080.sh):
#!/usr/bin/env bash
set -euo pipefail
if iptables -C INPUT -p tcp --dport 8080 -j ACCEPT 2>/dev/null; then
echo "8080 ACCEPT already present"
exit 0
fi
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
echo "8080 ACCEPT installed"
Sudoers (mode 440). Without NOPASSWD the user unit asks for a password at boot and fails:
youruser ALL=(root) NOPASSWD: /usr/local/sbin/open-strata-8080.sh
Enable:
sudo install -m 755 open-strata-8080.sh /usr/local/sbin/open-strata-8080.sh
sudo install -m 440 sudoers.berda-strata-8080 /etc/sudoers.d/berda-strata-8080
sudo visudo -cf /etc/sudoers.d/berda-strata-8080
install -m 644 strata-open-8080.service \
strata-qwen4-ud-q4_k_xl-8080.service ~/.config/systemd/user/
systemctl --user daemon-reload
loginctl enable-linger "$USER"
# GPU0 exclusive: disable Flash-Next / side-window units
systemctl --user disable --now strata-iq3_s.service \
strata-qwen4-ud-q4_k_xl-18080.service strata-open-18080.service 2>/dev/null || true
systemctl --user enable --now strata-open-8080.service \
strata-qwen4-ud-q4_k_xl-8080.service
Do not put Before= the LLM unit on the firewall oneshot: a slow or failing iptables step must not block model start.
Smoke checks
export OPENAI_BASE_URL=http://127.0.0.1:8080/v1
export OPENAI_API_KEY='…' # same value as api_key in the JSON
curl -fsS -H "Authorization: Bearer $OPENAI_API_KEY" \
"$OPENAI_BASE_URL/models"
# expect id: qwen4-35b-a3b-ud-q4_k_xl
# old Flash id should 404; we do not alias it
# short coding smoke + one image request (your harness / chat with image_url)
Through a Bifrost-style gateway the model string is llm-88/qwen4-35b-a3b-ud-q4_k_xl (provider prefix + the same served id).
Log readiness: ready: http://127.0.0.1:8080/v1 plus images on. The first image request starts the encoder (elastic); after ~120 s without pictures it may sleep again. That is expected.
Traps we hit
- Balanced
.strata+ vision on NVIDIA: in 0.2.26STRATA_BUILD_FLAG_READY["vision"]=False; control ignores--vision; mmproj helper returns400 … expected: GEN …. Balanced coding is fine; do not score MM until upstream flips the flag or you convert to GGUF+mmproj. - Two services on one GPU0: Flash and Qwen4 do not coexist. After cutover only the Q4
:8080unit is enabled. model_nameset to the old Flash id: Unsloth path breaks and vision drops. Keepqwen4-35b-a3b-ud-q4_k_xland move clients.cp -aover a symlink config: easy to overwrite stock Flash with a looped backup. Restore withcp -L --remove-destination.- LiveCodeBench output dirs key off
--model; a reused name clobbers another run’s folder. Copy artifacts right after the job. - vLLM/SGLang day-0 looks great on datacenter GPUs; on 24 GiB it is not the same recipe. Consumer path today is Strata + Unsloth GGUF (or llama.cpp as a slower control on Q4_K_XL).
What we left for later
- Full Unsloth Q8 GGUF (~60 GiB) as a ≥128k production serve: research / heavy offload only.
- Full suites on llama.cpp and EXL3+DFlash2: next A/B candidates, not a replacement for the current winner.
- Flash-Next rollback unit stays on disk (
strata-iq3_s) but disabled (rollback: disable Q4-8080, then enablestrata-iq3_s). - IQ4 HumanEval/LCB were not re-run; qual/agent/MM already covered.
Resources
- Welcome Qwen 4 (HF blog): https://huggingface.co/blog/qwen4
- Unsloth: How to run Qwen4: https://unsloth.ai/docs/models/qwen4
- Unsloth GGUF: https://huggingface.co/unsloth/Qwen4-35B-A3B-GGUF
- Strata 0.2.26 release: https://github.com/Niko1221/Strata/releases/tag/v0.2.26
- Independent 4090 audit (llama.cpp vs Strata): https://github.com/adeism/qwen4-35b-a3b-rtx4090-audit
- Strata IQ3_S vs FreeToken on an RTX 4090: Qualbench Score and Speed
- Testing Qwen3.6-35B-A3B Vision Locally: MMMU Results on an RTX 4090 vs the Published Benchmarks
- A Self-Hosted LLM Behind HTTPS: Nginx Gateway, Bearer-Token Auth, and Let's Encrypt
Published on 12/5/2026