Qwen4 35B on an RTX 4090 + 32 GB RAM: 166K daily, 252K+ tested with vision

I wanted to know how much context I could actually **use** on a 24 GB card with only 32 GB of system RAM. Loading a model at 256K is one thing. Feeding it a long prompt, adding an image, and getting the right answer back is another.
**Setup:** RTX 4090 (24 GB VRAM), Core i9-13900KF, 32 GB RAM, Windows 11. I used the same Unsloth Qwen4-35B-A3B `UD-IQ4_XS` GGUF weights for the main tests (31.5 GiB across two shards), with one inference slot. Q8 and Q4 below refer to the **KV cache**, not different model weights.
## What worked in LM Studio
| Configured context | KV cache | Actual input, including an image | Time to first text | Lowest free VRAM |
|---:|:---:|---:|---:|---:|
| 184,320 | Q8/Q8 | 177,738 tokens | 65.3 s | 2,495 MiB |
| 229,376 | Q8/Q8 | 203,683 tokens | 74.7 s | 1,811 MiB |
| 262,144 | Q4/Q4 | 252,665 tokens | 76.8 s | 1,495 MiB |
All three used an F16 vision projector on the CPU. Each got **three markers scattered through the text and three values from the image right**. These are individual runs with different prompt lengths, not a Q8 vs. Q4 speed comparison. They show that the long input fit and the model could retrieve specific facts, not that Q4 is just as good as Q8 at reasoning.
## What changed when I pushed it
- **LM Studio vs. standalone llama.cpp:** With the same weights and similar Q8 text settings, an uncached ~202K prompt took **84 s vs. 90 s** to first text on my runs. Follow-ups that reused the prompt cache started in **under a second** on both. Standalone also handled **249K text tokens in Q8** and **258K including an image in Q4**, with different memory settings. I wouldn't switch engines just for speed based on this test.
- **Q4 buys memory, not guaranteed speed.** At a 262,144-token window, standalone llama.cpp logged **3,400 MiB of cache buffers in Q8 vs. 1,800 MiB in Q4**, including the attention index cache. Putting all experts on the GPU at that size still left only **580 MiB free under load**, even with the projector on the CPU. It worked, but I wouldn't daily-drive it.
- **GPU vision makes a big difference on short prompts.** A separate LM Studio Q4 profile with the projector on the GPU got first text in **0.46–0.78 s** on two test images. The CPU-projector profiles took roughly **5–8 s** on those images. I didn't verify that GPU-projector profile with a nearly full window.
- **MTP wasn't an automatic win.** At the same expert placement, speculative decoding went from **74 to 93 tok/s for code**, but only **72 to 78 for prose**. A Q8 profile without MTP that kept more experts on the GPU hit **95/86 tok/s** on short code/prose tests. The fastest short test, Q4 with MTP, hit **118/99 tok/s** but dropped to **642 MiB of free VRAM** under load. That's a benchmark result, not a daily setting.
I also got Strata running with vision at 128K, but it used `UD-Q4_K_XL` instead of `UD-IQ4_XS`. That was a smoke test, not a benchmark against LM Studio.
## What I actually kept
**165,888 tokens in LM Studio, `q8_0` for K and V, Flash Attention on, GPU KV cache, one slot, 512/512 batches, MTP off.** I kept the F16 projector and embedding table on the CPU and offloaded the experts from six layers to system RAM (`--n-cpu-moe 6`). On this build I used `--load-mode dio`, `--lazy-mode off`, and `--override-tensor per_layer_token_embd=CPU`.
That left about **3 GiB of VRAM free at idle**. Nine longer generations on that profile ran at **67–84 tok/s** (median **76**), but a long tool-heavy session can be much slower. Decode speed doesn't include rereading an uncached history, running tools, or summarizing the conversation.
If you're on **24 GB VRAM + 32 GB RAM**, I'd start around **160–180K with a Q8 cache**, then test with your actual workload and check system RAM as well as VRAM. Keep some room for the reply, and keep the model loaded if you want to reuse the cache. I'd reserve the 262K profile for when I actually need the extra context.
About this post
- Posted
- Archived
- Score
- 1 · 100% up
- Kind
- Image
- ID
- 1yd4lj0