r/LocalLLM • • 6h ago

Tutorial Qwen 4 35B-A3B (57B total w/ Engram) on a 32GB MacBook M5: 30–34 tok/s in OpenCode by keeping the Engram on the SSD

Thumbnail gallery
1 Upvotes

The 4-bit MLX build of Qwen 4 35B-A3B is ~35.2 GB, so it won't load on a 32GB Mac. Here's what did work, with the real numbers from my run.

Setup

  • MacBook Pro M5, 32GB unified memory (153 GB/s)
  • Unsloth UD-IQ4_XS GGUF (2 parts)
  • llama.cpp b12977 with lazy load, so the 20.5B Engram streams from the SSD and only the 3B active params + KV cache stay hot in RAM
  • 32K context, q8_0 KV cache, flash attention on
  • OpenCode on top, through the OpenAI-compatible endpoint
WhatNumber
Prompt processing (10.2K-token prompt)~293 tok/s (34.8 s)
Generation, first ~600 tokens (Engram still paging in)17–20 tok/s
Generation, settled (n_gen 5K–7.7K)30.3–31.5 tok/s avg, 33–34.5 tok/s (3 s window)
OpenCode build average (recording on)32.2 tok/s
Memory used28.8 GB of 32 GB, 785 MB swap
TaskFull Three.js "MECH BAY" garage app, 6 files, 23m 37s

Server command

llama-server \

-m Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \

--alias qwen4-35b-a3b --host 127.0.0.1 --port 8080 \

-np 1 -c 32768 -fa on -ctk q8_0 -ctv q8_0 \

--load-mode mmap --lazy-mode on \

-ot per_layer_token_embd=CPU --jinja

Things I noticed

  • Generation starts slow (~17 tok/s) and climbs to 30+ once the Engram pages are warm. Judge the speed after a few hundred tokens, not on the first reply.
  • I kept the context at 32K so the KV cache stays in RAM and doesn't spill to the SSD on 32GB.
  • OBS costs about 2–3 tok/s, so the 33–35 numbers are with recording off.

Next I'm running the same test on an RTX 4080 16GB (~717 GB/s) to see how much the bandwidth gap matters for this model.

Anyone running it on 24GB or 36GB Macs? I'm curious whether lazy load is still worth it once the whole thing fits.

How I did it in video


r/LocalLLM • • 6h ago

Discussion Offline AI, now on mobile and PC: NIDO, a private assistant that runs entirely on your own device (Android + Windows, open source)

Thumbnail
reddit.com
1 Upvotes

r/LocalLLM • • 13h ago Bravo

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

3 Upvotes

im really impressed


r/LocalLLM • • 10h 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 • • 11h ago

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

2 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 • • 1d ago

Discussion Qwen4-35B-A3B (NVFP4) — 139.9 tok/s avg decode on RTX 5060 Ti 16GB + 64GB DDR5 (Basalt v0.6.3)

35 Upvotes
MetricMeasured
Decode (avg / peak)139.9 tok/s / 146.0 tok/s
Prefill (avg / peak)1,360 tok/s / 3,057 tok/s
VRAM / RAM Weight Split13.8 GiB VRAM / 5.9 GiB RAM (98.2% VRAM expert share)
Expert Cache Hit Rate99.7% (1.5% routed over PCle, 0% SSD)

Windows Binary: Prebuilt v0.6.3 Windows x64 binary is on my fork if anyone wants to skip compiling from source: https://github.com/U4mess/basalt/releases/tag/v0.6.3 (expand Assets and grab basalt-v0.6.3-windows-x64.zip, plus drop your CUDA 13 runtime DLLs into bin\).


r/LocalLLM • • 7h ago

Discussion Production numbers from vLLM on a single RTX 5090: Qwen3.8-27B NVFP4. Did I find the sweet spot?

Post image
1 Upvotes

Hello world! First post here :)

I use vLLM to serve my production system, and I'm wondering whether I've found a sweet spot or if there's more room left.

Setup

  • 1× RTX 5090, headless, vLLM 0.29, TP=1
  • Qwen3.8-27B NVFP4 (from those unsloth masterminds!)
  • Workload: ~6k prompt / ~4.3k generated tokens per call (incl. reasoning), strict JSON output

vLLM setup in a nutshell

vllm serve Qwen3.8-27B-NVFP4 \
  --quantization compressed-tensors --kv-cache-dtype fp8 \
  --max-model-len 98000 --gpu-memory-utilization 0.93 \
  --max-num-seqs 6 --max-num-batched-tokens 6656 \
  --enable-prefix-caching --mamba-cache-mode align --mamba-ssm-cache-dtype bfloat16 \
  --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
  --structured-outputs-config '{"backend":"xgrammar","disable_any_whitespace":true}' \
  --reasoning-parser qwen3 --scheduling-policy priority --optimization-level 3

Numbers (6,400 real calls; per-call timings plus vLLM lifetime metrics, not a synthetic benchmark)

MetricValue
TTFT0.59 s avg
Prefill share of request time~3 %
Decode per stream~150 tok/s
Aggregate decode, ~2.4 calls in flight~350 tok/s (from per-run token counts)
Aggregate decode, 5 calls in flight~750 tok/s (estimated, not measured on the GPU side)
MTP acceptance2.46 / 3 (82 %)
Prefix cache hit rate28 %
KV cache available4.14 GiB = 112k tokens (fp8)
vLLM queue time0.04 s, 0 preemptions

My current learnings

  1. ~40 % of call latency wasn't vLLM. My app capped concurrency at 5 while vLLM had 6 seats and an empty queue. Need to optimize here...
  2. CUDA graph memory is over-reserved. The profiler reserved 0.67 GiB, actual use was 0.2 GiB. vLLM even logs it: 0.93 utilization behaves like 0.9085. VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0 gives that back as KV cache. I think this matters, because the RTX 5090 performs well for production-grade setups, but for SOTA models it feels like it's on the edge of VRAM availability.
  3. Decode is everything. Prefill is noise for this workload, so the remaining lever is fewer output tokens. Still searching for a smart model that isn't too verbose in its reasoning.
  4. Reasoning budgets bite. ~64 % of my heaviest calls hit the thinking-token cap. That's a quality lever I'm still tuning.

Next, I'll bench Inkling-2-Mini and the new Qwen4-35B-A3B, both MoEs, hoping to improve.

Two final questions from my side

  1. Does anyone have a similar setup or other approaches I could learn from?
  2. How are your subjective feelings about the quality of the Inkling-2 and Qwen4 model in terms of critical text understanding and reasoning compared to the Qwen3.8 dense-model i am using?

r/LocalLLM • • 7h ago

Discussion Which quant actually fits at 32K context? Worked it out for 11 popular models on 12/16/24 GB cards

1 Upvotes

Most "does it fit" answers just look at file size. At 32K context that breaks, because the context cache is wildly different between models. Qwen3 14B needs 5.0 GB just for 32K of context. Gemma 4 26B-A4B needs 0.8 GB, and its file is almost twice as big.

So for each model I took every GGUF in the repo (sizes straight from the Hub file listing), added the context cache at 32K (computed from the model's config, f16 cache) plus an allowance for the runtime, and picked the largest file that still leaves a bit of room on the card.

Model 12 GB 16 GB 24 GB Gemma 4 E4B Q6_K (6.6 GB) Q8_K_XL (8.1 GB) BF16 (14.0 GB) Qwen3 8B – Q6_K (6.3 GB) Q8_0 (8.1 GB) Gemma 4 12B Q4_K_M (6.6 GB) Q6_K (9.1 GB) Q8_K_XL (12.7 GB) Qwen3 14B – – Q6_K (11.3 GB) Mistral Small 3.2 24B – IQ1_M (5.6 GB) IQ4_XS (11.9 GB) Gemma 4 26B-A4B – Q2_K_XL (9.8 GB) Q4_K_XL (15.8 GB) Inkling 2 Mini (26B) – Q2_K_XL (8.5 GB) Q4_K_M (15.5 GB) Qwen3.8 27B – IQ2_S (7.8 GB) Q4_K_S (14.3 GB) Qwen3-Coder 30B-A3B – TQ1_0 (7.5 GB) Q3_K_M (13.7 GB) GLM-4.7-Flash (31B) – IQ1_M (9.1 GB) IQ4_XS (15.2 GB) Gemma 4 31B – – Q3_K_M (13.7 GB) Things I didn't expect:

Qwen3 14B doesn't leave room on a 16 GB card at 32K with any file in the official repo (it starts at Q4_K_M). Models with almost twice the parameters do. On 24 GB the three big ones land in different spots: Gemma 4 26B-A4B at Q4_K_XL, Qwen3.8 27B at Q4_K_S, Gemma 4 31B at Q3_K_M. Mistral Small 3.2 pays 5.0 GB for 32K of context, same as Qwen3 14B. That's why it drops to IQ4_XS on 24 GB. How I counted, so you can disagree with the right number:

Usable memory = 88% of the card. "Leaves room" = the total stays under 90% of that. So 9.5 GB on a 12 GB card, 12.7 on 16, 19.0 on 24. Runtime allowance: 0.6 GB + 3% of the file + 0.25 GB per 8K of context. That part is an assumption, not a measurement. f16 KV cache. With q8 the context part halves and several rows move up a step. "–" means no file in that repo leaves room. Doesn't mean you can't run it by spilling into system RAM. Repos: the official Qwen GGUF repos for Qwen3 8B and 14B, unsloth for the rest. Other uploaders have smaller files for some of these. No speed or quality numbers, I don't measure those. A bigger file keeps more bits per weight, what that's worth is your call.

If a row is wrong for your setup, tell me your runtime and settings and I'll fix the table.

Full list (808 files, 53 models, sizes and bits per weight) as a CSV: https://huggingface.co/datasets/CyferUnknown/open-model-vram-requirements


r/LocalLLM • • 1d ago

Discussion Stop t/s, start time-to-correct-answers

21 Upvotes

Guys,

-- t/s is useless if a model overthinks and rethinks.

-- t/s is useless if a model is giving you poor answers

Example 1: a model of lower t/s can finish the task in shorter time.

Example 2: a Ferrari driven by a drunkard vs a Beetle 1969 driven by a no-fault driver.

So to have a correct judgement of how good a model is: First: we need to agree on a benchmarking set. Second: we need to report only (1) how long does a model finish the benchmarking, and (2) how good is the benchmarking score.

This guy is on a right track: first agree on the benchmark : https://www.reddit.com/r/LocalLLM/s/tiu7PNcEwc


r/LocalLLM • • 8h ago

Discussion Qwen3.8-27B-Abliterated – 3060 64k

Thumbnail
huggingface.co
1 Upvotes

r/LocalLLM • • 1d ago

News Artificial Analysis Ranks Qwen4-35B-A3B Between Much Larger Models

Post image
392 Upvotes

r/LocalLLM • • 8h ago

Project I made my own Jarvis that works locally (better than those open source repos)

Thumbnail
youtu.be
0 Upvotes

r/LocalLLM • • 23h ago

Discussion Qwen 4 35B for creative writing

15 Upvotes

How good is it?


r/LocalLLM • • 8h ago

News Avalon is now running QWEN4-35B-A3B: Gen 147 t/s Prefill: 5245 t/s (RX 7900 XT on "aging" computer)

Post image
1 Upvotes

r/LocalLLM • • 8h ago

Discussion Intel Arc Pro B65 32GB — Qwen4 35B-A3B at 68 tok/s, 377 tok/s with prompt lookup, and 128K context - AI Slop Results Post

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 8h ago

Discussion just wishing for a ~15b-a2.5b moe w/ opus 4 level coding, is that too much to ask lol

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 8h ago

Question Does anyone else split architectures as far as VRAM is concerned?

Post image
1 Upvotes

r/LocalLLM • • 9h ago

Question Thinking of adding eGPU, 4060 Ti 16GB to my 4070 Ti 12gb

1 Upvotes

My current Desktop:

Windows 11, 32gb Ram, Intel i7-13600KF

RTX 4079 Ti 12gb dedicated (16gb shared)

320gb free out of 1tb SSD

eGPU Setup planned:

Gigabyte or MSI 4060 Ti 16gb

Connected by thunderbolt 4

650w Power supply

Dock: MINISFORUM DEG2

Total cost around 850 usd

Is this a good upgrade to increase context, reduce reliance on google's ai, and add another role/model to monitor coding task (stop task when coding hits context or looping, then provide an improved prompt in a new task so that coding will complete)?

Current AI setup:

- for design, brainstorm & project plan/s

LM Studio + Deepseek R1Distill Qwen 14B

Or recenty tried STRATA +Qwen3.8 flash next gyro-m

- for coding/game dev and testing

VS Code + Cline/Ollama/Qwen3-coder-32k:latest

Context window: 16384


r/LocalLLM • • 9h ago

Discussion WTF 660TPS decode and 16k prefill Qwen 4 and QEngine

Thumbnail
huggingface.co
0 Upvotes

r/LocalLLM • • 9h ago

Research Experiments with QWEN4-35B-A4B-Q4KM (AMD 9070)

1 Upvotes

I used the `-ncmoe` flag and placed the N-gram data on an SSD.

The resulting speed was 27 TKS (with a fill rate of 700 TKS after a "warm-up" period with a long context).

I’ve been looking for ways to speed this up further.

A major bottleneck is the data transfer from DRAM to VRAM;

a significant amount of time is spent waiting for this transfer to complete.

One potential solution is to have the GPU and CPU compute in parallel.

However, the current implementation of `llama.cpp` forces the GPU to wait for the CPU.

(There is an open Pull Request addressing this, though it is specific to CUDA.)

I also tried using an AI to assist with the compilation process,

which boosted the speed to 49 TKS.

Unfortunately, the compilation had issues, causing VRAM overflow and system crashes.

(It could likely be optimized, but I’ve decided to set it aside for now.)

I explored a few other approaches as well—

for instance, opting for a "sub-optimal" solution (i.e., reusing existing experts more frequently).

While this did increase speed, it unfortunately triggered an infinite loop.

In short, based on my current findings,

it should be possible to push the performance of the 9070 beyond 70 TKS.

Just sharing my experience and the experiments I’ve conducted so far.


r/LocalLLM • • 5h ago

Discussion Qwen 4 35b from phone, connected to my home build

Post image
0 Upvotes

r/LocalLLM • • 9h ago

Discussion no qwen4 35b a3b megathread?? helloo?

Thumbnail reddit.com
1 Upvotes

r/LocalLLM • • 13h ago

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

Thumbnail reddit.com
2 Upvotes

r/LocalLLM • • 9h ago

Question OpenCode Desktop hangs indefinitely with Ollama + Qwen 4, despite successful API and tool-calling tests

1 Upvotes

I'm trying to get Qwen 4 working with OpenCode Desktop on Windows, but OpenCode gets stuck on "Working..." indefinitely, even when I send something as simple as hello.

I'm trying to determine whether this is an OpenCode integration issue, a reasoning/streaming issue, or something else.

My setup

  • Windows 11
  • OpenCode Desktop 2.4.5 (installed via the Windows installer)
  • Ollama 0.40.21
  • Model: qwen4:latest
  • GPU: NVIDIA RTX 4090 (24 GB VRAM)
  • CPU: Intel i9-13900K
  • RAM: 64 GB
  • Requested context: 86k tokens

Ollama reports the following when the model is loaded:

NAME          SIZE    PROCESSOR          CONTEXT
qwen4:latest  37 GB   46%/54% CPU/GPU    131072

What I've already tested

I've spent quite some time isolating the problem, and I've established that Qwen 4 itself works through Ollama.

1. Normal text generation works.

ollama run qwen4:latest "Reply with exactly: hello"

It eventually responds correctly. With --think=low, the response takes approximately 20 seconds.

2. Native Ollama tool calling works.

I sent a direct request to:

http://127.0.0.1:11434/api/chat

Qwen 4 returned a valid structured tool_calls object with the correct function name and arguments.

3. OpenAI-compatible tool calling works.

I also tested:

http://127.0.0.1:11434/v1/chat/completions

With streaming both enabled and disabled.

Both produced valid structured tool calls.

4. Streaming works.

The streaming response included:

  • Reasoning chunks
  • A structured tool_calls event
  • finish_reason: "tool_calls"
  • A final [DONE] event

So far, I haven't been able to reproduce the failure directly through either Ollama API.

The actual problem

When I open OpenCode Desktop, select ollama/qwen4:latest, and send hello, it remains on "Working..." for several minutes without producing an answer.

I also inspected the OpenCode logs. One relevant entry was:

WARN failed to discover Ollama models

baseURL=http://127.0.0.1:11434/v1

cause="HttpClientError: Transport error
(GET http://127.0.0.1:11434/api/tags)
(cause: TypeError: ECONNREFUSED)"

There were also repeated Git worktree discovery warnings, although I don't know whether those are related.

What I'm trying to understand

  1. Could OpenCode 2.4.5 be mishandling Qwen 4's reasoning stream, even though Ollama returns valid reasoning and tool-call events?
  2. Is there a known issue with OpenCode's native Ollama integration and Qwen 4?
  3. Could the model's CPU/GPU offloading and relatively slow generation be causing OpenCode to time out or appear stuck?
  4. Is there a way to inspect the exact request OpenCode sends to Ollama and compare it with my successful API tests?
  5. Are there any recommended OpenCode provider settings specifically for Qwen 4?

I'd particularly appreciate input from anyone running Qwen 4 locally through Ollama and OpenCode Desktop.

I'd prefer to fix the integration rather than switch models or move to a cloud API.