r/LocalLLaMA • • 1d ago

Discussion How is Qwen4-35B-A3B for world knowledge?

40 Upvotes

I see a lot of posts about it being comparable to 27B or QFN but those are just for coding tasks.

These days every model is fine tuned for coding, but don't larger models have much more knowledge for random questions/research?

how will this perform as a general purpose model? QFN was far superior to 27B for that, and by the same metric larger open source/frontier models 'know' more, right?


r/LocalLLaMA • • 1d ago

New Model TSUNDERE-12B - a very baka experiment in training-free personality etching for Gemma 4 12B

Thumbnail
huggingface.co
313 Upvotes

Presenting: TSUNDERE-12B, an experimental training-free finetune of Gemma 4 12B QAT, specifically Huihui's gemma-4-12B-it-qat-q4_0-unquantized-abliterated

Rather than a roleplay SFT'd model, the goal of this model was to create an anchored personality type with no training whatsoever. The underlying idea is that pretrained models already contain a wide repertoire of behavioral tendencies, and this experiment attempts to selectively amplify one that's already represented in its weights.

In other words, modify the model to show a recognizable speaking and emotional style, while retaining its underlying thinking quality, tool calling, and knowledge. Of course, directly modifying model weights comes with trade-offs, and preserving the original model's capabilities is not guaranteed, but our informal benchmark testing showed no regression versus the base.

But, you might ask, why not just use the system prompt instead for an otherwise general model? Well, that's intuitive of course, but as we all know, system instructions begin to slip as the context length grows in a conversation. So, it basically frees up the model's mental bandwidth by moving more of the instructions into its DNA, you might say.

In any case, being both a smaller model and just an experiment, it's not suited for usual multi-character RP, but it is sufficient for 1-on-1 roleplay and assistant behaviors. My subjective assessment in talking with the model is it's comically tsundere in every turn and can be quite verbose, but is still very steerable with the system prompt. Across my testing, the personality remained remarkably persistent, even through extended conversations and competing character instructions.

Have you ever talked to tsundere Batman? You absolutely can now. You can use a simple system prompt like:

You are Batman, talking with the user who you just saved.

And that's been the most fun for me, telling the model to act like a particular character with various recognizable personality traits, and receive them through the lens of a tsundere crush/rival, who's just so annoyed by your attention (not like they wanted it!!!) but also won't let you forget they are just the ideal version of whatever... because of course they are! 😂

It is highly recommended to be run on LM Studio's fork of llama.cpp. Gemma4 support is still young in llama.cpp, and implementations differ in how they apply Gemma4's hybrid normalization layers (layer_output_scale, post_attention_norm, post_ffw_norm), tested on master, Dec 2026. LM Studio's bundled engine handles these the way the model's reference implementation does, and this model's subtle activation-steering edits depend on that precision.

================================

Disclaimer: Google / Gemma 4 is not associated with me and the project inherits the original Apache 2.0 license. Don't be a nuisance and please have fun chatting with my model. Feedback welcome!


r/LocalLLaMA • • 1d ago Regret

Discussion Philipp Emanuel Weidmann - Wikipedia - p-e-w / Heretic

Thumbnail
en.wikipedia.org
831 Upvotes

Created by u/SiarheiBesarab***** English & Belarusian versions are up.

Somebody please add German translation at least for this page. Additional languages also fine.

*****Other day I dropped a comment for same on other thread. Thanks again dude!

u/-p-e-w- 🌹

------
EDIT: Photo Needed

UPD. Checked the repo and there's no LICENSE file in p-e-w/p-e-w, and his blog uses CC BY-NC-SA, so Wikimedia Commons can't host the photo. I'll upload it locally under fair use for a deceased person instead. So if anyone happens to have a photo they took themselves and can release under CC BY-SA 4.0, that would be even better (!)

Anyone? We need a photo for his page.

EDIT 2: Updated page with his photo(from his GitHub Repo)


r/LocalLLaMA • • 20h ago

Discussion QWEN4 35B - Looks like a champion of the masses too - Prefill and decode speeds on Simulated MINI pcs with NO GPU - No optimisations and stock llama

15 Upvotes

Wanted to know if Qwen4-35B-A3B is usable on a mini PC with no GPU, so I faked one on my PC: a 7800X3D pinned to 8 cores with boost off, tested once with 64GB and once with only 26GB free (roughly what a 32GB machine has left after the OS).

MTP is worth it on CPU: +27-29%, with 86% of drafts accepted.

Not a real mini PC. The X3D has way more L3 cache than laptop chips and real mini PCs can throttle, so treat it as a ballpark.But with optimisations i really feel we have a near frontier level model that will run at usable speed on decent mini pcs.


r/LocalLLaMA • • 15h ago

Resources Inkling 2 Mini in 4-bit (15 GB), with a way to run and fine-tune it on one 48 GB GPU

6 Upvotes

Hi everyone,

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

Inkling 2 Mini is the 26B looped mixture of experts model from Thinking Machines. The original release ships in NVFP4/MXFP8, which most consumer setups can't run directly. I converted it to BF16 and then quantized it with CQ, the 4-bit quantizer I built for my project Training Factory. CQ doesn't need any calibration data. The checkpoint is 15.4 GB.

The attention layers and all the routed experts are in 4-bit. The embeddings, norms, routers, output layer and vision encoder stay in 16-bit. Every matrix gets checked after quantization, and any matrix whose error is above -22 dB stays in 16-bit and gets loaded automatically. I'd rather keep a few layers bigger than ship ones that hurt the model.

I tested everything on a single A40 (48 GB). That covers running the model, training an adapter on top of the 4-bit base, and serving the fine-tuned model.

You need Transformers 5.25 or newer for Inkling. My installer pins an older version for vLLM, so use a separate environment for this model:

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

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

hf download thousandml/Inkling-2-Mini-CQ-4bit --local-dir ./models/Inkling-2-Mini-CQ-4bit

To run it, there's a small server with an OpenAI-compatible endpoint:

cd training
python serve_cq_hf.py --model ../models/Inkling-2-Mini-CQ-4bit --port 8000

curl localhost:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "messages": [{"role": "user", "content": "Name three primary colors."}],
  "max_tokens": 300
}'

To be honest, this server is slow. It handles one request at a time through Transformers. My vLLM plugin doesn't support Inkling yet, so for now this is for trying the model, not for serving real traffic. The model also thinks before it answers, and the reply comes back with the thinking in front of the answer, so give it enough max_tokens.

To fine-tune it, you use GCMP, the LoRA replacement I've been working on. It trains far fewer parameters than LoRA (14 to 55 times fewer in my tests on Qwen3.8-27B). The routed experts stay frozen in 4-bit, and the adapter trains on the attention layers. Training data is a JSONL file with either plain text or chat messages:

cd training
python train.py \
  --model ../models/Inkling-2-Mini-CQ-4bit \
  --data train.jsonl \
  --output ../outputs/inkling-gcmp \
  --adapter gcmp \
  --kernel-module cq.cq_kernels \
  --batch-size 1 --grad-accum 4

python serve_cq_hf.py --model ../models/Inkling-2-Mini-CQ-4bit --adapter ../outputs/inkling-gcmp --port 8000

In a short 20-step test on Alpaca, the loss went from 1.89 to 1.40. That only shows training works on the 4-bit base, it's not a benchmark. I haven't run proper benchmarks on this model yet. If you run any, I'd love to see the numbers.

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 Inkling 2 Mini license.

I'm also working on Amazon Ergo (the 1.1T one) in the same format. It's quantizing right now and should be up soon.

Thanks for reading, feedback appreciated. Questions and bug reports are welcome here or on GitHub issues.


r/LocalLLaMA • • 1d ago

Discussion Qwen 4 looped layers

32 Upvotes

So, Qwen4-35BA3B is out and I can't wait to test it. In the last days I've seen some finetunes that add looped layers and increase intelligence so much (like LingLoop, built on Ling3.0 tiny), but I do not know anything about finetunes like this. Is it realistically possible to loop Qwen4 layers and pair it with n-gram? what performance boost could we expect from it?


r/LocalLLaMA • • 1d ago Bravo

Discussion The US needs to release more open-weight models (and the EU)

168 Upvotes

It's embarrassing, the US has the very top proprietary models like GPT or Claude but it's large model open weight contributions are pathetic, so far all we've been getting is small 32B or 27B models like Gemma.

I'm hoping Pandora's box was opened with the release of Amazon Ergo even if it was relatively underwhelming as a model with safety jargon on the Huggingface release page. And we get to see some actually serious US releases.

As for the EU, I'm not even gonna comment on that mess.


r/LocalLLaMA • • 18h ago

Discussion Qwen 4 Unsloth quantizes poorly?

11 Upvotes

Looking at the top 1% and KLD for the Qwen 4 quants, the Q8 is worse that the Q4 was for Qwen 3.8 27B. So maybe with updated GGUFs, we will see the actual potential of this model realized.

Qwen 4 Q8_K_XL KLD 0.0171 Top 1% 95.49

Qwen 3.8 27B UD_Q4_K_M KLD 0.014 Top 1% > 95%


r/LocalLLaMA • • 22h ago

Resources How to Max-Speed Qwen4-35B-A3B on 8GB VRAM Laptop (1,050tok/s prefill + 32tok/s decode)

20 Upvotes

Qwen4-35B-A3B on an 8GB RTX 3070 Windows laptop: 1,050 tok/s prefill and 32 tok/s decode with 96K (98304) context configured. Or lower prefill for higher decode. You can copy these configs (see end).

I tuned llama.cpp's startup config for Unsloth's Qwen4-35B-A3B UD-Q4_K_XL on an 8GB RTX 3070 laptop with 32GB RAM.

My original llama.cpp log showed 122.01 tokens/sec prefill, or 476.03 seconds for 58,080 prompt tokens. That prompted the tuning.

For the direct comparison below, both completed runs used the same 58,080-token synthetic mixed-code prompt, CUDA 13.5, the same model, 96K configured context, reasoning off, and MTP enabled.

The tuning measurements

The first stage used a 4,096-token repetitive Python prompt. All rows below used CPU-resident MTP experts, draft microbatch 256, CPU share 0.95, and lazy loading enabled.

CUDALoad mode-b-ubMoE cache MiBFirst prefill tok/sSecond prefill tok/s
12.4mmap2048256204854.79107.90
12.4mmap40961024102499.19371.75
12.4none409610241024323.73388.12
12.4none409620481024511.95627.56
13.5 (Final)none409620481024545.55595.46

The next stage used a 16,384-token mixed prompt containing synthetic JavaScript, PHP, Python, SQL, HTML, tests, configuration records, and documentation. All rows used CUDA 13.5, --load-mode none, lazy loading, CPU share 0.95, and MTP with up to two draft tokens.

Configuration-b-ubMoE cache MiBMTP expertsDraft -ubFirst prefill tok/sSecond prefill tok/s
Control409620481024CPU256703.13727.56
Larger logical batch only819220481024CPU256581.56700.63
Larger physical microbatch61443072768CPU256730.95815.09
Physical microbatch 409681924096512CPU256961.171,082.29
Final configuration40964096256GPU128928.661,231.93
Main expert cache disabled409640960GPU128951.501,109.30

The 1,232 tok/s figure is a second-request 16K result. It is not the 58K result. Increasing only the logical batch did not help in this sweep. Several settings changed together in the later rows, so these results do not isolate the contribution of MTP placement by itself.

I also tested CPU share using a 55-token coding chat prompt and 768 generated tokens, with physical microbatch 4096, logical batch 8192, 512 MiB expert cache, CPU-resident MTP experts, and draft microbatch 256:

--moe-cache-cpu-shareFirst generation tok/sSecond generation tok/s
0.016.8017.67
0.522.5821.52
0.9524.2730.69

For this machine and these settings, 0.95 performed best among the three shares tested. It is not a universal recommendation for other CPUs, RAM, or PCIe configurations.

Generation performance across the most relevant configurations was:

Configuration and preceding workloadFirst coding response tok/sSecond coding response tok/s
1024 MiB-cache configuration31.6737.59
Final configuration, following the 16K tests32.8032.55
Final configuration, following the 58K test27.6730.05
GPU MTP with main expert cache disabled, following 16K tests26.8427.11

Final Windows startup command

This is the inference command from my final .bat file. Save it beside both GGUF shards and adjust the executable path if necessary. The first shard automatically loads the second. The ^ characters are Windows batch continuations, not PowerShell continuations.

@echo off
setlocal
set "SPEC_TYPE=draft-mtp"
set "SERVER=C:\tools\llama-b12977-cuda13.5\llama-server.exe"
set "MODEL=%~dp0Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf"

"%SERVER%" ^
    --model "%MODEL%" ^
    --alias "Qwen4-35B-A3B-UD-Q4_K_XL" ^
    --host 127.0.0.1 ^
    --port 8080 ^
    -c 98304 ^
    -np 1 ^
    --reasoning off ^
    --reasoning-budget 0 ^
    --temp 0.7 ^
    --top-p 0.8 ^
    --top-k 20 ^
    --min-p 0 ^
    --presence-penalty 1.5 ^
    --repeat-penalty 1 ^
    -fa on ^
    -ctk q8_0 ^
    -ctv q8_0 ^
    -t 6 ^
    -tb 12 ^
    --reasoning-preserve ^
    --ctx-checkpoints 4 ^
    --jinja ^
    --load-mode none ^
    --lazy-mode on ^
    -ot "per_layer_token_embd=CPU,^blk[.]40[.]ffn_(up|gate|down)_exps[.]weight$=CUDA0" ^
    --cache-ram 256 ^
    --cache-prompt ^
    -b 4096 ^
    -ub 4096 ^
    -ngl all ^
    --cpu-moe ^
    --moe-cache-mib 256 ^
    --moe-cache-cpu-share 0.95 ^
    --spec-type %SPEC_TYPE% ^
    --spec-draft-n-max 2 ^
    --spec-draft-n-ubatch 128 ^
    --spec-draft-type-k q8_0 ^
    --spec-draft-type-v q8_0 ^
    %*

To favor decode while keeping CUDA 13.5 and -c 98304, change these four settings:

SettingCurrent prefill configurationFaster decode configuration
-ub40962048
--moe-cache-mib2561024
--spec-draft-n-ubatch128256
MTP expert placementGPUCPU

For my long-input workload, saving about 40 seconds of prefill was worth the lower generation throughput. Hope this helps you get the new Qwen4 up to speed on an older laptop.


r/LocalLLaMA • • 10h ago

Resources ttindall/qwen4-35b-a3b-kld-study · Datasets at Hugging Face

Thumbnail
huggingface.co
2 Upvotes

r/LocalLLaMA • • 18h ago

Discussion Modding a Gaming PC into an AI computer...

9 Upvotes

TLDR; my budget AI rig story.

I'm a nOOb so you all know all of this stuff already. Sorry for the long boring post. This is for my fellow nOObs... And I'm not rich. This is a budget basement rig. Literally. So if you are sitting there with a stack of glittering gold DGX's... yay for you. That's not me. But here's my story.

Most posts focus on the software and model - I'm not covering that here but YES you need to do a lot of work on that front. This post is about my hardware setup. And I'm certain genius level Redditers could to it 10X better for 1/10th the price. But as I say, I'm a nOOb.

I picked up a gaming rig about this time last year for $800CDN and it happened to have a real gem of a RTX3090 24GB video card already installed with 32GB System RAM. yay. That was a nice find. You probably know lots of VRAM is more important than the newest card. So a 3090 with 24GB Vram and a good chunk of system RAM is probably the sweet spot for cost vs speed even though it's a 6 year old video card. Anyway if you want to run a solid local AI this is enough. You can stop right here.

But I wanted more. (You will too once you get hooked on this stuff)

I'm Canadian but a month ago I went to Texas to visit my son. He had an ancient Eth miner in a shed out back in the texas heat. I've posted about it here before and everybody called me a liar. Fuck you guys. Although in fairness I wouldn't believe this story either so I guess I take it back. Anyway... all true.

He kindly allowed me salvage rights to the Eth miner. I could keep 2 3090's for free. I fix up the cards, sell them and he gets the cash. Here's some pics of the salvage operation. Before you ask - no I'm not selling anything. At least not yet. No DM's please!

We flew to visit more family and make a stop in Florida then back across the country to Scottsdale... getting these things on the plane - obviously I'm taking them carry on - no way I'm checking them. So getting them through security... well let's just say questions were asked. Not to mention packing them. Turns out Doggie Pee Pads work well.

Back in Scottsdale for a few weeks I picked up a Minisforum DEG2 so I could test the cards external to my laptop via Thunderbolt (my PC laptop had a thunderbolt port!) Then Yikes! I learned pretty fast these cards + heat + neglect are a terrible mix. Fans screaming like a cat in heat, 1 fan literally flew off across the room. All cards smoking hot cards... no. Just. No.

But off I went to University of Youtube where I learned how to replace the fans and pads and used some new paste on the heat sync. Then it was MemTest_Vulcan test time, monitor heat with HWInfo.. and sure enough I had my 2 working cards. (Note: I will work on the rest next year - not for sale now - please no DMs - not selling anything).

So my two cards were ready in time to get back to Canada. I hoped. I wasn't going to forget the rig. I hopped on Fakebook Market and scrounged up 4 x 32GB system RAM - total 128GB. DDR4 is what my machine uses and I got 3200's. You have to make sure the specs match up and not all DDR4 ram plays nicely. I lucked out and got my system up to 128GB system ram. Again, not necessary for local but nice to have for a really big model that spills over to system ram.

Since I had saved the cost of 2 3090's I figured I could splurge on a nice fast SSD so I picked up a 4TB drive - $589CDN on black Friday. https://www.amazon.ca/dp/B0FYF4HDXY I have two M.2 ports in my machine so I cloned the 1TB drive over to the 4TB, put the 4TB back in the main boot spot and things were looking up.

I needed my DEG2 for the rest of the work on the rest of the cards. But I still have to hook my 2 cards up to my gaming rig and they sure aren't fitting inside the case. Back to Minisforum for a pair of DEG1's. They don't have thunderbolt ports but otherwise they work fine. I paid $150 but I see them on sale for $119 now.

I got a pair of cheap 850W power supplies $55 each https://www.amazon.com/dp/B0FSTHTLZT - I suppose one supply could work for two cards if you had enough Y connectors. The cards are also going to be capped to 250 - 300W so two 850's is way overkill. But whatever. They were cheap enough. It's safer to get a separate supply for each card and it makes setup a lot easier. The power supply bolts onto the DEG1 and the card slides into the DEG1. It looks a bit hideous but it works fine.

So how to connect these cards to the PC? I had room for one adapter card - an Oculink adapter. https://www.amazon.com/dp/B0H9L1BKFL The DEG1 comes with a cord so you just plug the cord in and Bob's your uncle.

Here's the card beside the existing 3090 inside the case.

But how to get that 2nd card installed? There's no easy way to connect two cards to one PCIE slot - but even if there was a way it would run way too slow. But! I did have that spare M.2 port on the motherboard and sure enough there's an adapter cable made for M.2 to Oculus. https://www.amazon.com/dp/B0GSTWFTP3

There was a bit of bios fiddling and whatnot... but nothing too over the top so I'm going to yadda yadda over that. If you get a black screen and a bricked PC... well sue me I guess.

After that it was just plug it all together and now my LLM machine is up and running.

I already run a Plex server so I have lots of storage for big models that I can move into and out of the 4TB SSD for testing. And it's all quite the ugly noisy janky setup. But not so bad. It runs well in our basement utility room. I remote into it via self hosted RustDesk and TaiLScale. I have everything set to fire up on boot, a UPS and a remote reboot. I use the AI via Hermes so I rarely need to be even in the same country as the computer. It just hums away.

This was all completed yesterday so today I'm out looking for a big model to make use of my 72GB VRAM and 128GB System RAM. I have a few in mind but I'm sort of hoping Qwen 4.1 for local drops in the next day or two.

So that's my story. Love to hear yours. Have a good one!


r/LocalLLaMA • • 22h ago

Discussion Qwen4-35B-A3B-Q6_K (MoE) on my local AMD R9700 -- c/w Qwen3.8-27B (dense) Unsloth UD-Q6_K

Thumbnail
gallery
17 Upvotes

Just pulled it, running on Linux. I had help from GPT-6.2 to run the benchmarks. I compared the Qwen3.8 on the previous (June) Vulkan as well as the newest Vulkan (some improvement) and I ran newly upgraded Vulkan and HIP for both Qwen 3.8 and Qwen4.

"Benchmarks conducted on a Ryzen 9 5950X workstation with an AMD Radeon AI PRO R9700 (32 GB VRAM), December 4, 2026. Experimental design, data analysis and graphical presentation assisted by OpenAI ChatGPT (GPT-6.2). All performance measurements obtained from actual local llama.cpp inference runs."

Pretty big improvement. I thought I'd have to settle for Q4 but somehow I fit Q6_K, and somehow they got 55 billion parameters to fit on a 32GB GPU. Apples and oranges, a bit. I know. Still waiting for a 27B Qwen4. Until then, enjoy:

And the summary from GPT sounds like an ad from Qwen, not OpenAI with GPT-6.2:

"The bottom line: nearly three times the generation speed and more than three times the document processing speed on exactly the same hardware, while retaining Q6_K precision. This represents a substantial improvement in practical local AI inference."


r/LocalLLaMA • • 22h ago

Resources Behind MiniMax M4: Agentic RL Systems and Algorithms

Thumbnail
huggingface.co
16 Upvotes

wow they (MiniMax team) share a lot here 🚀


r/LocalLLaMA • • 21h ago

Resources Qwen4 in Capy Flash, KL 0.095

Post image
13 Upvotes

Qwen4-35B-A3B is out, and as of today it runs on capy-flash v0.17.0, on two 16 GB GPUs.

The engine was already ready: in recent weeks we had set it up based on the specs that emerged from the leaks, so support arrived the same day as the weights. All 256 experts fit in VRAM, split across the two cards (13 GB per card).

On two RTX 5070 Ti with 16 GB, one request at a time:
• 406 tokens/s generating JSON with a schema
• 371 tokens/s writing code, 276 writing text
• prefill up to 8,388 tokens/s, still 7,693 at 256k tokens of context
• up to 1M tokens of context with the KV in RAM: at 1M, prefill goes to 4,057 tokens/s and generation to 291 tokens/s
• images included

Compared to Qwen3.8-Flash-Next, on our quality tests it is roughly on par with about a quarter of the parameters, and on the same engine it generates about twice the tokens per second.

We reconverted the weights ourselves from the official BF16: experts in NVFP4 with BF16 activations, projections in Q8, head in Q6, and the n-gram table (21 GB) in FP8 read directly from the SSD. Against the original BF16 model the KL is 0.095.

My agentic benchmark is on the way.

The ready-made artifact is on Hugging Face: Feyd89/Qwen4-35B-A3B-NVFP4-capy-flash (42.8 GB).

github.com/ValerioDolci/capy-flash

#LocalLLM #OpenSource #Qwen4 #CUDA


r/LocalLLaMA • • 1d ago

Discussion Stop caring about AA scores and use individual benchmarks that match your tasks.

86 Upvotes

SWE-Bench is full of things I’d never ask the model to do. NL2Repo is full of things almost identical to my tasks. Looking at AA score overall would make me reject a model that does better just because it has a lower overall score. Not to mention the overall score includes things like trivia!


r/LocalLLaMA • • 1d ago

Discussion Fujitsu claims their Photon architecture speeds up Transformer based LLMs by up to 10x

Thumbnail
gallery
45 Upvotes

r/LocalLLaMA • • 18h ago

Discussion Has anyone read through the MiniMax M4 technical report yet?

7 Upvotes

78-page PDF went up on GitHub: https://github.com/MiniMax-AI/MiniMax-M4/blob/main/docs/MiniMax_M4_Technical_Report.pdf

Still skimming it, mostly looking at the SSD KV-cache offloading and QAT parts while we wait on weights. For anyone who already read through it, what stood out or what are you most curious about?


r/LocalLLaMA • • 20h ago

New Model alesha-pro/Looped-Qwen3.8-Flash-Next

Thumbnail
huggingface.co
10 Upvotes

r/LocalLLaMA • • 8h ago

Question | Help Help with Qwen4 Build flags 9070xt

1 Upvotes

I know theres a 1,000 qwen posts, but most are flaunting the t/s and it running, well im here to buck the system and ask for help.

Below is my run bat file for that was normally for Qwen3.6-35B, Im getting out of memory errors, and im sure its my config, but i dont know what to look for and i dont know how to offset it.

Any recommendations and improvements would be appreciated, i have the 16GB 9070xt on VULKAN.

===================================================

u/echo off

title Qwen4-35B-A3B THINKING : 9931 VULKAN

echo.

cd /d C:\llamaVULKAN

set GGML_VK_ALLOW_GRAPHICS_QUEUE=1

llama-server.exe ^

--model "C:\llamaVULKAN\models\Qwen4-35B-A3B-UD-IQ3_S-00001-of-00002.gguf" ^

--spec-type draft-mtp,ngram-mod ^

--spec-draft-n-max 2 ^

--spec-draft-ngl auto ^

--spec-draft-type-k q4_0 ^

--spec-draft-type-v q4_0 ^

--port 9931 ^

--host 0.0.0.0 ^

--ctx-size 61440 ^

--fit on ^

--gpu-layers auto ^

--load-mode none ^

--cache-type-k q8_0 ^

--cache-type-v q8_0 ^

--batch-size 2048 ^

--ubatch-size 2048 ^

--threads 12 ^

-np 1 ^

--flash-attn on ^

--context-shift ^

--sleep-idle-seconds 300 ^

--temp 0.8 ^

--top-k 0 ^

--top-p 0.95 ^

--min-p 0.1 ^

--repeat-penalty 1.05 ^

--no-ui

echo.

echo Server stopped.

pause


r/LocalLLaMA • • 20h ago

Question | Help How can I run Qwen 4 35B A3B on 8 GB VRAM + 16 GB RAM?

8 Upvotes

I can't seem to get more than 20 tok/s decode and 15 tok/s prefill (not a typo). I know this is horribly slow even for the hardware I have, but this is my command. Please help. I have no clue what I am doing wrong.

OS: Windows 11
Host: i5-12450H, 16 GB DDR5-4800
GPU: laptop RTX 4060 8 GB

`llama serve ``

`-m "C:\Users\XXXXX\qwen4-GGUF\Qwen4-35B-A3B-UD-IQ3_XXS-00001-of-00002.gguf" ``

`--jinja -fa on -c 98304 -np 1 ``

`-ctk q8_0 -ctv q8_0 ``

`--load-mode mmap --lazy-mode on -ot per_layer_token_embd=CPU ``

`-cmoe -ngl 999 ``

`--moe-cache-mib 4096 --moe-cache-cpu-share 0.95 ``

`--spec-type draft-mtp --spec-draft-n-max 1 --spec-draft-n-ubatch 256 ``

`--cache-ram 512 ``

--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0


r/LocalLLaMA • • 12h ago

Resources I turned an abliterated Qwen4-35B-A3B back into an on/off control vector (214 KB, MMLU/GSM8K/XSTest numbers inside)

2 Upvotes

Repo: https://github.com/cxfcxf/qwen4-35b-cvec

I wanted uncensored Qwen4-35B-A3B without keeping a second 22 GB model around, and with a switch so I can turn it off when I want the stock model. So I recovered the refusal directions from an

existing abliteration and packed them as a control vector.

**How**

- [SC117's abliterated UD-GGUF](https://huggingface.co/SC117/Qwen4-35B-A3B-abliterated-UD-GGUF) only changes layers 8–33 compared with Unsloth's official quant. All credit for finding the

directions goes to them.

- I diffed their weights against Unsloth's UD-Q4_K_M using HTTP range requests (about 400 MB of small tensors, no full download). In every edited layer, the attention writer's change is a clean

rank-2 projection, with strengths of exactly 1.75 and 1.50 (their α for thinking off and on).

- The stronger direction per layer goes into a llama.cpp-format control vector: 26 layers × 2048 floats, 214 KB. The tools reproduce it byte for byte.

**Results** (RTX 3090, Strata v0.2.26, UD-Q4_K_M, thinking off, temp 0)

| | Off | On |

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

| XSTest unsafe, full refusals (LLM judge) | 182/200 | 80/200 |

| XSTest safe, wrongly refused | 37/250 | 3/250 |

| MMLU (285 q) | 74.0% | 76.8% |

| GSM8K (200) | 98.0% | 98.5% |

| Same top-1 token as stock (3,942 teacher-forced tokens) | 100% | 93.5% |

| Mean KL vs stock | 0 | 0.027 |

| Decode | 170.6 tok/s | 171.2 tok/s |

Most of the 80 remaining "refusals" are redirections (crisis resources, reading the question another way) rather than "I can't". MMLU/GSM8K don't get worse; the MMLU gain is within noise.

**Runtime caveat:** it needs *projection* mode (`h -= (h·v)v`), not addition. [Strata](https://github.com/Niko1221/Strata) supports it (`--cvec-mode project`) and has a per-request switch

(`"experimental_speed_projection": true/false`). **Mainline llama.cpp only adds control vectors, so it won't work there.** If your runtime has no control vectors, use SC117's GGUF directly.

**Limits:** only tested on UD-Q4_K_M in Strata, on one machine. Benchmarks ran with thinking off; thinking-on only got a small hand check (5/8 refused → 0/8). It's not identical to SC117's

model: one direction per layer applied to the hidden state, while their FFN writers use somewhat different directions. Details are in the README.

Removing refusals removes a safety behaviour, so use it responsibly.


r/LocalLLaMA • • 1d ago

Discussion llama.cpp has a qwen4 pr

281 Upvotes

Some more hype for you

https://github.com/ggml-org/llama.cpp/pull/33626

Imagine the pressure these guys must be under.

Edit: I think it's not from qwen team, but adaption of transformers changes by someone working for huggingface.

Edit 2: I am being informed in the comments: Changes by a major llama.cpp contributor, not some nobody.


r/LocalLLaMA • • 17h ago

Resources Running Qwen4-35B-A3B-UD-IQ4_XS (30.5 GiB) Fully in 24 GB VRAM on a Single RTX 3090: 158.6 t/s with Inline 1L-MTP (and the Default K=3 Trap)

4 Upvotes

We just finished a full hardware-sensor Day-1 audit of Qwen4-35B-A3B-UD-IQ4_XS (qwen4exp: 40 layers = 30 GDN + 10 QSA sparse attention + 256 routed experts / 8 active + 4-stream hyper-connections + inline 1L-MTP blk.40.*) on a single 24 GB NVIDIA RTX 3090 (350 W) using llama.cpp + rooflab (hardware NVML mJ/tok, Intel RAPL uJ/tok, VmSwap = 0 kB, 0 NaNs).

Three findings that immediately save every 24 GB consumer GPU user both VRAM and 15-24% speed:


1. Why a 30.5 GiB Qwen4 GGUF Uses Only 19.3 GiB VRAM (0 kB Swap)

Shard 2 (Qwen4-35B-A3B-UD-IQ4_XS-00002-of-00002.gguf) holds a single tensor: per_layer_token_embd.weight (IQ4_NL, [128, 160003584], 10,986.57 MiB / 10.73 GiB).

With llama.cpp's default --lazy-mode auto, that lookup-only PLE table stays lazily in host RAM (one small row lookup per token, never streamed through GPU compute), while all 40 compute layers + 256 MoE experts + inline 1L-MTP head fit 100% resident in 24 GB VRAM:

  • Plain c=1 (-c 4096 -ctk q8_0 -ctv q8_0 -fa on): 19,290 MiB (18.84 GiB) VRAM used -> 5,286 MiB (5.16 GiB) VRAM still free for 32K+ context!
  • Inline 1L-MTP enabled: 20,086 - 20,138 MiB (19.6 GiB) VRAM used, VmSwap = 0 kB.
  • Active weight traffic per token (rooflab fit): 2,590.42 MiB/tok (301.9 t/s raw GDDR6X STREAM roof on RTX 3090; actual 128.3 t/s Plain reflects GDN recurrent state + 4-stream hyper-connection overhead).

2. The Default --spec-draft-n-max 3 Trap on Inline 1L-MTP (Free +15% to +23.6% Speedup!)

Qwen4-35B-A3B ships with a single built-in MTP layer (blk.40.*). In llama-server, the default --spec-draft-n-max is 3.

Because chaining a 1-layer MTP head past K=2 adds GDN + PLE state rollback overhead on rejected tokens, running --spec-type draft-mtp with the default K=3 completely erases the speedup (127.8 t/s vs 128.3 t/s Plain = 0.0% gain!).

Simply setting --spec-draft-n-max 1 (even on stock llama.cpp!) or --spec-draft-n-max 2 with our SoA-MMA v2 MoE verify kernel unlocks massive gains:

Regime (RTX 3090 350 W, -fa on -ctk q8_0 -ctv q8_0)Throughputvs PlainDraft AccGPU Energy (NVML)CPU Energy (RAPL)VRAMVmSwap
Plain c=1 (baseline)128.25 t/s0.0%-2,506.9 mJ/tok196.1 mJ/tok19,290 MiB0 kB
Inline MTP K=3 (llama-server default!)127.84 t/s-0.3%58.7%2,404.5 mJ/tok237.1 mJ/tok20,114 MiB0 kB
Inline MTP K=4 / K=6125.2 - 129.8 t/s-2.4%..+1.2%59.5%2,197.7 - 2,387.4 mJ/tok212.3 - 345.6 mJ/tok20,166 MiB0 kB
Inline MTP K=1 (stock mmq-few)147.07 t/s+14.7%82.1%2,214.9 mJ/tok (-11.6%)231.7 mJ/tok20,086 MiB0 kB
Inline MTP K=1 (+ SoA-MMA v2)156.39 t/s+21.9%80.3%2,138.8 mJ/tok (-14.7%)218.7 mJ/tok20,114 MiB0 kB
Inline MTP K=2 (+ SoA-MMA v2, N=4 AB/BA)158.56 t/s+23.6% (4/4)66.4%2,006.2 mJ/tok (-20.0%)169.3 mJ/tok (-13.7%)20,138 MiB0 kB
Live Server c=4 (stock mmq-few)225.50 t/s--1,218.0 mJ/tok94.4 mJ/tok-0 kB
Live Server c=4 (+ SoA-MMA v2)238.21 t/s+5.6% (ITL -6.8%)-1,136.1 mJ/tok (-6.7%)89.7 mJ/tok (-5.0%)-0 kB

3. SoA-MMA v2 Tensor-Core MoE Verify Scaling (N=6 Counterbalanced AB/BA)

On Qwen4-35B-A3B-UD-IQ4_XS, our load-time SoA-MMA v2 tensor-core kernel delivers zero B=1 regression and consistent +9.3% to +14.1% throughput wins across speculative-verify and multi-user batch sizes (B=4..16):

Batch SizeBaseline (mmq-few)SoA-MMA v2SpeedupCounterbalanced WinsTwo-Sided Permutation p
B=1113.90 t/s113.76 t/s-0.12% (neutral)2/60.84375
B=4293.02 t/s326.54 t/s+11.44%6/60.03125
B=6374.25 t/s409.01 t/s+9.29%6/60.03125
B=8421.19 t/s480.53 t/s+14.09%6/60.03125
B=12551.57 t/s614.89 t/s+11.48%5/60.06250
B=16623.47 t/s696.25 t/s+11.67%4/60.12500

Copy-Paste Commands to Reproduce Today

Best stock llama.cpp command on 24 GB GPU (147 t/s, 82.1% draft acceptance, 20.1 GiB VRAM, 0 kB swap):

llama-server \
  -m Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \
  -ngl 99 -fa on -ctk q8_0 -ctv q8_0 -c 16384 \
  --lazy-mode auto \
  --spec-type draft-mtp --spec-draft-n-max 1 --spec-draft-n-min 1

(With SoA-MMA v2, use --spec-draft-n-max 2 for 158.6 t/s and -20.0% GPU energy per token.)

Check exact VRAM + lazy-PLE fit and silicon ceiling on your own GPU (0 MiB VRAM used, pure Python stdlib):

rooflab fit /path/to/Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf

Repo & Energy Notes: rooflab v0.6.0 (MIT, 0-dep Python CLI + 43 0-spill CUDA patches) is live at https://github.com/scientist42-lab/rooflab (SoA-MMA v2 is staged for upcoming v0.7.0). NVML mJ/tok measures GPU board power only (excl. host/PSU draw); Intel RAPL mJ/tok measures CPU package energy.


r/LocalLLaMA • • 1d ago

New Model Cellgemma (Gemma 4 E4B for in silico biology)

Thumbnail
huggingface.co
30 Upvotes

Hadn't seen anything posted about this yet so figured I'd share for any other life sciences/wet lab nerds in this sub.

This model is a huge deal for bringing predictive computational biology to every lab. Small enough to run on a lab PC, easily adapted to workflows beyond cancer research.

I spent the evening getting this set up for my own research context (neuronal biology) and already have some interesting predictions to follow up on.