Qwen4-35B-A3B on an RTX 4090: coding, vision, and a Strata setup you can copy

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.

SuiteFlash Stock (IQ3_S)Qwen4 Q4_K_XL+MTPQwen4 IQ4+MTPBalanced+PLE-Q8+MTP
Qualbench49/50 (long-ctx 10/10; without long-ctx 39/40)48/5047/5046/50
Agentbench default49p/6f49p/6f49p/6f49p/6f
HumanEval pass@10.9940.951n/a0.970
LiveCodeBench v50.7660.595n/a0.597
MM smoke (16)16/1616/1616/16n/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
GPUNVIDIA RTX 4090 24 GiB (CUDA 12.9 / 13.x)
RAM~96-128 GiB (PLE/engram + expert cache; we run ~125 GiB)
DiskNVMe: Q4 GGUF ~34 GiB + mmproj ~1 GiB + pack/MTP + logs
OSLinux 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

  1. Strata 0.2.26: control plus the strata-q4-lite engine (the release ships separate binaries for .strata tiers and Unsloth GGUF).
  2. Weights from unsloth/Qwen4-35B-A3B-GGUF: the UD-Q4_K_XL/ folder (two shards) plus mmproj-BF16.gguf.
  3. MTP draft (usually beside the quant in Unsloth/Strata; we pass --mtp …/mtp-rt and --spec 4).
  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):

bash
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:

KnobWinner valueWhy
Quant / packUnsloth UD-Q4_K_XLbest measured coding+MM on 24 GiB
--max-context262144large-ctx window
--kvint8room for experts; fp16 KV often slower on 24 GiB
--mtp + --spec 4MTP onspeculative decode
--vision + mmproj BF16images onMM smoke / MMMU / Video
--vram-reserve-mib2048headroom for elastic vision
--expert-cacheautootherwise Q4_K_XL streams experts over PCIe
host / port0.0.0.0 / 8080LAN + gateway front door
model_nameqwen4-35b-a3b-ud-q4_k_xlgateway id; no Flash alias
draftingmtpnext to args in JSON

JSON skeleton (paths are yours; key is a placeholder):

json
{
  "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.

ini
# ~/.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
ini
# ~/.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):

bash
#!/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:

text
youruser ALL=(root) NOPASSWD: /usr/local/sbin/open-strata-8080.sh

Enable:

bash
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

bash
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

  1. Balanced .strata + vision on NVIDIA: in 0.2.26 STRATA_BUILD_FLAG_READY["vision"]=False; control ignores --vision; mmproj helper returns 400 … expected: GEN …. Balanced coding is fine; do not score MM until upstream flips the flag or you convert to GGUF+mmproj.
  2. Two services on one GPU0: Flash and Qwen4 do not coexist. After cutover only the Q4 :8080 unit is enabled.
  3. model_name set to the old Flash id: Unsloth path breaks and vision drops. Keep qwen4-35b-a3b-ud-q4_k_xl and move clients.
  4. cp -a over a symlink config: easy to overwrite stock Flash with a looped backup. Restore with cp -L --remove-destination.
  5. LiveCodeBench output dirs key off --model; a reused name clobbers another run’s folder. Copy artifacts right after the job.
  6. 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 enable strata-iq3_s).
  • IQ4 HumanEval/LCB were not re-run; qual/agent/MM already covered.

Resources

Published on 12/5/2026

Loading tags...