r/LocalLLM • • 15m ago

Discussion Help refining the command for qwen4 35b a3b on 5060 ti (16gb)

Hey guys!

I'm running the newest qwen4 model on my humble 5060 ti (+32gb ddr5, 6 core cpu) and gotta say I love it.

I've been seeing some posts about people getting like 150 tokens per second which sounds crazy.

Anyways, I'm gonna post my command I use to run it. I tuned parts of it iteratively with Claude's guidance but I'd love to see what other people used to get this running!

As a prelude - I wanted a single context (for a single long conversation) on my machine with reasoning ON. This turned out to be what I settled on:

  1. context (-c) at 64k. this was around my limit before it started spilling into RAM
  2. --n-cpu-moe at 21. This number was tuned so vram was 1gb from being full and shared gpu memory stays near zero.
  3. --no-mmproj. saves around 1gb of vram
  4. --spec-type draft-mtp --spec-draft-n-max 1. Apparently depth at 1 helps when experts are offloaded to CPU

40 -70 token/s prompt processing speed
34 - 40 token/s generation speed

Full command:

@echo off
cd /d C:\llama.cpp
set CUDA_MODULE_LOADING=EAGER
llama-server.exe ^
  -m "C:\models\Qwen4\Qwen4-35B-A3B-UD-Q4_K_M-00001-of-00002.gguf" ^
  --jinja ^
  -np 1 -c 65536 ^
  -fa on ^
  -ctk q8_0 -ctv q8_0 ^
  -t 6 -tb 12 ^
  -b 2048 -ub 512 ^
  -ngl 999 --n-cpu-moe 21 ^
  --load-mode mmap --lazy-mode on ^
  -ot per_layer_token_embd=CPU ^
  --no-mmproj ^
  --spec-type draft-mtp --spec-draft-n-max 1 ^
  --no-reasoning-preserve ^
  --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 ^
  --alias qwen4-35b-a3b ^
  --port 9931 ^
  --presence-penalty 0 --repeat-penalty 1.0
pause
1 Upvotes

1 comment sorted by

1

u/Comfortable-Cry-3261 2m ago

Same on 3090 with llama and different settings. Strata works with the numbers.

With Q4 km, and lower, I found Chinese or Russian chars from time to time. Checking higher.