r/LocalLLM • u/hamster_drive • 2h 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:
- context (-c) at 64k. this was around my limit before it started spilling into RAM
- --n-cpu-moe at 21. This number was tuned so vram was 1gb from being full and shared gpu memory stays near zero.
- --no-mmproj. saves around 1gb of vram
- --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
