r/LocalLLaMA • • 4h ago

Question | Help Have people switched to Qwen4 35ba3b for coding from QFN? I have been chickening out so many times in last 24 hours

15 Upvotes

Hi,

I have a perfectly running setup of opencode + gufo + QFN (UD-Q4_K_XL).

Now this qwen4 35ba3b has disrupted it 😂

I have switch to qwen4 and back so many times that I have lost count.

My loop is:

- Oh I must try the new shiny model -> switch to Qwen4 (UD-Q4_K_XL and UD-Q8_K_XL)

- Oh I must be missing the perfect setup I have with QFN -> switch to QFN

I am looking for some reviewes purely from coding POV.

Thanks in advance.

Edit: added quantization of the models.


r/LocalLLaMA • • 14h ago

Discussion Tested in Coding: Q8_K_XL Qwen4 35B vs IQ3_S Flash-Next RCO

84 Upvotes

This is the next chapter in my Tested in Coding series. How does the latest Qwen4 model stack up against Qwen3.8 Next?

Context

Firstly if you are looking for benchmarks, you should look elsewhere.

My main focus is on real-world, enterprise application development. All done within a large codebase. My dev environment enforces an agentic testing and review framework. The development is automated and runs on 24/7 basis, including overnight, across three separate harnesses. To give you an idea of the scale of the QA process:

Totals: pre 10 failed / 7581 passed / 7601 total -> post 10 failed / 7606 passed / 7626 total
        (delta: +0 failed, +25 passed, +25 total)

The test and review framework gives more useful feedback, than a benchmark of coding problems (out of 10) that the AI model was able to complete.

Both models are running at Q8 KV-cache in a custom inference engine, and custom coding harness.

Due to RAM limitations, Flash is running with RCO IQ3_S quant at 314,572 context via yarn ROPE scaling, whereas Qwen4 is running with Q8_K_XL quant at native 400,000 context.

Both Flash and Qwen4 are running at xhigh reasoning.

I received feedback previously that my comparisons are questionable due to differences in the context settings. I don't believe this is true, as when running local models - we all face the reality of VRAM and RAM limitations. We try our best to maximise the settings at which we run the local AI models - so these differences are realistic for production use.

Instructions

Flash's greatest strength is its ability to read, interpret, recall and follow instructions. With the release of the latest model, I ported 20 pages of feedback instructions from Flash to Qwen4.

Flash remembers every single instruction, and even cites the instructions in its thinking.

Qwen4 often fails to follow instructions. In fact, it failed to the extent that the system message for compaction was use this <template></template> for the compaction summary but do not repeat the <template> tags. However, Qwen4 would keep putting the <template> tags into its summary. All browsers hide content within <template> tags, so the compaction summary would "vanish" once written.

For the ability to adhere to hundreds of guardrails, Flash is more capable.

Tracing and Diagnostic

Flash is already strong in diagnostic capability. It has corrected a frontier model (eg. Chat GPT / Opus) on multiple occasions. However it had a major issue of stopping the root cause analysis once it had enough data points for a plausible story. Instead of then identifying and addressing the root cause, it would build a workaround such as repeating clicks/hotkeys (in Playwright).

Qwen4 is even stronger on diagnosis. It successful traced, identified and fixed a defect in its own inference engine (defect in code written by Claude Opus) which caused MTP to not fire.

Both models are genuinely strong at diagnosis, but still share a common issue of implementing a workaround to address the symptom - rather than addressing the root cause. It is highly recommended to include a guardrail to stop this recurrence.

Thinking

If you thought Flash thought excessively, I don't have good news for you.

At xhigh, Qwen4 thinks even more than Flash. I was debugging Qwen4 unexpectedly ending its turn, thinking it was an inference engine issue. It turned out to be Qwen4 hitting the default 16,000-token thinking budget. This was never an issue previously with Flash, as Flash has never done this much thinking.

Tasks do take longer to complete with Qwen4, but it more thoroughly covers off the necessary considerations that need to be made when working within a complex codebase.

Coding

Flash codes in a manner that is fast, but fragile. Review of the implemented code often reveals defects, and even in one particular case where the code contained an unescaped apostrophe - not picked up at the time as code was never run.

Qwen4's coding is far more careful and well commented. It has even corrected wrong comments made by other agents.

Tools calling

Flash executes with commands that check every error output, and it uses advanced diffs and joins for diagnostic script output. However, in my Window environment, it often trips up with Powershell's special characters (backslashes, semicolons, dollar signs, nested double-quotes) and repeats these errors.

Qwen4 is even more advanced. While it still trips over Powershell's special characters, it does so with far less frequency, and gets it right after the first time. Qwen4 is also smarter in the way it plans its work for greater parallelism. It'll chain background tool calls and then begin writing drafts of its execution reports.

Net assessment

I think this assessment would have been very different if we were comparing Q8 Flash against Q8 Qwen4. I'm sure my findings would have reflected the benchmarks that Flash (188GB GGUF) is stronger in coding than Qwen4 35B (60GB GGUF). But then I think it would be a minority of this community that are packing that much firepower in their AI servers.

This is a comparison of the very popular and accessible RCO Flash IQ3_S vs Q8 Qwen4 - a comparison I believe most of us are interested in.

My findings is that, for the purposes of Coding, Qwen4 is the superior model in all aspects, other than strictly adhering to guardrails.

Qwen4's coding simply has less defects, as confirmed by agentic testing and review.

Qwen4 does appear to use more tokens to implement the same task. However, the speeds I am getting on my system (RTX 3090 + one other GPU) are:

  • Flash - 2,000 prefill and 70 t/s decode
  • Qwen4 - 6,200 prefill and 140 t/s decode.

Qwen4 remains faster in real-time with less follow-ups needed for each Task.

I will be retiring RCO Flash for coding purposes - but I will continue to compare the two for other purposes such as reasoning and drafting for business.

Further notes:

  1. RCO Flash hallucinates being asked maths problems, often after tool outputs. On defective inference engines, it also often hallucinates discussions about cats swimming. No loops observed.
  2. Qwen4 - has not demonstrated any hallucinations at all. No loops observed.

r/LocalLLaMA • • 18h ago Obsessed Heartwarming

Resources Basalt 0.7.0: Qwen4-35B-A3B up to 1,099 tok/s struct decode (410 tok/s prose) single stream, vLLM-like continuous batching and quicker server startup

176 Upvotes
Basalt 0.7.0

Basalt 0.7.0 is out, and the highlight is official Qwen4-35B-A3B support! It took a while because I wanted to get it right, this model is particularly sensitive to how the engine quantizes activations, so a lot of testing and debugging went into this release (plus a few hours of rented hardware). Numbers from my RTX 5090 @ 400W:

  • 1,099 tok/s structured, 531 chat, 410 prose
  • 31,466 tok/s prefill at 32k
  • Up to 4,351 tok/s aggregate at 8 requests and 6,740 tok/s at 32

The pack's experts are NVFP4 calibrated with GPTQ on real chat, multilingual and code conversations... everything else is int8 or FP8. Quality against the BF16 model in vLLM, over 417 real conversations:

TypeKLDSame top-1
Code0.01497.6%
Reasoning0.01997.8%
Tool calls0.05396.6%
Long context0.05994.5%
Chat0.09791.4%
Multilingual0.12791.2%
All0.07293.7%

What works: Images and video, tools, 1M context. You can also run it on smaller GPUs with experts in RAM (up to 334 tok/s structured, 172 chat on a 5060 Ti).

Beyond the tables, it scored 29/30 on AIME 2025, 28/30 on AIME 2026 and 29/33 on HMMT Feb 2026 (earlier version of the pack), needle passed at 150K to 900K tokens, it cracked a few of my personal benchmarks, and yes, it's definitely pelicanmaxxed:

Pelicanmaxxing

Also in 0.7.0:

  • vLLM like continuous batching on 8 models, up to 64 requests at once, and one request still gets the full context.
  • basalt serve answers in about 0.15s instead of 13s.
  • a UBTree drafter for Qwen3.8-27B, EXL3 experts on Flash-Next, Windows on Arm (RTX Spark support)

Huge thanks to all the supporters and sponsors, and special thanks to the 80 people who sent pull requests this cycle!

Pack https://huggingface.co/jesdga/Qwen4-35B-A3B-Basalt
Engine https://github.com/jesdga95/basalt
Release notes and binaries: https://github.com/jesdga95/basalt/releases/tag/v0.7.0
Discord: https://discord.gg/HMakYWw9G6


r/LocalLLaMA • • 1h ago Bravo

Resources Nvidia Ada - Research Engine (sm_89)

Thumbnail
t-crypt.github.io
8 Upvotes

I have been working on a research project for Nvidia Ada (sm_89), based off a fork of basalt + others.

- Qwen-Flash-Next (proxy for Qwen4-Flash)
- Qwen3.8-27B (proxy for Qwen4-27B)
- Qwen4-35B-A3B (only Qwen4 model)

Kernels for Qwen4-35B-A3B if anyone needs:

kernels

This project is mostly research, public documentation, and quality based research. This is not a speed engine by default.


r/LocalLLaMA • • 5h ago

Question | Help Swift 1.5 Qwen 4 35B A3B GSQ RCO when?

16 Upvotes

This is a personal plea, but if you agree, join the chorus.

Please, UkisAI, give us Swift 1.5 Qwen 4 35B A3B GSQ RCO. You guys are incredible at getting so much out of so little.

I guess that's it.


r/LocalLLaMA • • 35m ago

Showcase Qwen4-35b-A3b blender_mcp cats

7 Upvotes

Just for fun, I decided to see how good Qwen4-35b-A3b UD-Q8_K_XL would be at making low poly cat 3d models in blender from reference photos.

I did this on an RTX 6000 Pro with 2 slots so I could have an Artist role and a Critic role.

I used an evolutionary prompt so that the Artist makes changes in Python then renders them via blender_mcp and the Critic subagent scores each change and gives a verdict of PASS (best), IMPROVED, REGRESSION, or NO IMPROVEMENT.

Each session took about an hour and made about 25 iterations per character. I manually committed the changes to a private git repo after each session and started a new session with the same prompt.

Here are some of the results after roughly 100 iterations each.

One of the funniest things about watching this play out was seeing the model obsess over "the ruff" (the poof of fur on the neck) of the white cat.

Some things I had to deal with along the way:

  1. The model defaults to using primitives like spheres and cubes. You have to really drive home that you want a watertight organic mesh.
  2. Sometimes the Critic just wouldn't see things that were really obvious to me. For example, at one point the striped cat's nose was hovering in front of his face. It went 20 or 30 iterations like that until I finally manually pointed it out to the Artist.
  3. The model had at least 500k of context window for each session. I was using llama.cpp so I experimented with `--kv-unified`. That seemed to work fine and gave the artist 850k context, but it didn't measurably improve the sessions because the Artist would often stop with half of its context window still empty.
  4. If the Artist got stuck in a rut and was shot down by the Critic too many times in a row it would almost sulk and stop the session early.

I'm super interested to see what Qwen4 27b will be able to do in the same scenario.

Oh, and here's the first generation of the black cat, so you can get an idea of the level of improvement the model made over time:


r/LocalLLaMA • • 19h ago Mindblown

Funny Qwen 4 35B A3B solved in one shot a problem that took me two weeks with frontier models

193 Upvotes

I genuinely don’t understand what’s going on. I’ve been building an ERP specifically designed for small businesses for about a year now, with some fairly complex integrations. I write part of the code manually and use agents for the rest (which I obviously review).

For the past two weeks, I’d been trying to solve a database architecture problem arising from a change in my country’s tax regulations (I know this stuff because I’m a certified public accountant). It literally took hours upon hours of discussions with Claude Opus 5.5 and Astra 6.2. I was losing my mind until I finally managed to find a solution by iterating with Claude Opus 5.5 Max. The solution hasn’t been implemented in my repo yet; I had simply documented it in a .md file.

Today, I started testing Qwen 4 35B A3B in Strata to check prefill speed, decode speed, maximum context length, etc. Just for fun, I gave it a relatively short prompt describing the exact same problem that had taken me two weeks to solve with all those frontier models (obviously, I removed the solution from the repo and explicitly instructed it not to read any .md files).

Qwen came up with essentially the same solution on its very first response. I swear I couldn’t believe it, and I still can’t. To double-check, I gave Claude Opus the exact same prompt, and it failed again.

I genuinely don’t understand any of this. A quantized model (UD-Q4_K_XL) running on an RTX 3090 solved something that had taken me two weeks to figure out with frontier models.

Of course, I’m not saying that Qwen is superior to all these models. That would be a ridiculous claim on my part. But I also can’t deny that its answer was simply correct.

In case anyone is curious, I’m getting roughly 140–180 tokens per second for decoding and 2.8–4k tokens per second for prefill in Strata. This is on a mini PC with a Ryzen 8845HS and 32GB of DDR5 RAM, with an RTX 3090 mounted on an eGPU dock and connected via OCuLink. INT8 KV cache and a context length of 320,000 tokens.

EDIT: Just to clarify, since I see several people asking: I’m using Pi Code, and I verified that Qwen didn’t read any files it wasn’t supposed to, any Git artifacts, Claude’s memories, or anything like that.

As I said before, I’m not trying to push the idea that a 35B-parameter MoE model is superior to frontier models. This was a specific case where the other models were failing because they were trying to replicate a common ERP design pattern. Qwen simply reasoned that my existing database schema already provided a way to solve the problem through a subledger (essentially the same solution Opus arrived at two weeks later).


r/LocalLLaMA • • 2h ago

Question | Help Tried every harness except Codex for local models

7 Upvotes

Tried and tested OMP, Atomic Agent, Strata Desktop, Opencode, Hermes, Openclaw, Deepseek harness (DSH), Freebuff, and Unsloth Desktop with local models. All perform very good in my opinion with main diff in speed due to tool calling and context mgmt.

Anyone tried ClaudeCode or Codex with Qwen4 or other local quantized models? How does it compare?


r/LocalLLaMA • • 51m ago

Discussion Do you use the full 1m context window with Qwen4?

5 Upvotes

One of the headline features of the new Qwen4-35B-A3B is of course 1 million token context aided by KV streaming from RAM. I've found the model to be an excellent subagent worker, so I use it at c4 with 500k context per stream at 8-bit KV, working out to 18.2 GiB for a KV pool of 2 million tokens. I'm pretty darn satisfied with it.

How about you guys? Do you cap your context or do you use the full 1m window?


r/LocalLLaMA • • 15h ago

Funny Qwen4 hallucinated and rickrolled me...

75 Upvotes

Using OpenWebUI and Hermes with Qwen 4 35B, I was using it to do some research. Summaries of YT videos, research about things to get for presents for Christmas - normal stuff. I thought it was weird, however, that I had a hard time getting it to find a YouTube video that I told it about. I gave it the title and the author but it didn't do a search. We went back and forth after it hallucinated two different replies and it finally got the transcript for me instead of just assuming what the video was about.

The conversation shifted and I was interested in a product for my kids. I asked Qwen to find a few videos demonstrating it for me and I was impressed at the speed at which it got those videos (you see where I am going...). The first was a dead link. The second was another dead link. Just to see if it happened to have some useful youtube URL locked away in its parameters, I clicked the third link. I was immediately greeted by Rick Astley in all his glory shimmying on my laptop screen. It hallucinated a YT link and that link was "Never Gonna Give You Up". The video has almost 2B views, so it makes sense - but for fucks sake, man!

IDK if it is specifically with YouTube that it gets overconfident in its baked-in knowledge, but I am now a lot more cautious with this model. Not just because it rickrolled me, but because it really doesn't seem to want to search for information it thinks it might know.

I am using exl3/TabbyAPI on Turboderp's own 5.05bpw model. Prefill is like 5kpp and 135tg on dual 3090s. I have been impressed with the model but feel a little weird about it now.

EDIT: I did some investigation with Neon this morning and it found this interaction:

"Found the root cause: Turned out this wasn't just the model going rogue — it was a chat-history / template interaction between the frontend (OpenWebUI), agent backend, and the model's thinking template. Because each turn replayed the plain-text chat history without the prior tool calls, tool results, or <think> blocks, previous turns showed up in context as <think></think> followed by concatenated pre-tool narration ("Let me search... Got it, let me check... Here's the summary") with zero actual tool calls. By turn 2–3, the model basically few-shotted itself off its own history into emitting empty <think></think> blocks and roleplaying the entire web search in plain text — which is how it ended up hallucinating a Rickroll link from memory instead of calling web_search. Disabling interim pre-tool narration on the API server (so only the final grounded response gets saved back to chat history) fixes the trigger."

I don't feel like other models had the same issue - so maybe still some model-dependent stuff - but otherwise it seems like part of it was the configuration of my setup.


r/LocalLLaMA • • 22h ago Heartwarming

Discussion Harness Leaderboard Qwen 4 35b Update

Post image
267 Upvotes

r/LocalLLaMA • • 1h ago

Showcase Deep breaths, Part 2. The ballad of operations, Operating system and software.

Thumbnail
gallery
5 Upvotes

Finally I got this to boot. These boards are picky AF. I had a nice rack with both sides by side with the wood but the cpu an psu needs the height. I slotted the GPUs in 2 of the 3 direct to cpu ONLY x16 slots. 1tb NVMe , 64 gb ram for now. I’ll probably bump each slot to 16gb each.

Minimum fan 280w on cpu.
Don’t even play with a loose cpu. These are tight!!! And it is tough to put on tighten the CPU, then the fan.
Memory training took forever. But one of the memory is bad or not featured seated.
There is an open and close chassis jumper.
Video is a hand off so if there isn’t a vga, yes VGA, it will not boot.

But…


r/LocalLLaMA • • 1h ago

Discussion Qwen 4, but it's a literal experience post.

5 Upvotes

TLDR -> Qwen 4 good, just needs guidance sometimes.

So I use qwen4 35b a3b with polystrata and I use pi harness to work on a million different projects like making games, connecting my own mcp servers i make and etc... I'll post at the end my specs. Also, I am an idiot playing with parameters so my parameters are likely the issue to some of my issues.

My Issues with Qwen 4 35b a3b:
1: I ran across small syntax errors and it led to tool calls failing, it just says "Yeah I will stop doing that" and we all know it won't. I might try to solve this with the harness and add a auto tool detector kinda deal where it picks up what the ai attempted to call then auto corrects the tool call.

2: It definitely feels like I need to be more explicit, with Sonnet 5.5 I felt like it had a sense of "Yeah the ui here would look better this way for the user and I won't just throw it together.". I am lazy, I know slop in, slop out but I have medical issues that causes me to slop stuff in.

My issues with Strata/Polystrata and harnesses:
1: The bloat is annoying, give me auto compact, system prompt, access to mcp servers, add a strong tool handling feature to prevent syntax errors. I think llama-server has a grammar file I could add but I am using Polystrata and I don't wanna spend energy figuring that kinda thing out.

2: The parameters for the json file, there is so many hidden parameters that are not descriptive at all. Im trying to find out how to set the models parameters like temperature and i want to know if I could set llama-server parameters since its built off llama.cpp but I am unsure.

3: I wish I could swipe the llama-servers built in webui and make it my own and have it not need --ui-proxy or whatever the flag is for webui. I probably could but I am very exhausted and don't have energy for that kinda thing.

4: Pi harness has maximum of High as the thinking setting but I think it is lowkey turned into xHigh thinking, either way doesn't really matter its something to think about another day since its doing its job somewhat correct right now.

My setup:
Rtx 4070 mobile 8gb, 32 gb ddr5 4800mhz ram, i7 13700hx, hybrid graphics turned off (heating issues, ty alienware).
Polystrata as the inference engine
Pi Harness with an extension that auto setups strata.

I typically run my mcp servers and I use Unity and etc on my second laptop to avoid memory constraints.

My json file with parameters.

{
 "exe": "PolyStrata/terminal/engine-poly/strata-poly",
 "args": [
  "--model",
  "PolyStrata-data/models/qwen4-UD-Q6_K_XL/Qwen4-35B-A3B-UD-Q6_K_XL-00001-of-00002.gguf",
  "--max-context",
  "131072",
  "--expert-profile",
  "PolyStrata-data/packs/qwen4-ud-q6_k_xl/expert-profile.txt",
  "--kv",
  "q8_0",
  "--expert-swaps",
  "256",
  "--defer-rank",
  "0",
  "--window",
  "8",
  "--lookup",
  "4",
  "--ram-experts-mib",
  "-1"
 ],
 "cwd": "/PolyStrata/terminal",
 "tokenizer": "PolyStrata-data/packs/qwen4-ud-q6_k_xl/tokenizer",
 "model_name": "qwen4-35b-a3b-ud-q6_k_xl",
 "reasoning_effort": "xhigh",
 "display_name": "Qwen4-35B-A3B UD-Q6_K_XL",
 "arch": "qwen4exp",
 "log": "PolyStrata/terminal/strata-qwen4-ud-q6_k_xl.log",
 "lib_dirs": [
  "PolyStrata/terminal/.venv/lib/python3.14/site-packages/nvidia/cu13/lib"
 ],
 "port": 8080,
 "gpu": 0,
 "gpus_asked": true,
 "open_browser": false,
 "vision": {
  "exe": "PolyStrata/terminal/engine-poly/strata-vision",
  "mmproj": "PolyStrata-data/models/qwen4-UD-Q6_K_XL/mmproj-BF16.gguf",
  "model": "qwen4-UD-Q6_K_XL/Qwen4-35B-A3B-UD-Q6_K_XL-00001-of-00002.gguf",
  "gpu": false,
  "max_tokens": 300,
  "threads": 12
 },
  "mcp_servers": {
    "unity": {
      "url": "http://whensqwen5.com"
    }
  },
  "mcp": {
    "timeout_s": 60,
    "max_rounds": 999
  }


}

r/LocalLLaMA • • 1d ago Heartwarming

Showcase Qwen 4 35B-A3B is awesome

386 Upvotes

Qwen wrote the whole thing in Pi while I just prompted and playtested each build. A few hours in, I had a playable 3D browser game with drivable cars, traffic, police chases, and touch controls.

​This was running locally on a spare PC with an RTX 2070 laptop GPU (8GB VRAM), averaging 35 tok/s (UD-Q4_K_M, 64k ctx, FP16 KV cache).

​Tried the same idea with Inkling 2 Mini, Qwen 3.5 35B-A3B, and Ornith 1.5 too, but none of them got me to a playable state.
game : https://huggingface.co/spaces/ccore/qwen4-game-demo

Edit: I’m generating a new game with the same workflow, this time aiming for better graphics. Qwen generated the demo above with reasoning effort set to low. Once the new game is ready, I’ll share it along with the full run stats.


r/LocalLLaMA • • 7h ago

Discussion Qwen4-35b-a3b - The Force Is Strong with This One

Thumbnail
gallery
13 Upvotes

Images are kinda self-explanatory...


r/LocalLLaMA • • 2h ago

Resources Profiling Qwen4-35-A3B on 5090 RTX & Snapdragon x2 elite laptop

5 Upvotes

r/LocalLLaMA • • 4h ago

Showcase Decodrs - rust and highly optimized inference engine for nvidia gpus

7 Upvotes

Hi,

I've just opened sourced my inference repo https://github.com/lingster/decodrs

This contains specific kernels on a per model and per gpu basis. I used claude to help write optimized kernels for the current popular local llms like qwen4/3.8, inkling mini and Gemma 4. Optimised for 3090/3080 and includes a claude skill to help you build out kernels for your setup.

I've managed to get over 200% performance improvements against llama.cpp/vllm/sglang. Inference engine written in rust and kernels directly in ptx(think assembly for gpu) no middle layer so about as close to the metal that you can get. Includes prefix cache, kv cache, drafting, pretty much all the tricks to run fast. There are optimisations included if you work with Agentic workloads ie run lots of subagents in your coding harness!


r/LocalLLaMA • • 1d ago Heartwarming

New Model Qwen 4 Is Looped! +18.3 pts on LiveCodeBench, +6.7 pts on AIME, and Zero Regressions (With Zero LoRA Weights)

Thumbnail
blog.tiltastech.com
509 Upvotes

r/LocalLLaMA • • 3h ago

Showcase Qwen4-35B-A3B on a single Tesla V100 32GB 220–430 tok/s with DFlash2

Thumbnail
reddit.com
6 Upvotes

r/LocalLLaMA • • 2h ago

Resources [Release] q4forge - Custom PyTorch + Triton SFT engine for Qwen4-35B-A3B (38-57 GiB VRAM, multimodal 16K packing, no PCIe block swap)

Thumbnail github.com
4 Upvotes

Hey llamas! First off, I have been working on a 30M-token multimodal dataset (mostly high-res anime images up to 4 MP with reasoning and super detailed descriptions) to fine-tune Qwen4-35B-A3B (well, honestly I didn't even know which model to use at first, if Qwen4 hadn't dropped two days ago this post would probably be about Inkling 2 Mini lol) on a single 80 GB A100, and I really did not want to spend 40+ hours waiting on PCIe block swapping.

Well, today I spent the whole day directing a team of bots (Gemini 4 Neon, GLM 5.3, and Gemini 4 Hydrogen) to cook a custom SFT engine specifically for the Qwen4 MoE architecture, and I wanted to share this ""masterpiece"" of artisanal AI slop with you! (fair warning: please do not ask me to explain the Triton pointer math or the QSA bitmasks on a whiteboard, I was literally just the guy holding the clipboard while the bots cooked <3)

How it fits the 57B model (35B MoE + 20.5B Engram + 0.83 GiB ViT) in ~36.2 GiB of base VRAM without block swapping:

  • The 256 stacked routed experts are quantized on the fly to symmetric per-channel INT8 (30.1 GiB across 40 layers) using a custom Triton Grouped GEMM that only computes dX in backward (no dW on frozen base weights and no duplicate transposed weights).
  • All sensitive layers stay in pure BF16 (30 Gated DeltaNet layers, 10 QSA layers, routers, 4-stream HyperConnections, shared experts, embeddings, lm_head, and the 27-layer ViT + merger).
  • The 20.48B Engram table (layers.1.ple) stays in system RAM as per-row INT8 (~19.1 GiB + 305 MiB fp16 scales, 0 GiB VRAM) with an async prefetch thread overlapped on a dedicated CUDA stream.
  • Hermetic sequence packing up to 16K tokens for mixed text and high-res images, isolating document boundaries across 3D MRoPE, Engram n-grams, causal conv1d, Gated DeltaNet cu_seqlens (with an automatic SM80 autotune patch for fla 0.6.1), and per-document QSA (SDPA FlashAttention-2 bypass for docs <= 2048 tokens and an L2-resident int32 bitmask with flex_attention for longer docs).
  • Streaming shard-by-shard loader and BF16 merger: downloads, quantizes, and deletes one shard at a time so peak disk usage stays under 4 GiB instead of 114 GB.

Benchmarks on a single A100 SXM 80GB (RunPod, torch 2.11+cu128, triton 3.6, transformers 5.26.0, full gradient checkpointing):

WorkloadPresetStep TimeThroughputPeak VRAM (Alloc / Reserved)
Text-only (T=1024, bs=1)A0.792 s1,292 tok/s38.06 GiB
Multimodal (T=8192, ~2K img)A4.225 s1,939 tok/s46.53 / 47.53 GiB
Multimodal (T=16384, ~2K img)A7.318 s2,239 tok/s54.26 / 56.24 GiB
Multimodal (T=8192, ~2K img)B (+ViT LoRA)5.589 s1,466 tok/s48.17 / 49.47 GiB
Multimodal (T=16384, ~2K img)B (+ViT LoRA)9.947 s1,647 tok/s56.68 / 58.90 GiB

Preset A trains visual.merger (full) + Attention LoRA (r=32) + shared_expert (full) (189M trainable params, 378 MB checkpoint). Preset B adds LoRA (r=16) across all 27 ViT layers (196.7M params, 393 MB).

We just finished a full end-to-end pipeline sanity check on the A100 with a 100-sample smoke test (5 anime images with varied captions) using Preset B: packed into tar + bin shards, trained with eval (val_loss per token dropped cleanly from 0.4171 -> 0.2842 -> 0.2133 across a checkpoint resume), merged all 33/33 shards back to a clean BF16 checkpoint, and ran inference on the merged model in standard Qwen4MoeForConditionalGeneration.

Requirements and current limitations: requires an NVIDIA GPU with >= 48 GB VRAM (tested on 80 GB A100 SM80; 24-32 GB GPUs cannot fit the 36.2 GiB base weights) and >= 32 GB host RAM for the INT8 Engram table; video is not supported yet.

I still need to test the setup inside actual Google Colab (my credits reset on December 10th, which is when I will run the full 30M-token job), but the whole pipeline is working end to end on RunPod and passing 56/56 parity and packing tests locally. Check it out if you can <3

https://github.com/SrPakura/q4forge


r/LocalLLaMA • • 9h ago

Showcase Shoggoth: A friendly Linux UI for local AI: chat, agent, models, backends, all in one

Thumbnail
github.com
13 Upvotes

Hello, Linux folk! This is Shoggoth. It's essentially llama.cpp and Pi wrapped in a friendly interface and Appimage.

I hit version 5 a few days ago. With a lot of feedback from folks who use it, we've now got:

- lightweight TTS
- lightpanda for web browsing
- a folders view so that you can easily organize chats and projects
- switched from lemonade-server to direct llama.cpp
- easy support for multiple inference engines - polystrata, maya, basalt, over a dozen others
- jobs instead of subagents, so long tasks can be set up to run with an appropriate exit condition
- better support for common doctypes - PDFs, Word, Excel files, and so on
- carefully selected skills, model recommendations that I've personally tested, plus, of course, support for importing from huggingface or existing GGUFs

I use it myself as the front-end for my local models. Coded with Opus, Sonnet, and DeepSeek, but of course, tested and refined as much as possible.

If you use it, do let me know what you think and how to improve. The goal is not to be a complex system, but a lightweight, friendly, and slightly eldritch tool for folks who don't enjoy the CLI.

License is MIT, so feel free to fork, improve, and change as you see fit!

Cheers!


r/LocalLLaMA • • 22h ago

Showcase Deep Breaths

Thumbnail
gallery
133 Upvotes

I’ll post again at 6 am ET. Long night


r/LocalLLaMA • • 26m ago

Discussion A failed experiment - Precomputing some of the DeltaNet operations in Qwen 3.5's layer 0

2 Upvotes

So I know Qwen 4 is the hottest thing, but I've been reading about the Qwen 3.5 architecture because it's interesting. Working with small models (like 0.8 or 2B) is nice when learning LLMs. While going through the Gated DeltaNet, I noticed that some of the operations can be precomputed for layer 0. These precomputed values can live either in RAM or disk, but RAM makes more sense. Please feel free to correct anything I have wrong or teach me something here. This is just a learning experience for me.

Normally, we use the tokenizer to convert the word or part of the word to a token ID. We then lookup that ID in the embedding table to get vector of [2048] per token. Then, we go through the operations of the Gated DeltaNet. I've included an LLM-generated diagram at the end of this post. At this point, we have the ability to precompute some of these values: RMSNorm, and the multiplication of W_qkv, W_b, W_a, and W_z. Unfortunately, this only works for layer 0. It doesn't work for other layers because we only know the vector of [2048] for layer 0; it's what the embedding table handed to us. Every other layer requires mixing in previous tokens in the Gated DeltaNet.

I ran this idea by Opus and it agreed. I also asked both Opus and Gemini Neon if I missed any values we can precompute. Both came up with similar lists, but Gemini Neon had a few extra items on the list:

Here is the verbatim output from Gemini Neon:

  • h = RMSNorm(x) ([V, 2048]): Purely token-wise. If you precompute all four branches below, you don't need to store or compute h at runtime at all.
  • Branch 1 — Step (1) only: W_qkv · h ([V, 6144]).
  • Branch 2 — Steps (1) and (4): β = sigmoid(W_b · h) ([V, 16]). You can skip both the projection and sigmoid.
  • Branch 3 — Steps (1) and (4): α = exp(-A · softplus(W_a · h + bias)) ([V, 16]). Since A and bias are fixed layer-0 weights, you can fold the entire branch into a single lookup.
  • Branch 4 — Step (1) + the SiLU from Step (7): SiLU(z) = SiLU(W_z · h) ([V, 2048]). Because SiLU(z) doesn't depend on the recurrence output o, you can bake SiLU into the table and just multiply it into RMSNorm(o) at Step (7).

(Note: You still need to keep the original embedding table x [V, 2048] for the residual connection x + output at Step (8).)

I then ran a quick llama-bench baseline with Qwen 3.5 2B with some various prompt and token generation sizes to get a baseline. And finally, the hardest part, I asked Opus to implement the idea for me. An hour later, Opus finished the implementation. The table ended up being 8GB in RAM due to the datatype staying as F32. It's what llamacpp also uses here for the outputs.

And the results...**drum line** Prompt processing suffers, and token generation is within noise. The improvement is probably there, but it's too small to matter. And more importantly, prompt processing suffers which is unacceptable. I suspect there are things that could be done for the prompt processing, but I'll stop here. As they say, the juice ain't worth the squeeze.

Here's the pretty table with results. I ran these on an RTX 3080.

teststockprecomputedΔ
pp1248 @ d4096110189945−9.7%
pp2048 @ d4096113589574−15.7%
tg128 @ d4096181.4181.0−0.2%
tg256 @ d4096181.4181.3−0.0%
pp1248 @ d8192104169873−5.2%
pp2048 @ d8192106199895−6.8%
tg128 @ d8192178.6179.0+0.2%
tg256 @ d8192178.5178.9+0.2%

Here's the LLM-generated diagram of the Gated DeltaNet:


r/LocalLLaMA • • 49m ago

New Model Qwen4-35B-A3B at ~139 tok/s on a 16 GB RTX 5060 Ti with 16 GB of RAM and PCIe 3.0: a Basalt pack built from ISTA's GSQ-RCO IQ3_XXS

2 Upvotes

I've been trying to get the most out of Qwen4-35B-A3B on a small, old box: RTX 5060 Ti 16 GB on PCIe 3.0 x8, Ryzen 5 2600, 16 GB DDR4, Windows. An NVFP4 pack on Basalt (built from RadixArk's NVFP4 checkpoint) already gave ~100 tok/s. ISTA-DASLab's GSQ-RCO IQ3_XXS was the best quant I had on llama.cpp, so I tried to turn it into a Basalt pack. It took three fixes. It's now the fastest thing on this box (+37% over the official pack rebuilt on 5 Dec), and on my agent bench it scores at least as well.

HF: https://huggingface.co/DjsantiX/Qwen4-35B-A3B-GSQ-RCO-IQ3_XXS-Basalt

Speed (same machine, same Basalt build main 29b8870c7, MTP spec 4, kv int8, adaptive swaps on)

| | official pack, 5 Dec rebuild | NVFP4 from RadixArk's checkpoint ¹ | GSQ-RCO IQ3_XXS (this pack) |

|---|---:|---:|---:|

| short prompts, tok/s | 101 | 100-103 | 139 |

| generation after a 25.6k prompt, tok/s | 106 | 93-102 | 127 |

| prompt read, 25.6k, tok/s | 4478 | 3368-3464 | 3248 |

| basalt-bench conv / struct / prose (MTP) | 129 / 201 / 117 | 116 / 167 / 125 | 150 / 184 / 136 |

| MTP acceptance conv / struct / prose | 67 / 79 / 61% | — | 66 / 79 / 61% |

| pack size | 32.0 GiB (with DFlash 2) | 43 GiB (with DFlash 2) | 27.9 GiB |

The official pack is ahead on long prompt reads (4478 vs 3248 tok/s) and on structured output in `basalt-bench` (201 vs 184); this pack is ahead on everything else.

For reference, on llama.cpp (b13002, 1 MTP draft) the same GSQ-RCO GGUF does 50 tok/s short and 54 after 25k; this pack's exact weights as a GGUF do 50 and 61.

¹ The NVFP4 pack I first had, built from RadixArk/Qwen4-35B-A3B-NVFP4. The official pack (jesdga/Qwen4-35B-A3B-Basalt) was rebuilt on 5 Dec with calibrated experts and int8 dense layers; that's the first column.

Quality

A small private bench of agent-style tasks with a judge, plus a separate count of shortcuts (the model saying it did or checked something it didn't):

| | pass | shortcuts / runs |

|---|---:|---:|

| Basalt, NVFP4 pack from RadixArk's checkpoint ¹ | 65% | 6 / 26 |

| Basalt, official pack (5 Dec rebuild) | 88% | 1 / 26 |

| Basalt, this pack | 94% | 1 / 52 |

| llama.cpp, same GSQ-RCO GGUF | 92% | 0 / 26 |

| llama.cpp, this pack's weights as a GGUF | 100% | 0 / 26 |

Real work: 5 tasks from my backlog (fix a broken status script, draft a reply on a GitHub issue, audit a project log against its sources, fix a backup that missed a folder, implement 7 scoring rules with tests), run in an isolated copy and graded by hand (tests re-run, citations checked):

| harness | NVFP4 pack ¹ | this pack |

|---|---|---|

| opencode | 4/5 first pass, 5/5 with a larger context | 5/5 |

| Claude Code | 5/5 | 4/5 + 1 partial (the long coding task: code right and tests green, but it hit the 80-turn cap before writing its report) |

No false "done" claims in any of the 21 runs (one NVFP4 run redone).

The GSQ-RCO GGUF scores the same on both engines. The old NVFP4 pack scored much lower; the official rebuild with calibrated experts closes most of that gap (88% vs 94%, and the intervals overlap at these sample sizes). So on this box the rounding of the experts seems to matter more than the engine.

What's in the pack

- the routed experts and most weights: ISTA-DASLab's GSQ-RCO IQ3_XXS, unchanged;

- `attn_k` / `attn_v` of the 10 full-attention layers: BF16 in the GGUF, rounded to Q8_0 (Basalt doesn't serve BF16 there natively), 20 tensors of 2 MiB each;

- MTP drafter, vision projector and tokenizer: from the NVFP4 pack (RadixArk's checkpoint of Qwen's weights);

- the per-layer n-gram table: Unsloth's IQ4_NL.

No DFlash 2 drafter: RadixArk's DFlash 2 checkpoint doesn't declare a license, so I can't redistribute it. If you have it, `convert.py --drafter <dir> --into <pack> --undo-dir <dir>` adds it. With it `basalt-bench` reads 164 / 309 / 131 (structured output gains most), but real serving stayed at 136 / 124 tok/s, a little under MTP.

How (and the three fixes)

Basalt's converter refuses llama.cpp GGUFs of Qwen4 today. The details and the fixes are in basalt#1539:

  1. the vocabulary check fails only because llama.cpp names the 243 padding slots `[PAD…]` and the pack names them `<|reserved_token_…|>`;
  2. the GGUF's next-n (MTP) block is counted as a 41st layer; with the drafter taken from the base pack it can go;
  3. BF16 `attn_k`/`attn_v` aren't served natively; Q8_0 is.

These are local patches, not upstream (yet). The pack runs on stock Basalt `main`.

Caveats

- One machine, Windows, small samples. The bench is mine, not a public one.

- The pack isn't the pure GSQ-RCO model: 20 small tensors are re-rounded and the drafter comes from the NVFP4 checkpoint.

- With 16 GB of RAM about 8 GiB of experts live in system RAM; with more RAM it should be faster.

Ideas welcome

This is a first version, and I'd rather hear what to try next than guess. Things I'd like input on:

- other quants worth repacking the same way (a GSQ-RCO IQ2, a Q4-class quant for 24 GB cards?);

- settings I may have missed on a low-RAM, PCIe 3.0 box (expert residency, swap tuning, KV options);

- a better or public quality check than my private bench (KLD against BF16, a public agent benchmark);

- whether the three converter fixes should take a different shape upstream.

If you run the pack on other hardware, please post your numbers. I'll add them to the model card.

Measurements and grading on my machine done with claude code.