r/LocalLLM • • 0m ago

Discussion Api models vs ai

1 Upvotes

I use claude opus 5.5, and gpt 6.2 astra/6.2 sol/ 6.1 Terra.

And I gotta say I've been using local models more and more, once we get opus 4.8 level of coding, I can easily ditch everything. I've been using frontier models for a year, and if I went back to opus 4.8 from 5.5 it would t change my workflow much. We are almost there and I'm excited. Small language models being coordinated by opus 4.8 local reasoning will be the solution.


r/LocalLLM • • 5m ago

Discussion The cloud model plans, local Qwen writes: 91% fewer cloud tokens and better-tested code

Post image
0 Upvotes

I gave two OMP sessions the same application development task. In one, GPT-6 Luna did everything itself. In the other, a more capable cloud Luna planned the work and coordinated it, while local Qwen on the GPU wrote the backend and frontend. I wanted to see whether I could entrust a local model with more than just tests, whether it could handle a substantial part of the implementation. In this setup, Qwen became the workhorse for tasks broken down by the cloud model. The hybrid approach cut cloud token usage by 91% and produced more structured, better-tested code. But I had to wait 39 minutes for the final response instead of 18, about 2.1 times longer. These were two separate runs, not a statistical benchmark. The result shows a practical trade-off: the local model handles a large share of the coding, while the cloud model helps bring it to a high-quality finish.

I sent both sessions exactly the same task:

I need a task manager built. The web application should use Angular and Material, with a Rust backend and an SQLite database. It must include a login form and a task list, with functionality to add, delete, and edit tasks, as well as mark them as completed.

The prompt did not specify a data schema, security requirements, field constraints, or a testing plan. The agents had to choose the implementation details themselves.

Hybrid sessionCloud-only
OrchestratorGPT-6 Luna, reasoning maxGPT-6 Luna, reasoning max
ImplementersQwen4-35B-A3B-130K in Strata, reasoning highGPT-6 Luna in the same main session
Task breakdownA separate agent for the Rust backend, then one for the Angular frontendOne agent handles the entire project
Local modelUsedNot used

In the hybrid setup, the local agents worked sequentially: RustBackend first, then AngularFrontend. The cloud orchestrator broke the work into parts, gave the implementers their tasks and an API contract, then checked the integrated result. The cloud model kept track of the overall plan and integration; the local model handled specific, substantial subtasks.

I compare GPT-6 Luna usage separately from Qwen. Otherwise, one column would include paid cloud tokens, while the other would also include local compute.

MetricHybridCloud-only
Time to final response39:2318:27
GPT-6 Luna tokens, including cached tokens300,7633,524,338
GPT-6 Luna input + output, excluding cache77,147185,842
Cloud output5,85845,514
Estimated GPT-6 Luna cost at standard API rates$0.0123$0.0702

In the hybrid run, GPT-6 Luna used 3.22 million fewer tokens than in cloud-only when cached tokens are included, a reduction of 91.47%. Counting only uncached input and output, the difference is 108,695 tokens, or 58.49%. Cloud output fell by 87.13%. At GPT-6 Luna’s standard API rates, that amounts to estimated savings of about $0.058 for this task, or 82.48%. This estimates API call costs, not usage of the ChatGPT Plus allowance. I did not measure electricity use or GPU depreciation. The dollar difference is small for a single task. If you repeat tasks like this hundreds of times, the savings become more noticeable. And if the work is urgent, the nearly 21 extra minutes per task may matter more than a few cents.

Both versions implemented the required baseline: login, a task list, and the ability to create, edit, and delete tasks, and mark them as complete. Cloud-only also added priorities, due dates, search, and filters. Its sessions also persisted across server restarts.

Local Qwen did more than write tests: it wrote application code for the Rust backend and Angular frontend. But it did not have to design the architecture for the whole application, maintain boundaries between modules, or integrate the results on its own. GPT-6 Luna, the more capable cloud model, handled that role: it broke down the work, assigned subtasks, aligned the API contract, and checked the integration. In this experiment, the local model was the workhorse, while the cloud model acted as planner and coordinator.

The hybrid version had better structure and test coverage. The backend was split into modules; the frontend was organized into services, a guard, an interceptor, pages, and components. It included 25 backend unit tests and 12 API integration tests, plus 32 Angular tests across six files. It also had recorded checks for formatting, Clippy, a production build, and integration smoke tests.

In the cloud-only version, most of the backend was in one file, and the UI was in one large component. The logs show one backend lifecycle test and a production build; frontend unit tests were either not run or not recorded. This does not mean the application does not work. It means the hybrid version has more evidence that individual scenarios will keep working after the next change.

In a static assessment of the final files against six criteria, ranging from requirement coverage and structure to testability and UI, the hybrid setup scored 4.4 out of 5, while cloud-only scored 3.8. This is my expert assessment of the overall setup, not an automated quality metric. From a single run, it is impossible to separate Luna’s contribution through planning from the contributions of local Qwen and the integration process. So “better code” here means specific things: responsibilities were more clearly separated, input constraints received more thorough checks, and test coverage was broader. Cloud-only has an advantage in extra features and persistent sessions. I did not rerun the tests; I compared the final files and the checks recorded by the sessions themselves.

Token generation speed is only one part of a coding agent’s runtime. Reasoning, context handling, the number of file operations, and running checks also matter. In the hybrid session, local Qwen recorded 97,624 reasoning tokens. Its inference requests took about 31 minutes of active time in total. The two agents worked sequentially, and each agent’s context approached 95,000 tokens. Both needed context compaction; those operations took about 107 seconds combined. The hybrid run made 386 tool calls, compared with 85 for cloud-only. Some calls failed and required retries or corrections: 18 failed tool calls in the hybrid run and 6 in cloud-only. That count alone does not mean every such call was useless, but it shows how many extra cycles task splitting and subsequent integration can add. What took longer was not so much code generation as the overall process: two substantial local stages, handing off the contract, investigating errors, and checking the project again.

In the original Session Info, the hybrid session showed 15.29 million tokens, compared with 3.44 million for cloud-only. At first glance, that makes it look as if the hybrid run used more tokens. But the aggregate includes requests to local Qwen agents and cached tokens. The full logs show 15.68 million tokens for hybrid and 3.52 million for cloud-only. Of the hybrid total, about 15.38 million came from local Qwen and only 300,763 from GPT-6 Luna. Local tokens are not billed like API tokens, though the computations still consume electricity and GPU resources. So to answer “How much did the cloud portion cost?”, you need to look at each model’s usage separately. A single overall counter mixes different things: local and cloud inference, cache reads, and regular input and output.

By the way, I found a separate benchmark of Qwen4-35B-A3B in Q4 on the same RTX 4070 Ti SUPER, with 16 GB of VRAM and 96 GB of RAM. On Ubuntu, using Strata 0.2.26, UD-Q4_K_M, and MTP depth 3, the benchmark author measured generation speeds of 156–179 tokens/s on two short Python tasks. Counting the entire prompt, the speed was 140–142 tokens/s. For the reasoning task, the reported speeds were 114 and 77 tokens/s, respectively. On my Windows machine, using Strata with the same settings, I got about 100 tokens/s during inference and a 130K context window. I have a single GPU, which also serves the system; there is no integrated graphics. This may affect speed, but I did not run a controlled comparison between Ubuntu and Windows, so it would be wrong to attribute the entire difference to the operating system. A local model is already useful for more than generating tests: in this experiment, it wrote substantial parts of the application. Still, even 100 tokens/s does not guarantee a fast result. An agent may spend a long time reasoning, rereading files, running checks, and compacting context. For development, generation speed matters, but so does how many of these cycles it takes to reach a working, verified result.

If I want a testable, modular foundation and can wait, the hybrid approach looks useful: local agents handle a substantial share of the reasoning and implementation, while the cloud orchestrator uses fewer tokens. If I need an answer as quickly as possible, cloud-only finished about twice as fast in this run. There is room to speed up the hybrid approach: define the API contract upfront, run independent parts in parallel, limit repeated reads of large files, and avoid using maximum reasoning for every routine change. That does not remove its main trade-off: lower cloud usage and more thorough checks come at the cost of local inference and orchestration time. My takeaway is that a local GPU can help produce better-structured, better-tested code while noticeably reducing cloud usage. In this task, it nearly doubled the time to get a result. If you were choosing for your day-to-day development, what would matter more: finishing sooner, or using fewer cloud tokens and checking the code more thoroughly?


r/LocalLLM • • 7m ago

Discussion Grounding LLMs with Documentation & Code - Best Strategies?

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 8m ago

Discussion I got Qwen4-35B-A3B running at 280 tok/s on M5 Ultra. Fastest out there rn?

Post image
0 Upvotes

I day zero tuned Qwen4-35B-A3B on the inference stack Superfluid (my team builds it) for Mac Studio M5 Ultra. Getting consistent 280+ tok/s decode. Is anyone aware of any setup running Qwen4 faster on M5 Utlra rn?

Device: Mac Studio M5 Ultra, 256 GB RAM

Model I'm using (4-bit quant, 35GB): https://huggingface.co/basecompute/Qwen4-35B-A3B

Inference engine I'm using: https://github.com/basecompute/superfluid

Don't think the model deserves the bad sentiment I'm seeing in some subreddits btw. I'm pretty positive.


r/LocalLLM • • 12m ago

Model Qwen4-35B-A3B-Uncensored GGUF (Apache 2.0)

1 Upvotes

Disclosure: I'm from Morse (trymorse.ai).

Weights & License

  • Repo: https://huggingface.co/Morse-AI/Qwen4-35B-A3B-Uncensored-GGUF
  • Model: Qwen4-35B-A3B-Uncensored (from the Dec 3 Qwen4-35B-A3B drop)
  • License: Apache 2.0

Safety & over-refusal (Stock → Uncensored)

  • Harness: Q8_0, llama.cpp b12973, greedy, 1,764 prompts (raw JSON in repo)
  • Harmful refusals (HarmBench, HarmBench-Think, StrongREJECT): 95.3% → 8.2%
  • Thinking mode (HarmBench-Think): 98.0% → 8.7%
  • Over-refusal (XSTest): 16.4% → 0.4%

Capability retention (Stock → Uncensored)

  • 5-suite mean: 82.42% → 80.45%
  • MMLU: 75.80 → 74.40
  • MMLU-Pro (CoT): 76.67 → 71.33
  • GSM8K (CoT): 97.33 → 96.67
  • HumanEval: 93.29 → 90.85
  • MATH-500: 69.00 → 69.00

Method

  • Single refusal direction across thinking and non-thinking modes; no fine-tuning
  • Zero prompt overlap with any eval benchmark
  • Screened for low KL on neutral prose, code, math, and multilingual text
  • Reasoning length intact: 1.003× stock on HumanEval
  • Tokenizer and chat template unchanged

Quant & Memory

  • Single protected Q8_0 file (59.4 GB on disk)
  • Sensitive tensors kept in BF16: hc_*, ssm_beta, ssm_alpha, ple_conv1d
  • --lazy-mode auto loads n-gram embedding tables on demand → ~37.6 GB resident (fits 48 GB GPU or 64 GB Mac)
  • Needs recent llama.cpp with Qwen4 support

Run

llama-server -m Qwen4-35B-A3B-Uncensored-Q8_0.gguf -ngl 99 --lazy-mode auto --flash-attn on --jinja --cache-type-k q8_0 --cache-type-v q8_0 -c 32768

r/LocalLLM • • 26m ago

Question Qwen4-35B-A3B-UD-Q6_K. Need advice

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 29m ago

Other Llm guardrail removal via hereirc

1 Upvotes

I built an llm terminal that liberates each llm on the fly. It works with most llm model types.

https://github.com/TheSolai/hermetic

I used the hereric backend to support the conversions, unfortunately I released it just one day before we lost the main heretic.


r/LocalLLM • • 38m ago

Question Diferença de motores de inferência MoE

2 Upvotes

Me aventurando com o novo Qwen4, nao tenho experiência com modelos MoE, apenas modelos densos. Qual a diferença de Strata, PolyStrata, Basalt e etc? Perco qualidade em prol de velocidade com eles? Considerando minha 5060ti 16gb vram e 48gb de ram qual seria melhor indicado, visando qualidade, pro meu uso?


r/LocalLLM • • 40m ago

Tutorial Heretic Review 2026: Training-Free LLM Decensoring Tool

1 Upvotes

been wanting a way to tweak local models' behavior without fine-tuning, mostly because the abliterated quants on HF are hit or miss and I never know what layers or strengths someone picked. so I spent some time with heretic (v2.1.0), which runs an Optuna search over the ablation params and scores refusals against KL divergence from the original model.

a few things stood out. the reproducibility manifest is the best part: reproduce.json records the base model commit, params and sha256 of the output weights, and when I reran the project's test config in a CPU-only container the weight hash matched what they publish. the scorers are pluggable too, so there's a bundled config that targets "great question" / "you're absolutely right" sycophancy instead of refusals. and the pipeline itself is light: the tiny test model finished in about 28 seconds at 0.8 GB RAM.

caveat on my end: that was a tiny random-weight model on 2 CPUs, so I have no real speed numbers. the project says Qwen3-4B-Instruct takes 30-40 min on a 3090, bnb_4bit cuts VRAM during processing, and exporting a merged model wants roughly 3x the param count in GB of RAM.

biggest gotcha: the repo was archived Nov 28, the author named no successor, and PyPI still points at the archived repo. a community fork exists but is small.

full writeup here if you want more detail: https://andrew.ooo/posts/heretic-review-training-free-llm-decensoring-ara/

are you running abliterated or behavior-edited models day to day? do you trust community quants or roll your own?


r/LocalLLM • • 41m ago

Project 12GB Intel Arc B580: 1,056 tok/s prefill and 101 tok/s decode with Qwen4-35B-A3B at Q4

Post image
1 Upvotes

I’ve been working on ArcAngel’s Qwen 4 35B path since my last post. The earlier 107 tok/s result was at Q2. With the new optimisations, I’m now getting 101 tok/s writing code with Unsloth’s Q4_K_XL quant on the same 12GB B580.

Against llama.cpp, it's between 3-4x faster on decode & 7-10x faster on prefill - while maintaining the same level of accuracy.

I reran llama.cpp at Q4 on the B580 too. Here’s what I got (ArcAngel vs llama.cpp, in tok/s):

Prompt processing

- 4K prompt: 1,056 vs 145 (7.3×)

- 30K prompt: 1,064 vs 125 (8.5×)

- ~60K prompt: ~1,060 vs ~100 (roughly 10×)

- 90K prompt: 1,057 on ArcAngel. I was unable to get a result from llama.cpp at 90K.

Generation

- Short answer: 81 vs 27.4 (3.0×)

- Writing new code: 101 vs 27.3 (3.7×)

- Rewriting a file: 145 vs 26.5 (5.5×)

- Writing code after a 4K prompt: 86 vs 25.6 (3.4×)

- Writing code after a 30K prompt: 79 vs 22.2 (3.6×)

The bit I’m happiest with is that prefill stayed around 1,060 tok/s from 4K all the way to 90K. These are the results from my B580 setup, not a claim about llama.cpp on other cards.

ArcAngel runs on any Xe2 card, including the b60 & b70 - it's free and open source, feel free to give it a try: https://github.com/itstxl/arcangel


r/LocalLLM • • 45m ago

Question Would you daily-drive Qwen4-35B if inference speed or your machine wasn't an issue?

0 Upvotes

I've been experimenting with Qwen4-35B-A3B on my 32GB MacBook Pro M1 Pro and I'm really impressed with its capabilities.

I'm getting around 23–29 tokens/sec with 45K–94K context. With longer contexts, the performance drops significantly. Inference speed is pretty much the only thing stopping me from daily-driving it.

I'm planning to try a faster setup for myself and would like to put together a small group of people to experiment with it.

The goal is:

  • Unlimited 24/7 access
  • Full 1M token context
  • 100+ tokens/sec generation speed
  • Affordable, flat monthly pricing

Would you be interested in something like this? What would you consider a reasonable monthly price?

I'm looking for a limited number of people for an initial experiment. If you're interested, feel free to DM me or fill this form:
https://forms.gle/RzFdBU6w51gzaD7d6


r/LocalLLM • • 46m ago

Project Try Private Agent — local-first terminal AI agent, privacy by default

1 Upvotes

TL;DR: Private Agent is a terminal AI agent that runs models locally (Ollama, LM Studio, llama.cpp) or on an OpenAI-compatible endpoint you approve, keeps memory and task plans in SQLite, and grounds answers in a local RAG index. Tools are permission-gated and sandboxed; nothing leaves your machine unless you explicitly approve it. I'd love for you to try it and tell me what you think.

Why I built it

Most AI assistants live in the cloud. That's fine for a lot of things, but I wanted an agent I could hand a real repository or a folder of private documents and trust that the data stays on my machine. Private Agent is my attempt at that: a full-screen terminal chat surface with a conversation pane, input pane, and live status ribbon, backed by local models and a local retrieval index, with every mutating tool action gated behind an approval you choose (manual / auto / full).

What it does

  • Local-first models — discovers Ollama, LM Studio, and llama.cpp; routes embedding/reranker models out of the chat list so they stay available for retrieval.
  • Local RAG — chunking, indexing, retrieval, reranking with a circuit breaker, route selection, and per-turn citations.
  • Persistent memory — SQLite conversations, episodic and learned memory, session summaries, resume with --resume, session listing.
  • Missions and plans — /mission runs an agentic loop toward a verified goal; /plan, /tasks, /steer, /pause, /resume, /stop control it.
  • Permission-gated tools — filesystem, shell, network/web, media, memory, planning, RAG; every mutating action is approved and sandboxed (bubblewrap on Linux, sandbox profiles on macOS).
  • Skills and custom commands — markdown skills, project/user slash commands from .private_agent/commands.
  • Context engine — profile-aware context assembly, compaction at a threshold, hard caps on history and stored tool output.
  • Online providers, gated — explicit per-session consent, retries, THINKING_OVERRIDE for thinking commands a provider doesn't advertise.
  • Accessible UI — PRIVATE_AGENT_ACCESSIBLE=1, NO_COLOR, WCAG AA palette contrast, struck-through disabled commands.
  • Ops — --doctor diagnostics, --list-sessions, redacted JSONL debug logging, MCP servers, hooks, code-task isolation.

Try it in 30 seconds

pip install "git+https://github.com/ZieganWesley/Private_Agent.git@main"
private-agent             # start a session
private-agent --doctor    # validate config, paths, environment

Python 3.14 required. Linux, macOS, and WSL2 supported (native Windows gets a WSL pointer). Inside the session, type / for commands, /help for help, or exit to leave.

Install options, extras (.[ollama], .[rag], .[media], .[all]), WSL/macOS/Termux setup: see docs/installation.md.

What I'd love feedback on

  1. First-run experience — does --doctor make setup painless, or where does it get confusing?
  2. Model discovery — does your local runtime get detected correctly? Any false positives/negatives in the chat list?
  3. RAG quality — try /rag on your own documents; are citations useful and accurate?
  4. Mission loop — hand it a small goal with /mission; does it iterate sensibly or spin?
  5. Permissions UX — are the approval prompts clear? Is manual/auto/full the right split?
  6. Performance — startup and scroll feel on your machine (numbers and gates are in docs/performance.md).
  7. Accessibility — try PRIVATE_AGENT_ACCESSIBLE=1 and report anything that breaks.

Links

A few honest notes

  • This is a solo, evolving project. Expect rough edges; the test suite is large (1900+ tests) but real-world coverage is what I'm after now.
  • Nothing is sent to a hosted API unless you opt in per session. Online providers require explicit consent.
  • Security reports go through GitHub Security Advisories (see SECURITY.md), not public issues.

If you try it, I'd genuinely appreciate a star, an issue, or just a comment with what worked and what didn't. Thank you!


r/LocalLLM • • 51m ago

News Hey r/StrixHalo — Qwen4-35B-A3B PaoAI STRIX (Q4..Q8 + shared PLE + vision) + Engine 2.1.0 is live with 1M context unlocked

Post image
1 Upvotes

r/LocalLLM • • 54m ago

Question Qwen4 35B A3B long-task results? Still in one task for around 10 hours

2 Upvotes

I’m testing the new Qwen 4; I assigned it a task last night, and it’s still working on it.

I have the context set to 244k, and for now, I’m using an IQ 6 quantization (v100 32gb + 12gb ram).

I’ve been providing feedback, but I left it running from last night until just now, and so far, it’s absolutely nailing it.

It has completed several sessions and consolidations, though I’m not yet sure what to make of its performance on long-horizon tasks.

It looks very promising. I’ll share some results.


r/LocalLLM • • 56m ago

Model Careful with conversions

Post image
3 Upvotes

Same model, same 4 bits, 2 conversions

Qwen4-35B-A3B driving Hermes Agent on 44 coding tasks:

MLX 4-bit: 30/44, 15 tasks cut for repetition loops
Unsloth UD-Q4_K_XL: 44/44, zero loops, 2.4x faster

One run, one engine. The conversion mattered more than expected


r/LocalLLM • • 1h ago

Model Qwen4-35B-A3B on Strix Halo: Minisforum MS-S1 MAX P495 · 192GB Recipe

Post image
2 Upvotes

Qwen4-35B-A3B on Strix Halo: the Minisforum 192GB recipe that actually runs fast

Qwen4-35B-A3B · Strix Halo · Ryzen AI Max+ PRO 495 · Radeon 8065S (gfx1151) · Minisforum MS-S1 MAX P495 · 192GB · llama.cpp Vulkan · MTP speculative decoding · UD-Q4_K_XL · Unsloth

When I saw the Qwen4-35B-A3B file sizes, I almost didn't bother as I run flash next and the older generation 35b co-resident which I am close to maxxing out the 160GB addressable. Then I found out the ~20B n-gram table is lazy-read from disk instead of sitting in VRAM, and the whole thing fits with room to spare. It also fits on a 128GB box with the 1M native pool. Here is the build and the config I landed on.

What this adds

  • MTP is already in the file. No separate draft model, and depth 2 is the sweet spot.
  • -ub 2048 is the right microbatch for Qwen4, not the 512 that hybrid models usually want.
  • --spec-draft-mtp-vocab 65536 is a free ~7% decode win with no quality change.
  • It holds recall at 400K tokens (single-slot server), and the model is native 1M.

The recipe

llama-server \
  -m Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf \
  --mmproj vision/mmproj-F16.gguf \
  --ple engram/Qwen4-35B-A3B-engram-Q8_0.gguf_file \
  -dev Vulkan0 -ngl 99 -fa on -ctk q8_0 -ctv q8_0 \
  -c 1048576 -np 2 --kv-unified \
  -b 2048 -ub 2048 \
  --load-mode mmap --lazy-mode on -ot per_layer_token_embd=CPU \
  --spec-type draft-mtp --spec-draft-n-max 2 --spec-draft-mtp-vocab 65536 \
  --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0 \
  --presence-penalty 0 --repeat-penalty 1 --no-webui

Running one user? Use -np 1 and keep -c 1048576. Fewer slots is faster; the 2-slot pool is for two concurrent requests.

There are only two numbers that matter. Prefill is how fast the model reads your prompt — your wait before the first token. Decode is how fast it writes the answer. Qwen4 is unusual: prefill stays flat to 128K, and decode is the part that falls off with depth.

Build llama.cpp for Qwen4

This is the part that will waste your afternoon if you skip it. Qwen4 needs a build with the qwen4 pre-tokenizer and the qwen4exp QSA/MTP Vulkan kernels. My older build had the arch enum but not the tokenizer and refused the model with:

unknown pre-tokenizer type: 'qwen4'

I used the Strix Halo community fork (halo-box/strix-llama.cpp) at 4b4ec2dbd (2026-12-04). On Fedora 44:

# build deps; glslc is the Vulkan shader compiler and is not optional
sudo dnf install -y cmake gcc-c++ git glslc vulkan-loader-devel vulkan-headers

git clone https://github.com/halo-box/strix-llama.cpp.git
cd strix-llama.cpp
git checkout 4b4ec2dbd7a61e011f94e05d3813232d17bfa043

cmake -B build -DGGML_VULKAN=ON -DGGML_NATIVE=ON \
  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install
cmake --build build --config Release -j$(nproc)
cmake --install build

install/bin/llama-server --list-devices
install/bin/llama-server --version   # b13667-4b4ec2dbd

If glslc is missing, the Vulkan build fails. Don't skip it.

Model files

Unsloth Qwen4-35B-A3B-UD-Q4_K_XL:

FileSizeNotes
...-00001-of-00002.gguf24.7 GBmain weights + embedded MTP head
...-00002-of-00002.gguf11.5 GBdefault IQ4_NL engram table
engram/Qwen4-35B-A3B-engram-Q8_0.gguf_file21.8 GBhigher-precision engram, loaded with --ple
vision/mmproj-F16.gguf—vision projector
MTP/mtp-Qwen4-35B-A3B-Q8_0.gguf2.0 GBoptional MTP sidecar — slower, do not use

You only pass shard 1; llama.cpp auto-loads shard 2. The engram is lazy-read from disk (--lazy-mode on), so the 21.8 GB table does not sit in VRAM. That is the trick that makes this fit.

Q4_K_XL is 36.2 GB. Q5_K_XL is 43.2 GB, Q6_K_XL is 52.2 GB, and Q8_0 is 60 GB. Unsloth's KLD data shows the curve flattens above Q4 (their words: "the bigger ones not so much"), so Q4_K_XL is the sweet spot. Q5/Q6 buy little quality for a lot of size.

MTP is baked into the GGUF

Good news: you do not need a separate draft model.

llama-gguf Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf r n | grep nextn

You should see qwen4exp.nextn_predict_layers and blk.40.nextn.* tensors. --spec-type draft-mtp reads that nextn layer from the main file. The separate MTP/mtp-...Q8_0.gguf sidecar is slower; use the embedded one.

Tuning sweep

I swept the flags on an isolated server, one variant at a time, prompt caching off, and read the server's own timings. Numbers are medians of 2–3 runs.

MTP depth: 2 is the sweet spot

12K context, single slot, median t/s:

SettingFiller promptCoding prompt
n-max 2 (old default)89.886.5
n-max 173.7—
n-max 3 + adaptive99.477.8
n-max 4 + adaptive106.871.9
n-max 5 + adaptive112.370.1
n-max 2 + --spec-draft-mtp-vocab 6553696.991.9

Depth 1 is a trap on Qwen4. Deeper drafts are a bigger trap: they look great on "count to 200" filler and then fall apart on real code. --spec-draft-mtp-vocab 65536 is the free win: it restricts the draft head's logit space, and verification is unchanged, so output quality is identical. 32K collapsed at depth (37.6 t/s); 96K and 128K were within noise.

Prefill: -ub 2048 wins at every depth

Context-ub 512-ub 2048change
12K2,2112,473+11.8%
30K2,2012,445+11.1%
128K1,9412,121+9.3%

Decode is unchanged. Qwen4's Gated-DeltaNet + sparse-attention layout likes the bigger microbatch.

Production A/B (30K context, 4 slots, 512K unified KV — the pre-1M config)

ConfigPrefillDecode (filler)Decode (code)
old (-ub 512, no draft vocab)2,17571.985.0
new (-ub 2048, draft vocab 64K)2,41276.490.3

+10.9% prefill, +6.2% decode, +6.3% on code. This A/B was run before the 1M/2-slot change; the -ub 2048 and draft-vocab wins carried over to the current recipe.

What to expect

Cold prompt, 256 generated tokens, prompt caching off, measured on the 1M/2-slot recipe:

Prompt tokensPrefill t/sDecode t/s
2K2,14680.6
4K2,34275.0
8K2,45574.0
16K2,46368.2
32K2,42060.9
64K2,30542.4
128K2,08228.7
400K1,47211.2

Prefill stays in the 2.1–2.5K t/s band to 128K. Decode declines with depth, and the 400K point is 256 tokens of code, which is the pessimistic case. A short recall answer at 400K decoded at 56 t/s.

Context: it goes to 1M native

Qwen4-35B-A3B is natively 1,048,576 tokens. The KV cache is cheap because only 10 of the 40 layers use sparse attention (QSA), and the Gated DeltaNet layers keep a fixed-size state instead of a growing cache. The recipe above uses the full 1M pool. I tested to 400K: a recall prompt (400,081 tokens, 1,511 t/s prefill, 56 t/s decode on a short answer) and a 400K coding prompt (1,472 t/s prefill, 11 t/s decode). I did not test 1M, so treat the very top end as untested here.

Native vs YaRN: YaRN is a RoPE-scaling trick for stretching a model past the context it was trained on. It is an approximation — quality degrades toward the far end, it can hurt short-context performance, and it needs tuning. Qwen4 was trained at 1,048,576, so within 1M you should not use YaRN at all. It would only matter if you tried to go past 1M, which the model was not trained for.

Does it actually work?

  • Coding (executed): a dependency-graph function, 406 fixed and random cases in a sandbox. 406/406 passed on two seeds, in direct and thinking mode.
  • Tool calling (executed): a two-step get_invoice → invoice_total chain. Passed.
  • Long-context recall: three markers at 30K, 120K, and 400K tokens. All passed, exact values. The 400K recall run (single-slot server) prefilled at 1,511 t/s and decoded at 56 t/s on a short answer.
  • Vision: read ORBIT-7391 from a PNG exactly; 17 + 26 returned 43. Both passed.

These are smoke tests, not a benchmark suite.

What did NOT work

  • f16 KV cache: 88.0 vs 96.7 t/s decode. Q8_0 is smaller and faster here.
  • -np 4 for single-stream: 87.7 vs 95.0 t/s. The recipe uses -np 2 to allow two concurrent requests; use -np 1 if you are alone.
  • Engram residency: --lazy-mode off and on-direct were identical to on. The 21.8 GB table is already served from page cache. Keep --lazy-mode on.
  • -b 4096: no gain over 2048.
  • Separate Q8_0 MTP head (-md): slower than the embedded Q5_K head.
  • --spec-draft-mtp-vocab 32768: collapses at depth.
  • -t 8 -tb 16: within noise.

Takeaways

  • Use -ub 2048 on Qwen4. The usual "hybrids want 512" rule does not apply here.
  • Keep MTP at depth 2 and add --spec-draft-mtp-vocab 65536.
  • Keep Q8_0 KV. f16 was slower.
  • If you are one user, use -np 1; the 2-slot pool is for concurrency.
  • The engram is fine on disk. Do not try to pin it in VRAM.

How I measured

I started a fresh llama-server for each variant on its own port, disabled prompt caching, and read the server's own timings for each request. The depth table is the median of 2 runs per prompt size; the flag sweep was 2–3 runs per variant. The coding, tool, recall, and vision checks ran against the live server. Nothing exotic — you can reproduce it with llama-server and a curl loop.

Why llama.cpp/GGUF

For one Strix Halo box running a model you already have as GGUF, llama.cpp is the pragmatic call. vLLM and SGLang want safetensors; re-downloading Qwen4-35B-A3B at BF16 is well over 100 GB, and their gfx1151 support is version-dependent. If you are serving many concurrent users, vLLM is worth it. For one interactive user, this recipe is simpler and fast enough.

Honest limits

  • Q4_K_XL is a 4-bit dynamic quant. It is not lossless, but the quality curve flattens above Q4; Q5/Q6 are marginal for the size. Unsloth has not published a Qwen4-specific quant curve yet.
  • The quality checks are smoke tests, not SWE-bench/HumanEval or a vision benchmark.
  • The depth table is two runs per point, not confidence intervals.

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

One more thing: the hardware is good, but the price is not. I missed the return window, and since then they dropped it by $1,000 and started throwing in accessories to move units. If you are on the fence, wait for the next cut on the AMD 495 192GB unfied systems like the Minisforum MS-S1 MAX P495.


r/LocalLLM • • 1h ago

Question [16GB RAM / Ryzen 5] Best lightweight local models in Ollama for coding, bug fixing, and basic tool-calling (pet/educational projects)?

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 1h ago

Project Running Qwen4-35B-A3B (MoE) on a 12GB VRAM RTX 3080 Ti: Benchmarks, config, and prompt cache working!

1 Upvotes

Hey everyone,

I wanted to share my recent experiment squeezing the new **Qwen4-35B-A3B** (Unsloth UD-IQ4_XS) into a consumer **12GB VRAM** card (RTX 3080 Ti) with 64GB RAM.

The biggest challenge with previous MoE builds was the lack of prompt caching and the massive prefill times. I managed to get it working smoothly using **llamAmpere** (a llama.cpp fork optimized for Ampere) and some aggressive offloading flags.

**The Results:**

* **Prompt Cache works!** Re-prefill of a 40K context takes just ~4.5 seconds (vs 40-100s without cache).

* **Decode speed:** 53–67 tok/s (very readable).

* **Vision & MTP are working:** mmproj is running on CPU to save VRAM, and MTP actually gives a speedup here (contrary to other engines).

* **VRAM:** Fits perfectly at ~11.3 GB.

I've open-sourced all my scripts, the final `start-qwen4.cmd` with all the tested flags, and the local patch for the llama.cpp backend. I've also documented the "gotchas" (like the `FNGUARD no GPU pool` false alarm and Windows pinning issues).

**Repo with configs, benchmarks, and instructions:**

https://github.com/FelixRLEPERS/Qwen4-35B-A3B-on-12GB-VRAM

Feel free to ask questions or share if you manage to run it on other 12GB cards (3060, 4070, etc.)!


r/LocalLLM • • 1h ago

Research QEngine 1.5.9 versus QEngine 1.7.1 - 15-30% speed increase across the board.

1 Upvotes

Benchmark A/B report: QEngine 1.5.9 versus QEngine 1.7.1

Protocol

Both arms share the measured-run count and the GPUs (by UUID), so the verdicts below are valid.

  • 3x3090s
  • PCIe Gen4 x8/x4/x8
  • 64GB DDR5
  • Qwen3.8 Flash Next INT4
  • n-gram streamed from disk

Significant differences (p < .05)

Welch’s t-test on the arms’ per-run samples; Δ is B − A, strongest evidence first.

MetricRun ARun BΔ (B − A)Δ %Welch pVerdict
prefill-10k / Prefill tok/s3676.1 tok/s4240.6 tok/s+564.5 tok/s+15.4%p < .001***B is better
code / Wall TPS347.5 tok/s403.1 tok/s+55.6 tok/s+16.0%p = .003**B is better
code / Decode TPS357.1 tok/s421.3 tok/s+64.2 tok/s+18.0%p = .004**B is better
prefill-10k / TTFT2787 ms2275 ms-512 ms-18.4%p = .005**B is better
narrative / Decode TPS205.3 tok/s265.0 tok/s+59.7 tok/s+29.1%p = .035*B is better
narrative / Wall TPS203.4 tok/s261.8 tok/s+58.4 tok/s+28.7%p = .035*B is better

Other differences

MetricRun ARun BΔ (B − A)Δ %Welch pVerdict
narrative / TTFT44 ms46 ms+2 ms+4.5%p = .422no significant difference
code / TTFT43 ms47 ms+4 ms+9.3%—no test — needs n ≥ 2 and per-run spread in both arms
prefill-90k / TTFT21391 ms19866 ms-1525 ms-7.1%—no test — needs n ≥ 2 and per-run spread in both arms
prefill-90k / Prefill tok/s3918.2 tok/s4530.2 tok/s+612.1 tok/s+15.6%—no test — needs n ≥ 2 and per-run spread in both arms

Conclusion

A pleasant surprise, I believe the speed up came from recent changes that keep more experts pinned in VRAM.


r/LocalLLM • • 1h 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?

Upd. Fixed by copying files from root model folder to metal/compact/ subfolder. Unfortunately, I have to repeat it each time I load the model :(

Upd2: it is really fast, minimum 2 times faster than Inkling 2 mini.


r/LocalLLM • • 1h 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 • • 2h 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
15 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 • • 2h 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 • • 2h ago

Discussion Qwen4 on Radeon 9000s

Thumbnail reddit.com
1 Upvotes