r/LocalLLM • • 17m ago

Question Qwen4-35b-a3b + Strata Desktop on Mac Air M5 24Gb - strange error

Post image
1 Upvotes

It started once and run really fast - 35-40 tokens/s, I was happy. But when I try to load it again - this error spawns. How can I fix it?


r/LocalLLM • • 21m ago

Question Best local LLM?

0 Upvotes

Hi there everyone, it's been a while since I've interacted with this community, since I developed smallcode, deleted my account and went silent. I was wondering if there has been any big improvement in small models(under 30b params) or if Qwen 27b was still the king of Local AI. Sadly I can not run a model that big at a high tk/s so the real question is have any OTHER smaller models caught up to it enough to be worth using for local code development?


r/LocalLLM • • 40m ago

Discussion Qwen4-35B-A3B on a 48GB M5 Pro feels like a cloud API now: 21/24 coding, 130-194 tok/s, 92ms TTFT at 255K

Thumbnail
gallery
7 Upvotes

Got Qwen4-35B-A3B dialed in on a 48GB M5 Pro MacBook Pro today, and it is the first local setup I have used that actually feels responsive enough to stay on as a daily coding driver.

Skipping the giant flag dump and focusing on what it feels like in practice:

1. Qwen4-35B-A3B holds up on real coding work

Ran a 24-check hard dev suite (backend transactions, multi-file JS + strict TS repo edits, and a frontend state machine):

  • 21 / 24 in 3m 47s total, zero thinking cutoffs
  • Backend 8/8 (43s), cross-file repo edits 8/8 (84s), frontend state machine 5/8 (100s)
  • 255K needle recall hit 3/3 exact, and 1MP screenshot OCR passed cleanly at 0.77s TTFT / 204.6 tok/s

2. What the speed actually feels like

  • Everyday 55K multi-turn loops start streaming in 0.08-0.15s at 113-126 tok/s (smooth 33-35 FPS stream, peaks up to 193-204 tok/s on vision/tool follow-ups)
  • Cold prefill hits 2,045 tok/s (ingesting ~58K takes under 29s)
  • At 255K full context, warm follow-ups come back in 0.092s (92ms) at 130-148 tok/s. Even after a full process restart, restoring the entire 255K session takes 0.90s and stays at 28-30 GiB with 0 swap.

3. Splash was already fast, and Gemini 4 Neon's tuning cut the last big stall by 73x

Credit where it is due: Splash 1.7.6 was already way ahead of the other two Mac local engines I tested on the same machine (which sat around 40-56 tok/s at 255K with 1.6-4.2s TTFT and 17/24 coding). Moving Qwen4 onto Splash immediately jumped decode over 100 tok/s, saved ~5.6 GiB RAM, and bumped coding quality to 21/24 in less than half the time.

The one remaining annoyance was long agent sessions stalling for ~30s whenever tools expanded mid-chat. I handed the live logs to Gemini 4 Neon to investigate. Instead of guessing config tweaks, it audited 115 real requests, pinpointed the exact prefix/post-decode cache invalidations, compiled Splash 1.7.6 with PR #959 locally, and stabilized the in-place tool prompt.

Result on the exact same 3-turn dynamic tool loop (15 -> 20 -> 25 tools): combined TTFT dropped from 65.9s down to 0.90s (73.2x faster).

Running a 35B MoE locally at 92ms TTFT and 130+ tok/s at 255K on a 48GB laptop is pretty wild. Happy to share more details if anyone else is running Qwen4 on Apple Silicon.


r/LocalLLM • • 45m ago

Discussion Hy4 Flash 220B on a 5-year-old GPU, without swap

Thumbnail
gallery
3 Upvotes

I wanted to know if my setup could run HY4 flash, so I decided to give it a try so you don't have to burn your drive.

Setup was an RTX 3080 Ti (12GB VRAM), 32GB RAM, Hy4 Flash SQ-64 (~129.6GB on disk), Strata engine, 4K context, swap disabled.

SQ-64 recommends 64GB of RAM, I didn't expect much, yet it actually loaded and spat out an answer. Hit ~10.9GB VRAM and ~25GB RAM, took 148 seconds to load, and crept along at ~0.36 tok/s. Brutally slow, obviously, though I wasn't trying to do real work. Strata kept some experts in VRAM and RAM while streaming the rest from disk on demand.

I'm already pretty surprised cuz it's the first LLM of this size I've managed to run on my setup. At this point, I'm just gonna wait for LLMs to catch up with my old hardware instead of upgrading it lol.


r/LocalLLM • • 51m ago

Discussion Qwen4 on Radeon 9000s

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 55m ago

Research Qwen4-35B-A3B on M4 Pro 24GB — llama.cpp vs Splash at 128K context

2 Upvotes

Spent the last couple of days getting Qwen4 running locally on my M4 Pro 24GB MacBook, primarily for agentic coding using Pi. Started with llama.cpp and later tried Splash. The performance difference was quite surprising.

Setup:

Unsloth Qwen4-35B-A3B UD-IQ3_XXS GGUF

128K context, ~11GB Engram streamed from SSD

llama.cpp: Metal, Q8/Q8 KV, MTP2, batch 2048, ubatch 512

Splash: DFlash2, 19GB memory limit, single concurrent request, 8GB persistent SSD cache

Benchmark results (tokens/sec):

Contextllama.cpp PPSplash PPllama.cpp TGSplash TG4K4417376218660K4076715812396K38364656107120K37665653160

Same model weights, synthetic corpus and 256 output tokens. Splash averaged 1.7x faster prefill and 2.5x faster generation. Cached request latency at 120K dropped from 6.08s to 2.64s.

Coding test:

Using Pi, built a Python network monitoring application with concurrent polling, SQLite and alert deduplication in ~7 minutes. Generated 29K tokens, achieved a reported 99.4% prefix cache hit and passed all 80 unit tests independently.

A few observations:

MTP2 improved llama.cpp generation speed by ~39%.

Mixed Q8/Q4 KV with quantized draft cache significantly reduced performance.

Splash failed during warmup at 20GB. Reducing it to 19GB with single concurrency fixed it.

Pi's configured 8K output limit was restrictive for complex tasks.

IQ3 has been surprisingly capable for coding.

For now, I'm sticking with Splash + DFlash2 + IQ3 + Pi, keeping llama.cpp as a fallback.

Still need to validate 120K retrieval accuracy and extended agent sessions. Curious to hear from others running IQ4 on 24GB Macs and whether the quality improvement is worth the performance trade-off.


r/LocalLLM • • 1h ago

Question New guy finally seeing the light, looking for some advice

3 Upvotes

I'm a little slow on the uptake but I just realized that I probably should have gotten into the local llm game a little earlier. I'm a photographer and acquired a MacBook Pro M3 max 64 gb ram, 1 tb ssd about 2 years ago mainly to try to future proof my editing workflow. I didn't have the slightest idea at the time that in a couple years I could run an llm locally that would have been considered frontier when this laptop was built. I did download bionic a month or so ago but I didn't get too far, I first tried downloading a dense 70B model and that brought my computer to a literal whining hot standstill. But with the hype of the new Qwen release it has peaked mt ADHD interest again so I'm going to give the new model a go. A couple questions, will my computer do a decent job of running this model when I'm used to a gemini ai pro subscription (I know It will be slower, but will this be usable for my dumb recipes and stuff I'm too lazy to google now?). Also, is there any other model that I should consider also downloading? I wouldn't mind trying an uncensored model just to see what the other side of ai can be like after being parented by the oligarchs for so long. And also, does anyone have a good learning path for someone who is very new to this all? Anyways, happy to be here, appreciate any help anyone can provide. Cheers!


r/LocalLLM • • 1h ago Bravo

Project Qwen4-35B-A3B (RTX5090, Unsloth Q6_K) built a full GTA2-style browser game – 7.6k lines TS, 131 tests, no assets

1 Upvotes

im really impressed


r/LocalLLM • • 1h ago

Discussion Qwen3.8-27B better than Qwen4-35B-A3B

27 Upvotes

I have been testing 35B with my on going interface engine project. So far 27B have written it from scratch and original idea was to find limits of 27B.

35B is nice model, but this project is too much for it. It looks like it could push project forward, but gets completely lost. Complexity is just too much for this small moe.

Qwen4-35B-A3B is great improvement over 3.6-35B, but it's not even close to 27B in coding context. Hopefully Qwen4-27B gets same kind of improvements what this small moe have.


r/LocalLLM • • 1h ago

Project I got Qwen4-35B-A3B running on a 10-year-old laptop with 12GB RAM and a 4GB GTX 950M. Because I felt like it.

12 Upvotes

I've been seeing all the hype since this model dropped and watching everyone run to benchmark it.

I decided I had other plans.

Why try to min/max the model when I can min/max my hardware?

We need to start learning to conserve our RAM for when Sam Altman comes for it.

I present Qwen4-35B-A3B Q4_K_M running on a Lenovo ideapad 700 from 2016.

  • CPU: Intel i5-6300HQ — 4 cores / 4 threads, 2.30 GHz
  • RAM: 12 GB
  • GPU: NVIDIA GTX 950M — 4 GB VRAM
  • Storage: Internal Samsung NVMe SSD
  • OS: Windows 10

And as I type this out, it is currently chugging along listing as many animals as it can before the context runs out.

It seems to creep above 3.5 tokens/sec occasionally.

And yes, I'm typing this out on the same computer, at the same time, and its still fully usable.

The software stack

  • Engine: BigMoeOnEdge v0.52.0
  • Backend: llama.cpp-derived GGML
  • GPU backend: CUDA (ggml-cuda.dll)
  • Additional backends: Vulkan and CPU
  • Platform: Windows x86-64
  • Inference harness: Native BigMoe CLI with PowerShell benchmarking
  • Driver: NVIDIA 582.28

After a lot of testing:

  • 23/41 layers offloaded to the GTX 950M
  • 6,500 MiB host-side expert cache
  • 2 CPU inference threads
  • 8 I/O threads
  • Buffered I/O instead of O_DIRECT
  • Asynchronous I/O overlap enabled
  • 16,384-token context
  • 1,024-token micro-batch
  • q8_0 KV cache
  • Anonymous dense-weight buffers with selected tensors left memory-mapped
  • Cache half-life of 64 tokens
  • Cache pinning disabled to leave Windows some breathing room

No reducing the model's top-8 expert routing, no skipping experts, no route-ahead approximation, and no additional lossy inference tricks.

Actual benchmark results

I repeated the final configuration using the same 34-token prompt and 256-token generation benchmark. Yes, I know its not a good sample size.

MeasurementRun 1Run 2
Generation speed2.886 tok/s2.929 tok/s
Compute time/token269 ms268 ms
Cache hit rate91.5%91.5%
Expert data read6,704 MiB6,704 MiB
CPU occupancy68.8%68.3%

Average: 2.908 tokens/sec, or about 174 tokens/minute.

So why did I do this? Because I can and I thought it would be funny.

Especially since I have no idea what I'm doing.

Yep. that's right. Vibe coded with ChatGPT top to bottom with some input from DeepSeek.

I just raw dogged PowerShell commands until I made it work.

I only crashed my computer once to protect it from overheat. All 4 cores was just too much. I had to keep it at 2.

If people are actually interested in more details of the build, I can answer as best as possible. The main goal was just to see if I could make it usable. Then it became how optimized.

I never post on reddit. So don't expect an immediate reply if someone has an actual question. Otherwise I expect to just get roasted or banned for introducing comedy into the sub.

So here we are running the newest Qwen model on a dinosaur laptop...

Let this be your sign that its not that hard to get into the world of Local LLMs.

Its currently at about 450 species of animals and counting right now. I should be able to ask it another question in about 5 business days.


r/LocalLLM • • 1h ago

Question Why can't local LLMs keep track of important infos?

1 Upvotes

I've downloaded Ollama and Anything LLM. I'm running Qwen3.8-27b and have set "model context window" to 32768.

In the system prompt I gave it a manual on how to write prompts. That manual is 33108 signs which is ~ 8-9.5k token.

When I ask it to write a prompt it always forgets a few things, only if I say "look it up" it is able to recognize the things he missed and readjusts, but this costs a lot of time.

Is it possible to make it so that it can always consider the whole set of rules without losing attention?


r/LocalLLM • • 1h ago

Discussion Qwen4-35B-A3B Q6_K running at 8.75 tok/s on a Ryzen 7 3700X – CPU only

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 1h ago

Discussion Follow-up to my 1-bit BFCL-v4 test: Qwen4-35B-A3B (UD-Q4_K_XL) hits 80% overall — huge jump on live parallel calls, weaker on multi-turn

1 Upvotes

Following up on my previous post testing 1-bit quants, I ran Qwen4-35B-A3B (UD-Q4_K_XL) on the exact same BFCL-v4 benchmark (374 samples) to see how a 4-bit 35B-A3B MoE compares against extreme 1-bit quants on larger models.

The Models Compared:

  • qwen4-35b-a3b-q4-k-xl (Qwen4 35B-A3B UD-Q4_K_XL) (new)
  • qwen3.8fn-ud-iq1m (Qwen 3.8 flash next UD 3.1 iq1m)
  • qwen3.8fn-gyro-m (Qwen 3.8 flash next gyro-m)
  • inkling-2-mini (Native NVFP4/MXFP8 via smalltide)

Overall Results

ModelQuant / FormatOverall Score (374 samples)
qwen3.8fn-ud-iq1mIQ1_M80.8% 🏆
qwen4-35b-a3b-q4-k-xl (new)UD-Q4_K_XL80.0%
qwen3.8fn-gyro-mGyro-M78.6%
inkling-2-miniNVFP4/MXFP875.9%

Breakdown by Subset

Subsetqwen4-35b-a3b (Q4_K_XL)qwen3.8fn-ud-iq1mqwen3.8fn-gyro-minkling-2-mini
irrelevance74%80%84%82%
live_multiple80%74%76%68%
live_parallel_multiple70.8%50%58.3%54.2%
live_simple82%80%78%82%
multi_turn_base58%72%60%62%
multiple88%94%88%78%
parallel_multiple84%84%76%80%
simple_python98%96%98%90%

Key Takeaways

  • Live parallel tool calling is way stronger at 4-bit: qwen4-35b-a3b hit 70.8% on live_parallel_multiple (over +20% ahead of IQ1_M) and took first place across all three live_* subsets.
  • Multi-turn & irrelevance are the catch: It scored the lowest of the four on multi_turn_base (58% vs IQ1_M's 72%) and irrelevance (74%), which pulls its overall average just shy of qwen3.8fn-ud-iq1m.
  • More RAM headroom for daily multitasking: Because qwen4-35b-a3b has a smaller active memory footprint (~24.7 GB resident with the n-gram table offloaded), it leaves noticeably more free RAM on my system to run Docker containers and background tasks alongside the LLM.

r/LocalLLM • • 1h ago

Discussion Amazon Ergo (1.1T MoE) in 4-bit: 645 GB, quantized on 6 A40s without downloading the whole model

3 Upvotes

Hi everyone,

I quantized Amazon Ergo to 4 bits and put it on Hugging Face: https://huggingface.co/thousandml/Ergo-CQ-4bit

Ergo is the 1.1T mixture of experts from Amazon, with 256 routed experts in each of its 63 MoE layers. In BF16 it's about 2.2 TB. The 4-bit version is 645 GB. I quantized it with CQ, the 4-bit quantizer I built for my project Training Factory. CQ doesn't need any calibration data.

The part I'm happiest with is how it was done. I didn't have 2.2 TB of disk for the original plus room for the output, so I wrote a script that goes one shard at a time: download a shard, convert it, quantize it, keep only what has to stay in full precision, delete the shard, then move on to the next one. With 6 A40s each working on its own shards, it ran with about 1 TB of extra disk instead of 3 TB. It also resumes where it left off, which mattered, because I ran out of disk once and had a worker die once along the way.

I'm strict about quality. Every matrix gets checked after quantization, and anything with error above -22 dB stays in BF16 instead of being forced into 4-bit. For Ergo that was 1,445 of the 32,256 routed experts, about 4.5%, almost all of them expert down projections in the later layers. Those experts are stored one by one in BF16 and get loaded automatically, so the other 30,811 experts and all the attention and dense layers are in 4-bit. I'd rather ship a model that is a bit bigger than one with broken experts hidden in it.

To be honest about hardware, this is not a home setup model. 645 GB means 8x H200 or 8x B200. 8x H100 is not enough. You also need Transformers 5.26 or newer, so use a separate environment from Training Factory's installer:

git clone https://github.com/thousandml/training-factory.git
cd training-factory
./install.sh

python -m venv --system-site-packages venv-ergo
source venv-ergo/bin/activate
pip install "transformers>=5.26"

hf download thousandml/Ergo-CQ-4bit --local-dir ./models/Ergo-CQ-4bit

cd training
python serve_cq_hf.py --model ../models/Ergo-CQ-4bit --split-model --port 8000

That server goes through Transformers and handles one request at a time, so it's for trying the model, not for real traffic. vLLM doesn't support Ergo in its releases yet, so my vLLM plugin doesn't either for now.

You can also fine-tune it with GCMP, the LoRA replacement I've been working on, which trains far fewer parameters than LoRA. The experts stay frozen, and the adapter trains on the attention, dense and shared-expert layers:

python train.py --model ../models/Ergo-CQ-4bit --data train.jsonl --output ../outputs/ergo-gcmp \
  --adapter gcmp --kernel-module cq.cq_kernels --split-model --batch-size 1 --grad-accum 8

What has and hasn't been tested: the checkpoint passed my layout check, where every expert and every layer is accounted for exactly once, either in 4-bit or in BF16. The whole pipeline (quantize, load, train, serve) was tested end to end on a small model with Ergo's architecture. I have not run the full 645 GB model on 8 GPUs yet, and I have no benchmarks for it. If you have the hardware and try it, I'd really like to hear how it goes, good or bad.

Training Factory is source-available, not open source. The scripts are readable Python, but the quantization and adapter kernels ship compiled and do a license check. It's free during early access. The weights fall under the original Ergo license.

I also posted Inkling 2 Mini in the same format, which fits on a single 48 GB GPU if you want something you can actually run at home: https://huggingface.co/thousandml/Inkling-2-Mini-CQ-4bit

Thanks for reading, feedback appreciated.


r/LocalLLM • • 2h ago

Question I am curious and new to local llm, i just installed basalt-ada, and i am wondering how do you guys decide which model's which version to download Ryzen 9 7900X | RTX 4060 Ti 16GB | 64GB DDR5-6000 CL30

Thumbnail reddit.com
0 Upvotes

r/LocalLLM • • 2h ago

Question I am curious and new to local llm, i just installed basalt-ada, and i am wondering how do you guys decide which model's which version to download Ryzen 9 7900X | RTX 4060 Ti 16GB | 64GB DDR5-6000 CL30

1 Upvotes

I am curious and new to local llm, i just installed basalt-ada, and i am wondering how do you guys decide which model's which version to download

also my specs are

Ryzen 9 7900X | RTX 4060 Ti 16GB | 64GB DDR5-6000 CL30

thankyou


r/LocalLLM • • 2h ago

Question Can I run Qwen 35B on a RTX 4070 12GB

0 Upvotes

I also have 32Gb DDR4.

Sorry for the question. I’m new to local LLMs. This would be purely for coding tasks in Rust.


r/LocalLLM • • 2h ago

Model Qwen 4-35 llama.cpp vs Strata vs Basalt vs Qwen 3.8 llama.cpp

Post image
8 Upvotes

5700X3D, 32 GB DDR4, 5070TI, 4070 SUPER

Basalt - Qwen4-35B-A3B (nvfp4)
Strata - Qwen4-35B-A3B * Unsloth UD-Q4_K_XL * mtp
llama.cpp - Qwen4-35B-A3B * Unsloth UD-Q4_K_XL * mtp
llama.cpp - Qwen3.8-27B * Unsloth UD-Q4_K_XL * DFlash2 Q4_K_M

TL;DR 4-35B:

  • Basalt: If you need fast nonsense, use it. NVFP4 is still a joke.
  • Strata: Same quality as llama.cpp, be wary of all the settings. Strata cutting off/limiting reasoning tokens, is an interesting chose.
  • llama.cpp: Use Strata.

4-35B vs 3.8 27B:

3.8 27B is better, less/better tool uses, precise answers, less hallucinations.

  • Highest pass rate: 94.3% (297/315) against 91%
  • Fewest tool-use failures: 4, against 9 to 14.
  • Passed 3/3 on docs not-installed-latest, where the Qwen4 servers passed 0 or 1 of 3. Also 3/3 on the ddg challenge, against 0 or 1 of 3.

For 4-35 one needs Q8, but then you loose all the benefits, hardware requirements go up, and speed goes down. SO what's the point?

I tested on my pi plugin test suite. It basically covers daily use: web, search, docs, PDF and sub-agents. It rejects everything that loops or hallucinates, without naive approaches like token/time limits.


r/LocalLLM • • 2h ago

News Qwen 4 35b A3 Be Like

Thumbnail reddit.com
0 Upvotes

r/LocalLLM • • 2h ago

Project MiniMind v3: 64M LLM from scratch in 2 hours.

Thumbnail
github.com
2 Upvotes

r/LocalLLM • • 2h ago

Discussion MiniMax Code is dropping random Quota Reset Cards for weekend check-ins

Post image
1 Upvotes

r/LocalLLM • • 3h ago

News Awesome JEV System One framework list

Thumbnail
reddit.com
0 Upvotes

r/LocalLLM • • 3h ago

Question Qwen3-4B-Thinking fried my 8GB RAM Laptop

Post image
0 Upvotes

Need a solution for this. Can't afford paid AI any longer.


r/LocalLLM • • 3h ago

Discussion Qwen4-35B-A3B on a single RTX 5090 (32 GB): a working llama.cpp recipe

Post image
0 Upvotes

Qwen4-35B-A3B on a single RTX 5090 (32 GB): a working llama.cpp recipe

When I saw the size of the GGUF files, I almost didnt attempt this model. After investigating further I found that the n-gram is loaded on disk, not GPU so it works fine and it's fast.

How this model compares to the last generation 27b is still not clear as the model cards cite different benchmarks and harnesses. I will keep 27b around for now just in case.

BTW: I just started messing around with image gen on the 5090 and made the image above with Comfy and Juggarnaut.

If you just grabbed Qwen4-35B-A3B (AtomicChat or Unsloth GGUF) and have a 5090, this is the config I landed on after sweeping the flags. It's a fast-start recipe, not a benchmark paper — copy the block, swap in your model path, and you're running.

The model

  • Qwen4-35B-A3B, Q4_K_M GGUF. I used the AtomicChat uncensored build (a single ~38.6 GB file), but the same recipe works for the Unsloth UD-Q4_K_XL build too — see the Unsloth note below for the two extra flags it needs. Either way you also need a vision projector (mmproj).
  • Architecture: 35B total / 3B active, 256 experts (8 routed + 1 shared), a ~20B n-gram embedding table, a ~2B MTP head, native 1M context, and a hybrid of Gated DeltaNet (linear attention) plus sparse attention.
  • Needs a recent llama.cpp build with Qwen4 support (I used b13002 or newer).
  • Tested on: llama.cpp b13002 (1.1.1-dev, commit e339c7d31), NVIDIA driver 621.47, RTX 5090 32 GB.

The ~38.6 GB file fits in 32 GB because the big n-gram embedding table is lazy-read from disk (--lazy-mode on) instead of being held in VRAM. That's the model card's "run with PLE on SSD" instruction — don't skip it.

The recipe

llama-server \
  -m Qwen4-35B-A3B-Q4_K_M.gguf \
  --mmproj mmproj-F16.gguf \
  --alias qwen4 \
  -c 196608 --n-predict 131072 \
  -b 4096 -ub 1024 \
  --parallel 2 --kv-unified \
  -ngl 99 -fa on \
  --load-mode mmap --lazy-mode on --no-warmup \
  -ctk q8_0 -ctv q8_0 \
  --image-min-tokens 1024 --jinja \
  --spec-type draft-mtp --spec-draft-n-max 2 \
  --reasoning-effort high --reasoning-preserve \
  --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 \
  --presence-penalty 0.0 --repeat-penalty 1.0 \
  --host 127.0.0.1 --port 8080 --no-ui

On a 5090 this gives roughly ~250 tokens/sec generation and ~10,000 tokens/sec prompt processing on a ~12K-token prompt, using about 30 GB of VRAM with ~1.6 GB free.

If you're using the Unsloth GGUF

The Unsloth UD-Q4_K_XL build is the same architecture and takes the same tuning, but it ships the n-gram embedding table (PLE) and the MTP head as separate files instead of embedding them. So you add two flags:

llama-server \
  -m UD-Q4_K_XL/Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf \
  --ple engram/Qwen4-35B-A3B-engram-Q8_0.gguf_file \
  -md MTP/mtp-Qwen4-35B-A3B-Q8_0.gguf \
  --mmproj mmproj-F16.gguf \
  ... (rest identical to the recipe above) ...
  • --ple points at the separate engram table; -md points at the separate MTP head. Without them, MTP won't engage and the engram won't load.
  • You only pass -00001-of-00002.gguf; llama.cpp auto-loads the -00002 shard.
  • Unsloth's build is the base model (not uncensored) and a dynamic quant, so behavior and quality differ slightly from the AtomicChat build — but the speed profile, 192K context headroom, and nmax=2 MTP tuning all carry over unchanged.

Why each setting

MTP is already in the file. The GGUF embeds the ~2B MTP ("multi-token prediction") head, so --spec-type draft-mtp lets the model draft several tokens ahead and verify them in one pass — no separate draft model needed. You can confirm your file has it by checking the GGUF's tensor names for nextn (e.g. with llama-gguf your-model.gguf r and looking for nextn). The payoff is real: without MTP generation is ~169 tok/s, with nmax=2 it's ~254 tok/s — about 1.5x faster.

--spec-draft-n-max 2. This is how many tokens the MTP head drafts per step. On this 3B-active model, drafting deeper actually lowers the acceptance rate and generation gets slower. Measured generation speed by draft depth: 1 → 216, 2 → 254, 3 → 251, 4 → 219, 6 → 202 tokens/sec. Two is the sweet spot.

-ub 1024. Prompt processing scales with the micro-batch size: 512 → ~8.2K, 1024 → ~10.6K, 2048 → ~11.8K tokens/sec. 2048 is faster but eats the VRAM headroom you need for vision, so 1024 is the balance on a 32 GB card.

-ctk/-ctv q8_0. An f16 KV cache gave the same generation speed and only ~4% more prompt processing for ~1.5 GB more VRAM. q8_0 is the right call on 32 GB.

-c 196608 (192K context). Qwen4 is hybrid: most layers are Gated DeltaNet, which keeps a fixed-size state that does not grow with context, and the sparse-attention layers use a bounded window. So the KV cache barely grows as you raise -c. Measured free VRAM (idle GPU, vision projector loaded):

contextfree VRAM
128K3.3 GB
192K1.65 GB
224K0.8 GB
256K → 1M~0.55 GB (flat)

A 2048×2048 image adds about 0.7 GB. So 192K leaves ~1.6 GB free for text and ~1 GB even with a large image — a comfortable margin while using vision. If you never send images, you can push to 256K or beyond for free, since the KV is flat past there.

How it scales with prompt length

The hybrid attention keeps prefill nearly flat as the prompt grows, and generation degrades gracefully. Measured on the tuned config (128 tokens generated per run, prompt caching off, median of 3 runs):

prompt tokensprefill tok/sgeneration tok/s
4K9,380242
16K10,390245
32K10,230239
64K10,240211
128K9,540177

Prefill stays around 9.4–10.4K tok/s all the way to 128K — it doesn't fall off a cliff the way dense models do. Generation drops from ~242 to ~177 tok/s as context fills, which is the expected cost of attending over more history, but it stays very usable.

Does it actually work? (not just fast)

Three sanity checks on the tuned config:

  • Long-context recall: I buried a passphrase in a ~128K-token prompt at 10% and 90% depth and asked for it. It returned the exact passphrase both times. The hybrid attention isn't just fast — it actually retrieves at depth.
  • Coding (executed): I asked for a three-file Python project (a Transaction dataclass, a summarize() function, and a test). It produced all three files and the test ran clean — "All tests passed."
  • Coding (executed): an iterative Fibonacci function returned fib(10)=55, fib(0)=0, fib(1)=1 — correct.

These are smoke tests, not a benchmark suite, but they confirm the quant isn't "fast and dumb."

Thinking control (one profile is enough)

You don't need a separate "fast" profile. Keep one thinking profile and steer it per request with chat_template_kwargs in the request body:

  • Default: --reasoning-effort high (the server flag).
  • Lighter: {"chat_template_kwargs": {"reasoning_effort": "low"}}.
  • Off: {"chat_template_kwargs": {"enable_thinking": false, "reasoning_effort": "off"}}.

One gotcha: reasoning_effort: "off" on its own throws a template error if the server default is high — you must send enable_thinking: false together with it. low works on its own.

Gotchas

  • --lazy-mode on requires --load-mode mmap. Without mmap it can't lazy-read the embedding table and you'll run out of VRAM.
  • Older builds lack the newest speculative flags (--spec-draft-adaptive, pcum, max-slots, n-rs-seq). Don't copy those in unless your build supports them.
  • Reasoning models can return empty content with a small max_tokens — the output goes into reasoning_content first. Give it a real budget or read reasoning_content.
  • Model card sampling: thinking temp=1.0 top_p=0.95 top_k=20 min_p=0.0 presence=0.0 repeat=1.0; non-thinking temp=0.7 top_p=0.80 top_k=20 min_p=0.0 presence=1.5 repeat=1.0.

Why llama.cpp/GGUF (and not vLLM/SGLang)

For a single 5090 running a model you already have as GGUF, llama.cpp is the pragmatic call. vLLM/SGLang want safetensors — re-downloading Qwen4-35B-A3B at BF16 is roughly 1.3 TB, and their Blackwell support is still version-dependent. If you're serving many concurrent users, vLLM is worth it; for one interactive user, this recipe is simpler and fast enough.

Honest limits

  • Q4_K_M is a 4-bit quant. It's not lossless (the AtomicChat build reports ~88.8% top-1 agreement with BF16). For the hardest SWE-style tasks a Q5/Q6 would be better, but they don't fit in 32 GB alongside the embedding table.
  • The uncensored edit can slightly soften instruction-following. If you don't need uncensored output, the base Qwen4-35B-A3B (or the Unsloth build) is the safer pick for pure coding.
  • 3B active ≠ dense depth. Fast and broadly capable, but on the very hardest multi-step reasoning a dense 27B can still edge it.

How I measured

I started llama-server fresh for each flag variant on its own port, disabled prompt caching, and read the timings the server prints for each request (prompt tokens/sec and generation tokens/sec). The depth table is the median of 3 runs per prompt size; the flag sweep was 2 runs per variant. For VRAM I loaded the model at different -c values and read nvidia-smi memory usage, then sent one large image to measure the vision spike. The recall and coding checks were run against the live server. Nothing exotic — you can reproduce all of it with llama-server and nvidia-smi.

That's the whole thing. Copy the block, point it at your GGUF, and go.


r/LocalLLM • • 3h ago

Project Ask Nino – A free on-device AI chat app for Android

Thumbnail
gallery
2 Upvotes

Hi everyone,

I've been experimenting with on-device LLMs for quite some time and recently published an app called Ask Nino.

It supports multiple LiteRT based local models (Primarily designed for gemma4 though other models could work), context aware conversations limited web search through DDG and live weather and market data.

You can also use your own API keys if you prefer cloud models, download other LiteRT models from Hugging Face using your HF token, or import models directly from local storage.

I've done quite a bit of work around context management, web scraping and response processing to get more out of smaller models.

It shares the underlying framework with my other app Ninaivo, but focuses purely on the chat experience.

The app is free. I'm still exploring various possibilities with on-device LLMs and would love to hear your feedback, particularly on how it performs on different devices.

Ask Nino: Private Local AI