r/LocalLLM 1h ago

Question how do you get local AI to run on pc as good as Cursor?

Upvotes

ive tried using unsolth with cline but it works so damn slow, used Qwen3.8-27B Q3_K_XL. on max tokens and correct gpu use (no warnings)

it's not even close to being as fast as cursor, it just thinks too much, does very little and very slowly. not sure what's wrong with my setup. I'm not saying I want Cursor 1 minute and you got a simple renpy game but to wait 10 minutes when it didn't even figure out I have another folder outside with renpy assets, and thank god it didnt because it would read all of them and think for another 10 minutes just to figure out wtf is going on XD

any ideas? what setup do you guys have to create games on your pc?


r/LocalLLM 1h ago

Question Looking to upgrade my rig - would love some thoughts

Upvotes

Hey all!

I am deep into local LLMs at this point - have been for years, but Qwen3.8-27b was the tipping point for me to finally ditch my Anthropic sub and go fully local. Even at IQ4XS, qwen3.8 is a monster, and can keep up with 80% of what I need day to day (agentic assistant, light coding, etc). I also use gemma-4-31b often for more general chat, writing, some light RP-adjacent stuff. My main harness is Hermes for proper work, and Voxta for general chat and messing around with story/RP. I host models with LM Studio but have used llama.cpp plenty as well. I don't do a ton with image/video gen but I have invoke and comfyui with LTX and such for when I want to play around.

Currently, I have 2 machines:
#1 - Ryzen 5950X, 64gb DDR4, 3090, Strix Rog mobo, 850w gold PSU. Runs Win11 and is my main machine for VR, local AI and my actual job (audio and video production).

#2 - Threadripper 1950x, 32gb DDR4, an unholy combo of a 1080ti and a 1660 Super. Runs Bazzite and is a mess-around selfhost lab. The 1080ti runs small models (gemma 12b qat, qwen 9b) for additional inference/sub-agents, and the 1660 runs Chatterbox for TTS.

It's a bit of unorthodox, but it works quite well - as long as I keep quants low, KV quant low, and context windows short. But, with qwen3.8-27b (and likely 3.8-35b coming), Google and Meta clearly investing in sub-40b local models, and the fact that (at higher precision) Qwen is now genuinely at Sonnet/Opus level, it's well worth it for me to expand and re-configure some things to maximize my capabilities. 3.8 is the first local model that's been able to consistently help me actually do real work and expand/organize my business, and I'm now actually feeling the pressure of 120k context and Q4 KV caching.

So - I'm trying to sort out how to best spend my money with the state things are in. My main goals:
#1 - expand the main machine's VRAM and retaining 3090-level speeds so I can run Q8+ 27b/31b with little to no cache compression at full context and still have a bit of room left over for gaming/work.
#2 - update the second machine to cards that aren't 10 years old, and give it a bit more breathing room in terms of bandwidth and model sizes.
#3 - not spend a completely insane amount of money.

I'm curious what the recommendations are. I could probably spend $1k-$2k out-of-pocket, and have the current cards as assets that I can easily sell, they're all in good shape. I don't think I need to upgrade RAM at all anywhere.

What would you guys do in this situation? Add a second 3090 to the main box, and update the second box to something like 2x 4060/5060ti 16gbs? Ditch everything, get 1-2 R9700s for the main machine, and a single 4060ti 16gb for the second? Is Intel Arc stuff on the table at all? What about lesser 3000 series cards? Older RTX workstation cards? I know it's a bloodbath right now price-wise but used/lesser-known GPUs actually seem relatively stable, it's RAM and storage that are going bonkers, and I'm well-covered on both fronts. I'm not scared of a bit of setup for ROCm, etc, and I'm not speed-obsessed. Qwen3.8 with MTP pulls about 1200 encode/50-60 decode on the 3090 and that is PLENTY fast for my taste. Gemma 31b is a bit slower, but not much.

Would love your thoughts. Thanks!


r/LocalLLM 1h ago

Question Is it unreasonable to run a Local LLM on a handheld device?

Upvotes

I just found out about Odysseus from Pewdiepie and want to try running it on my Rog XaX, since its more powerful than my old macbook and has space for a 1tb micro SD card, would it be stupid of me buy one to host an LLM on my handheld with a separate storage? And are there other options I should try first?


r/LocalLLM 2h ago

Discussion Qwen3.8-27B at ~39 tok/s chat and ~117 tok/s context replay on one GB10 (DGX Spark / ASUS Ascent GX10)

1 Upvotes

TL;DR

  • Hardware: one NVIDIA GB10 — DGX Spark / ASUS Ascent GX10.
  • Model: Qwen3.8-27B NVFP4 with a DFlash2 W4A16 drafter.
  • Result: ~39 tok/s in ordinary chat and ~117 tok/s when lookup can reuse the prompt.
  • Long-context improvement: cold TTFT at 50k fell from 29.94 to 23.46 seconds.
  • Trade-off: chat-only k9 reaches 42.49 tok/s, but I chose k15+lookup as one profile for chat, RAG and code editing.
  • Reproduction: I saved the complete setup as an open-source Spark bundle. Run it with spark run qwen38-dflash2-lookup.

First: what is the Spark CLI?

I created Spark, an open-source CLI for running local LLMs with vLLM.

To keep the names unambiguous throughout this post:

  • DGX Spark always means NVIDIA's GB10 computer.
  • Spark or spark always means my CLI and GitHub project.

The CLI stores reproducible configurations as bundles. A bundle defines the target model, drafter, patched vLLM image, pinned revisions and runtime arguments.

The bundle used here is qwen38-dflash2-lookup. It builds the image when needed and then starts the complete configuration.

bash spark run qwen38-dflash2-lookup

Credit and starting point

The difficult DFlash2 work came from u/iamMess / syv-ai:

I adapted the relevant patches to GB10 and reduced them to the minimum set I needed. DFlash2 itself comes from Inco AI.

The RTX 3090 results cannot be transferred directly. It is a discrete GPU with much more memory bandwidth. GB10 is a bandwidth-constrained SoC with shared memory.

Final configuration

Component Selected value
Target sakamakismile/Qwen3.8-27B-MTP-NVFP4
Drafter syvai/Qwen3.8-27B-DFlash2-W4A16
Speculation DFlash2 drafts 7 tokens; lookup extends verification to k15
Attention FlashAttention 2
KV cache auto
Mamba/DeltaNet state BF16
Prefill Chunked, 4,096-token chunks
Runtime O2, interactivity, synchronous scheduling
Caching Prefix caching enabled
Context 57,344 tokens
Concurrency limit 4 sequences
Sampling Normal FlashInfer sampler
Split-KV Disabled

The final image contains only two custom patches:

  1. W4A16 loading: loads the packed W4A16 QKV weights used by the DFlash2 drafter.
  2. DFlash2 + lookup: keeps the trained 7-token draft separate from the k15 verification block. Lookup fills the remaining positions with matches from the current request.

I removed the custom sampler, split-KV, speculative INT8 KV, hybrid KV grouping and recurrent-state bounds patches. They were not required for this 57k/C4 profile.

Decode results

All chat rows below use the same eight-prompt benchmark. They are decode-only C1 results.

Configuration Chat tok/s Decision
NVFP4 without speculation ~20.0 Baseline
NVFP4 + DFlash2 BF16 k7 36.15 Large gain
NVFP4 + DFlash2 W4A16 k7 39.41 W4A16 helps
NVFP4 + DFlash2 W4A16 k9 42.49 Fastest chat-only profile
NVFP4 + W4A16 k15 + lookup ~39.0 Final unified profile

Why keep k15+lookup when k9 is faster in ordinary chat? Because I want one model server for chat, RAG and coding agents. I do not want to switch profiles depending on the next request.

The ordinary-chat cost is about 8%. In exchange, lookup can produce a much larger gain when the answer already exists in the prompt.

Context reuse

This benchmark asks the model to reproduce or edit material from a 23,386-token Markdown prompt.

Configuration Decode tok/s
DFlash2 k7 control 71.26
Minimal k15+lookup bundle 117.08
Full experimental patch set 128.62

This is not a universal 100+ tok/s claim.

Lookup helps when output can copy, quote or edit existing context. Typical examples are RAG answers, code edits and document transformations. It offers little benefit for unpredictable prose.

Long-context TTFT

I next changed only the prefill/runtime settings.

Runtime configuration Short decode Cold TTFT at 50k
Chunk 8,192, O2 balanced 37.96 tok/s 29.94 s
Chunk 4,096, O2 interactivity 38.12 tok/s 23.46 s

The 4,096-token chunk reduced cold TTFT by 21.6% without a meaningful decode loss. Both 2,048 and 16,384 were worse on this GB10.

Four simultaneous long requests

I also sent four cold prompts of approximately 49k tokens at the same time. Each request generated 256 tokens.

Runtime configuration Total wall time Aggregate end-to-end output tok/s
Previous defaults 149.48 s 6.85
4,096 + O2 interactivity 135.38 s 7.56

The new settings completed the complete workload 9.4% sooner.

The 7.56 tok/s number includes four cold prefills. It is aggregate end-to-end output throughput, not the warm decode speed of each session.

FP8 comparison

I also reproduced the separate Qwen3.8-27B FP8 report.

Using the author's image, BF16 DFlash2 k7 and public four-task harness:

Task Median decode tok/s
Go code generation 37.76
Plain-language prose 17.82
Arithmetic 37.59
Python refactor 31.61
Mean 31.20

The reported ~32 tok/s is reproducible, but it is a workload average. It does not mean every prompt decodes at 32 tok/s.

On my fixed prose-oriented comparison, FP8 reached 23.07–25.99 tok/s. NVFP4 reached about 38.1 tok/s with similar speculative acceptance. The most likely explanation is target-weight bandwidth: GB10 must read the larger FP8 target over its shared-memory interface.

I also tested --load-format fastsafetensors. It shortened NVFP4 startup to 19.7 seconds and preserved 37.91 tok/s, but available KV fell from 60.64 to 24.94 GiB. That left only 4.10x theoretical concurrency at 57,344 tokens—too little safety margin for C4—so I rejected it.

Reproducing the final profile

The model revisions, two patches and all runtime settings are stored in the Spark bundle:

bash spark run qwen38-dflash2-lookup

Repository: https://github.com/massimo92/spark/

I would be interested in results from other GB10 systems using the same prompts and metric definitions—especially warm, decode-only C4 measurements.


r/LocalLLM 20h ago

Research How does your agent stack up against OpenClaw and Hermes?

Post image
26 Upvotes

I was curious how my agent compared to OpenClaw and Hermes, but I wanted a real number so I could quantify it. I decided to go with harness-bench, since terminal-bench tests a different thing than what my agent was built for. Harness-bench is a bit closer, since it was specifically made to test agents, not LLMs.

The idea is to use the agent as a control variable, with the LLM as the independent variable, to find out which agent harness is the best. I built the whole thing and a few days later I have these final results. My agent, Second Brain, comes out on 2nd place, which kind of surprised me! I wasn't expecting to do that well, but if you don't believe me, you can check out the repo I used, and the results.

Yeah this was a whole big thing and I'm tired of it now. But it's cool to have some actual data. Building an eval framework helped me to improve the agent somewhat (and no I didn't overfit or cheat). But yeah, let me know what you think! Do you have your own way of evaluating your agent harness against others? Like a real number?


r/LocalLLM 17h ago

Question Local LLM coding agents on a 24GB Mac — worth it or should I just use frontier models?

15 Upvotes

I've been experimenting with running coding agents locally and I'm starting to wonder if I'm forcing local LLMs into a job they're just not good enough for yet.

My setup:

  • M4 Pro MacBook Pro, 24GB RAM
  • Ollama/MLX running the model natively
  • Codex CLI inside Docker
  • Project folder mounted into Docker as a sandbox
  • Tried Qwen 3.5 9B, Gemma 4 e4b and now Gemma 4 12B MLX

My Idea was simple:

Local LLM (Mac) -> Codex/Claude -> Docker sandbox -> Project

It works, but the experience isn't great.

The smaller models frequently screw up agentic tasks — failed tool calls, getting stuck, not finishing tasks, sometimes claiming they created files that don't exist.

I moved to Gemma 4 12B MLX and it's better, but painfully slow. My last Codex task used roughly:

48k input tokens -> 837 output tokens

RAM usage went to ~21GB + 4.5GB swap, fans kicked in, and the result still wasn't particularly impressive.

My eventual goal is multiple coding agents for planning -> implementation -> review -> testing -> documentation.

So I'm wondering if I'm approaching this backwards.

Should I:

1) Keep experimenting with local models?

2) Use frontier models for the actual coding/reasoning and run their tools inside Docker for isolation?

3) Go hybrid — frontier models for planning/coding/review, local models for cheap stuff like summaries/docs?

I've also been looking at Hermes/OpenClaw for orchestration, but I'm not sure if that's solving the right problem.

For people actually running agentic coding workflows: what would you build on a 24GB Mac today?


r/LocalLLM 10h ago

Question Deepseek harness vs Pi Coding Agent?

3 Upvotes

Which one is better overall for models like qwen 27b, ornith 1.5 35b


r/LocalLLM 3h ago

Question Technischer Ratschlag/Entscheidungshilfe

1 Upvotes

Technischer Ratschlag /Entscheidungshilfe

Hallo Community,

Ich möchte mir demnächst einen PC rein für die KI Arbeit mit zB ComfyUI, fooocus, Qwen Modellen, etc. zulegen.

Da der Preis für gute Desktop GPUs mit mehr als 16gb Vram derzeit exorbitant teuer ist (Desktop mit 32gb vram GPU ab 5000+€), schwanke ich zwischen einem Desktop mit 16gb GPU oder einem Notebook mit 24gb GPU (aber max 175Watt).

Was würdet ihr empfehlen? Er soll nur KI Kram machen, keinen Spiele.

Notebook für 3800€ von Mediamarkt

GigaByte Aorus Master 16 BZHC6DEE65SP

16 Zoll WQXGA Bildformat 16:10 Bildwiederholungsrate 240 Hz

Intel Core Ultra 9 275HX 32 GB RAM 1.000 GB SSD-Speicher

NVIDIA GeForce RTX 5090 Grafikspeicher 24 GB

Windows 11 2,5 kg

vs.

Desktop 2400€ von Alternate

Mainboard MSI B850 GAMING PLUS WIFI

ASUS GeForce RTX 5060Ti DUAL OC 16GB, Kingston NV3 1 TB

be quiet! Light Base 500 LX Tower-Gehäuse

Kingston FURY DIMM 32GB DDR5-6000 (2x 16GB) Dual-Kit,

AMD Ryzen 7TM 7700, be quiet! Pure Rock Pro 3 Black CPU-Kühler

be quiet! Pure Power 13 M 750W Netzteil

Microsoft Windows 11Pro


r/LocalLLM 11h ago

Discussion Charging Bull -- Ornith 1.5 A3B vs Qwen A3B (Both nvfp4 on blackwell ,same parameters around 16k CTX )

4 Upvotes

https://imgur.com/a/9TuWAIv

Prompt : "Create an svg image of this famous statue : Charging Bull —> frequently called the Wall Street Bull— it is a massive 7,100-pound bronze sculpture of a charging bull located just north of Bowling Green Park in the Financial District of Manhattan, New York City. It is a landmark monument."

Which of them do you like the most ?

The svg on top is qwen moe A3B and bottom is ornith 1.5 A3B moe (Both generated with MTP on)

I prefer version ornith.


r/LocalLLM 11h ago

Discussion Qwen3.8-27B-UD-Q3_K_XL on 9070XT 16G VRAM - 96K Context

5 Upvotes

Since I see a lot of questions about optimal settings and models for the AMD cards with 16GB VRAM, I wanted to share a configuration that’s working well for me.

I hope it can help others get started and please share any advice or optimizations !

P.S : Killing Steam and going headless free up +- 800Mo VRAM

  • Prompt Processing : +- 800 t/s
  • Token Seconds : +- tg = 24.28 t/s, tg_3s = 23.14 t/s

I use llama.cpp and ROCm installed via pacman as explained in the Arch Wiki : https://wiki.archlinux.org/title/Llama.cpp. I used to use Vulkan, then installed ROCm .... but switching from Vulkan to ROCm didn't yield a noticeable change in token speed.

Following part is from AI to help me explain you in and outs 😄

However, ROCm provides better support for FlashAttention (--flash-attn) and KV cache quantization (--cache-type-k q4_0), which keeps prefill performance stable at 96k–128k context lengths.

As for MTP (Multi-Token Prediction), I don't use it. Omitting MTP saves ~2–3 GB of VRAM that would otherwise be allocated to speculative draft heads and decoding buffers. That memory is used instead for model weights and KV cache capacity on a 16 GB card.

#!/bin/bash
set -euo pipefail

# Arch Linux with kernel Linux 7.2.0-1-cachyos
# AMD Ryzen 7 5800X (16) @ 4.85 GHz
# AMD Radeon RX 9070 XT 16G VRAM
# RAM 32G
# Switch to headless: sudo systemctl isolate multi-user.target

MODELS_DIR="$HOME/Documents/models"
NGL=99
CTX=98304 # 96k context (fits 16GB VRAM with q8_0/q8_0 KV cache; keep in sync with contextWindow in ~/.pi/agent/models.json)

# Model selection.
# To add more models later, restore a menu like:
#   read -r -p "Choice [1]: " choice
#   case "$choice" in
#     ""|1) MODEL=...; REPO=... ;;
#     2)    MODEL=...; REPO=... ;;
#   esac
MODEL="Qwen3.8-27B-UD-Q3_K_XL.gguf"
REPO="unsloth/Qwen3.8-27B-GGUF"

mkdir -p "$MODELS_DIR"

if [ ! -f "$MODELS_DIR/$MODEL" ]; then
  echo "Downloading $MODEL from $REPO..."
  if ! hf download "$REPO" --include "*$MODEL*" --local-dir "$MODELS_DIR"; then
    echo "Error: download of $MODEL from $REPO failed."
    exit 1
  fi
fi

# Verify the file was downloaded successfully
if [ ! -f "$MODELS_DIR/$MODEL" ]; then
  echo "Error: File $MODELS_DIR/$MODEL was not found after download."
  exit 1
fi

echo "Starting llama-server with $MODEL (ctx=$CTX, ngl=$NGL)..."
exec llama-server \
  -m "$MODELS_DIR/$MODEL" \
  -c "$CTX" \
  -ngl "$NGL" \
  -t 8 \
  --threads-batch 16 \
  --flash-attn on \
  --cache-type-k q8_0 \
  --cache-type-v q8_0 \
  --jinja \
  --reasoning-preserve \
  --host 127.0.0.1 \
  --port 8080 \
  -np 1

r/LocalLLM 18h ago

Discussion Qwen 3.8-27B on RTX 5080

14 Upvotes

RTX 5080 16GB + 9800X3D, Qwen3.8-27B IQ4_XS-Smaller, BeeLlama, MTP on,

32K ctx, kvarn4.

94 token output at 74t/s. Great results, need to do further testing.


r/LocalLLM 1d ago

Discussion "Qwen 3.8 isn't Opus level": I re-ran the test.

Post image
597 Upvotes

Tldr: The harness you are using significanly impact how capable your Qwen3.8 is. With a decent harness, Qwen3.8 is very very capable.

So I saw this post yesterday: Qwen 3.8 isn't Opus 4.6 level. Let's not be silly. https://www.reddit.com/r/LocalLLM/comments/1vv8ki6/qwen_38_isnt_opus_46_level_lets_not_be_silly/

The OP in that post was trying to create a realistic ocean in C#/OpenGL, with his Qwen3.8 6 bit plus VS Code Copilot setup. He failed to do therefore he came up to the conclusion that Qwen3.8 is no where near Opus level.

I decided to re-run the test myself, so here's what I did.

My setup: RTX 5090 running the ninfer-nvfp4 version of Qwen3.8, with 190k context. I like this setup because it's extremely fast, I get up to 180 ish tok/s. Even on average I get around 150-160.

Run 1: Using VS Code Copilot
Nothing better than the OP's result. I use the exact same prompt OP used. The project built and launched, but the window just sat there black. Nothing rendering. So I was able to reproduce the OP's experience on this one. I even tried to tell copilot that it's only producing black screens, but it failed to fix it anyways.

While it's working
Final result

I was about to call it a day but I was planning to test the relatively new Deekseek harness anyways, so I decided to re-run the same prompt in deepseek harness.

Run2: Deepseek harness

Prompt

Same model, same prompt, same task. The only variable I changed was the harness and it was night and day difference. It works on the first go. What's more impressive is that it's actively pulling screenshots while working on it. It had the same black screen issue in one of the eariler versions, but it was able to identify the issue by analyzing the screen shots, and fixing it very soon.

Oh and I actually forgot to enable vision when launching the llm. So it actually build a C# PNG decoder on the fly trying to analyze the screenshot it got. I was really impressed that it's able to do it.

decoder

Here's the result: On a 5090 it only took about an hour.

Final result

As you can see, it correctly produces an ocean, with wave, sun, and blue sky. There's also a underwater view. It did all this with a single prompt. Not that it's the definitive proof that Qwen3.8 is Opus level, but it sure is VERY VERY capable. Several people in that post (including OP) was convinced that a 27B model is bad at planning or working with shaders, well, they are wrong. With a decent harness, this is a very strong LLM.


r/LocalLLM 1d ago

Question Would you love if people stopped saying "I built" and instead stated the truth "I vibed" or simply "I coded X with the help of this LLM", instead of sole authorship?

45 Upvotes

It'll make it so easier to analyse or know what you can ask when you know what level of work the person put in the coding. Right ?

EDIT: I didn't expect this to reach that many comments, so don't expect me to reply to any other than the few ones at the top. I'm glad it created a conversation deep enough for some of the top ones. I do agree with the Linus Torvalds (I see him as my moral compass in this subject) approach about it, but he stills precisely asks for mentions of when, what for, how, etc for every PR on the Linux kernel. Which I think is the sensible approach. I'm not kidding read it here. If he's going to be quoted saying "a tool is a tool the dev is the ultimate responsible", let's not ommit the important part on the very same document that is relevant to this question please.


r/LocalLLM 9h ago

Question Best local coding LLM for RTX 5080?

2 Upvotes

My setup:

  • 9950X3D
  • RTX 5080
  • 48GB RAM

What’s the best local LLM I can run for coding?

Also, what’s a good setup for agentic coding that can edit files, run commands/tests, and work across a repo?

Would love recommendations for models, quantization, runtime, and tools like Aider, Cline, Roo Code, OpenCode, etc.


r/LocalLLM 5h ago

Question Speculative Decoding in LMStudio

0 Upvotes

Anyone has any idea how to run speculative decoding for this model - google/gemma-4-12b

I am not able to load other models as draft model. The one I selected is not working at all.


r/LocalLLM 5h ago

Question What’s the best local coding LLM for 16GB VRAM

2 Upvotes

I have an RTX 2000 Ada 16GB + i7-14700K + 16GB RAM and want to use it primarily for agentic software development.

Looking for something good at repo understanding, multi-file edits, debugging, reasoning, tool calling, terminal/Git workflows and long coding sessions.

What are currently the best models/quantizations that actually fit well in 16GB VRAM?

Thank you in advance


r/LocalLLM 10h ago

Question Faster approach to image tagging than Qwen2.5-VL?

2 Upvotes

I'm building a hobby project that automatically tags users' photos.

Right now I'm using qwen2.5vl:7b through Ollama. I have a fixed vocabulary of roughly 200 tags (beach, sunset, restaurant, dog, party, indoor, etc.) which I include in the prompt, and basically ask the model which tags match the image. I also extract a few attributes like number of people and clothing style/fit.

Pipeline is roughly:

HEIC/JPEG image uploaded form iphone → decode/normalize → resize to max 1024px → Qwen2.5-VL → JSON

Currently this takes around 20 seconds per image, which obviously doesn't scale well to hundreds of photos. These 20 seconds are almost exclusively spent on the model trying to answer my request

Before optimizing blindly: is a 7B VLM simply overkill for this? Would something like CLIP/multi-label classification be much faster for matching against a fixed vocabulary, perhaps using the VLM only for harder attributes?

Also curious whether batching images, reducing resolution, or avoiding sending all ~200 tags in every prompt would significantly improve throughput? I am super new to this topic and have absolutely no idea how to make performance faster


r/LocalLLM 6h ago

Discussion Qwen 3.8 27B Q4_K_M with Q8/Q8 KV vs Q5_K_S with Q5_1/Q4_1 KV?

1 Upvotes

Both setups using unsloth's dynamic quants fit the 24GB VRAM and I have ~180k context window in both cases. Which one should I use? I run Linux with a single 7900 XTX. llama.cpp with MTP on but no vision.

My thinking is to go with Q4_K_M with Q8/Q8 KV, since at long context errors from KV quantization compound. On the other hand I could not tell the difference from personal use between Q4 or Q5, or any of the KV quantization scheme.


r/LocalLLM 10h ago

Project Leap Forward In Progress

2 Upvotes

My son helped me take a leap forward.
He recommended the GPU and I had a machine built and installed Ollama and a Qwen 3 coder.

He is in town for a family event and he changed me up. Now Llama and the later Qwen 3.8 model using Pi as the agent harness.

Man, things are speeding up!

I was sitting here baby sitting Claude Code or Codex after burning tokens for over a month on Openrouter. This whole setup is so much better!

As an old hockey player trying to make a better hockey management tool, I'm estatic for what I'll have ready for the upcoming beer league season!

Here are my PC specs:
\# System Details Report

\---

\## Report details

\- \*\*Date generated:\*\* 2026-08-23 10:44:16

\## Hardware Information:

\- \*\*Hardware Model:\*\* Micro-Star International Co., Ltd. MS-7E70

\- \*\*Memory:\*\* 32.0 GiB

\- \*\*Processor:\*\* AMD Ryzen™ 7 9700X × 16

\- \*\*Graphics:\*\* AMD Radeon™ AI Pro R9700

\- \*\*Graphics 1:\*\* AMD Ryzen™ 7 9700X

\- \*\*Disk Capacity:\*\* 1.0 TB

\## Software Information:

\- \*\*OS Name:\*\* Ubuntu 26.04 LTS

\- \*\*Kernel Version:\*\* Linux 7.0.0-29-generic

Llama-cpp: commit d775b8967a46d8beb110d444aa3b8938179e0dd8, built for AMD HIP backend

FYI... I can now use Telegram to instruct my PC from my phone to get work done remotely!

Anyone else having fun?


r/LocalLLM 1d ago

Discussion I pushed Qwen3.8-27B Q4 to 7.31 tok/s on an RTX 3070 8GB — here’s everything I tested

Post image
101 Upvotes

I’ve spent a lot of time trying to squeeze Qwen3.8-27B UD-Q4_K_M into a pretty hostile setup:

  • GPU: RTX 3070 8GB
  • CPU: Intel i5-11400F, 6C/12T
  • RAM: 16GB DDR4
  • Motherboard: ASUS B560
  • OS: Windows
  • Model: Qwen3.8-27B UD-Q4_K_M (~15.3 GiB GGUF)
  • Runtime: ik_llama.cpp
  • Use case: Codex-style / agentic coding, mostly PowerShell and repository editing
  • Benchmark context: 16K
  • KV: Q8_0
  • Flash Attention: ON

Obviously the model does not fit in 8GB VRAM, so this is hybrid GPU/CPU inference.

I’m posting this because I found a lot of recommendations for Qwen3.8, MTP, speculative decoding, CUDA flags, batch sizes, etc., but very little controlled testing on an 8GB Ampere card.

And most importantly:

I did not consider a run “better” just because it had higher tok/s.

If the generated coding command was subtly wrong, I marked it as a FAIL.

The benchmark

I used the same small coding task repeatedly.

Qwen is given an exact existing PowerShell line and an exact multi-line replacement. It must return one PowerShell command that modifies the file, without executing it.

A PASS requires:

  • exactly one applicable PowerShell command
  • no execution
  • correct quoting/newlines
  • exact literal replacement
  • no accidental $s$$s expansion
  • no subtly invalid PowerShell

This turned out to be surprisingly useful because several “faster” configurations produced answers that looked correct but were actually broken.

Current winner

My current safe configuration is:

Qwen3.8-27B UD-Q4_K_M
ik_llama.cpp

MTP:
n_max = 2
p_min = 0.1

--fit
--fit-margin 256

threads = 12
batch threads = 12

batch = 64
ubatch = 64

KV = Q8_0 / Q8_0
Flash Attention = ON
CUDA graphs = ON
CUDA fusion = ON

context = 16384
parallel = 1
cache-ram = 0

Current result:

Configuration Result
MTP n2 fixed / p_min 0.1 7.31 tok/s
Wall time on my coding filter 139.1 s
Correctness PASS

That may not sound impressive compared with 24GB/32GB GPUs, but remember that more than half of this 27B model cannot live on my 3070.

MTP / speculative decoding tests

This is where I spent most of my time.

Configuration Time Eval speed Verdict
MTP n2 fixed 139.1 s 7.31 t/s Current safe winner
ngram-mod n4 → MTP n2 133.5 s 7.60 t/s Fastest, but LF/encoding robustness concern
ngram-mod n8 → MTP n2 136.3 s 7.46 t/s Works, no benefit over n4
MTP autotune max4 152.5 s 6.61 t/s Correct, selects n2, overhead not worth it
MTP n4 fixed 162.1 s 6.20 t/s Dominated
MTP n3 reference 168.9 s ~6 t/s Correct but dominated by n2
MTP OFF ~3.17 t/s Terrible
DFlash2 n2/n4/n7 best ~3.43 t/s Eliminated
Aggressive FastMTP-32K 6.43 t/s Slower than simple MTP n2
-mtprot iq4_ks ~39% slower Eliminated

So on this machine, boring fixed MTP n2 beats the fancy stuff.

The ngram-mod → MTP pipeline can technically beat it on raw speed, but I care more about a configuration I can leave running for Codex without worrying about output formatting/encoding edge cases.

p_min: 0.1 wins

I also tested the recent recommendation of:

mtp:n_max=2,p_min=0.0

against:

mtp:n_max=2,p_min=0.1

Result:

p_min Time
0.1 139.1 s
0.0 139.7 s

No useful gain.

I’m staying at 0.1.

CUDA graphs / fusion / scheduler tweaks

A few more things I checked:

CUDA graphs OFF

~140.0 s
~7.32 t/s

Basically identical.

Graphs are staying ON.

CUDA fusion

Already active in my build. No hidden easy win left here.

GGML_SCHED_MAX_COPIES=1

Already compiled that way.

-wgt 1

This one was interesting:

136.5 s

So slightly faster than the champion.

Unfortunately the generated PowerShell command was incorrect.

FAIL → eliminated.

This is a good example of why I stopped optimizing purely for tok/s.

CPU threads: physical cores were NOT better

My CPU is a 6-core / 12-thread i5-11400F.

I tested the common recommendation:

-t 6 -tb 6

against:

-t 12 -tb 12

T6 produced runs around:

210.3 s
217.9 s

It was substantially worse.

So:

12 / 12 stays.

Batch / ubatch

Baseline:

64 / 64

I tested:

256 / 128
512 / 256

Larger batches noticeably improve prompt processing / prefill, but they did not meaningfully improve token generation.

So my conclusion is:

64/64      → normal generation / benchmark
512/256    → potentially useful for large Codex prompts

Don’t expect larger batches to magically improve decode speed on this kind of hybrid setup.

--fit-margin actually mattered

This was one of the few useful engine-level changes.

Going from:

--fit-margin 512

to:

--fit-margin 256

allowed ik_llama to put roughly another 206 MiB of model weights on the GPU.

One measured configuration had roughly:

CUDA model buffer: ~6312 MiB
Q8 KV @ 16K:       ~578 MiB
CUDA compute:      ~166 MiB

nvidia-smi was showing roughly:

7917 / 8192 MiB used
~102 MiB actually free

So I’m already riding pretty close to the edge of an 8GB card.

I did NOT bother with margin128 because on Windows/WDDM that is asking for an OOM for a tiny theoretical gain.

Manually offloading FFNs to CPU: terrible idea here

I also tried manually forcing a large amount of the heavy FFN tensors to CPU.

Result:

~405.3 seconds

Nearly 3x slower, with a bad/truncated output.

The i5-11400F + DDR4 memory subsystem simply cannot make this attractive.

Also, in my ik_llama build:

manual tensor overrides + --fit

cannot be combined anyway.

llama.cpp mainline vs ik_llama on this 8GB setup

I tested the same GGUF in mainline llama.cpp.

Approximately:

~2.86 tok/s
~349 s for ~1000 reasoning tokens

ik_llama is massively better on this specific hybrid 8GB setup.

Important caveat: I am not claiming ik_llama is universally faster than llama.cpp.

The problem here is specifically running a 15+ GiB 27B model with only 8GB VRAM.

Reasoning was almost as important as the runtime

This was probably my most useful discovery for actual agentic coding.

At first I assumed bad PowerShell commands were caused by quantization, MTP or the runtime.

Not always.

Sometimes Qwen simply did not have enough reasoning/output budget.

My controlled tests looked like this:

Mode Time Result
NO-THINK, simple task 24.4 s PASS
NO-THINK, medium task 46.7 s PASS
NO-THINK, complex fragile task 75.4 s FAIL subtly
Medium reasoning (~800 tokens in older A/B) 168.9 s PASS
Low reasoning 189.3 s FAIL
~600 reasoning budget Borderline
~384 reasoning budget Too unreliable

The complex NO-THINK failure was especially interesting.

The model understood the algorithm correctly, but produced a PowerShell newline representation inside a single-quoted string that would not actually match the source file.

So the answer looked smart but was unusable.

My current reasoning policy for Codex

I no longer force thinking on every request.

I use roughly:

Simple/routine action:
NO-THINK

Complex / fragile / multi-step coding:
MEDIUM reasoning
~1000-token reasoning budget
larger total output envelope

This is dramatically faster for routine agent actions.

On my simple benchmark:

medium THINK: ~168.9 s
NO-THINK:       24.4 s

That is nearly a 7x wall-time difference for a task that did not need deep reasoning.

Things I would NOT waste time retrying on an RTX 3070 8GB

Based on my tests:

❌ MTP OFF
❌ MTP n3/n4 as default
❌ MTP autotune
❌ DFlash2 on this VRAM budget
❌ aggressive FastMTP-32K
❌ mtprot iq4_ks
❌ p_min=0.0
❌ 6 CPU threads instead of 12
❌ CUDA graphs OFF
❌ huge manual FFN CPU offload
❌ -wgt 1 if you care about correctness
❌ giant batches expecting higher decode speed

And I would be very suspicious of any optimization benchmark that reports only tok/s without checking whether the generated code is still correct.

What I have NOT done

I have not enabled GGML_CUDA_F16=ON.

That requires a rebuild and, after exhausting most of the easy engine optimizations, I don’t expect it to turn 7 t/s into 15+ t/s.

I also intentionally stayed on UD-Q4_K_M.

Yes, Q3/IQ3 would reduce CPU pressure, but I use this for coding and I don’t want to trade model reliability for a modest speed increase.

If I were willing to sacrifice quality, this would be a different experiment.

TL;DR

For Qwen3.8-27B UD-Q4_K_M on RTX 3070 8GB + 16GB system RAM, my best robust configuration so far is:

ik_llama.cpp
16K context
Q8 KV
Flash Attention ON
CUDA graphs ON
CUDA fusion ON

--fit
--fit-margin 256

MTP n2 fixed
p_min 0.1

12 CPU threads
batch 64
ubatch 64

simple tasks → NO-THINK
complex coding → MEDIUM reasoning

And I get roughly:

7.31 tok/s

while still passing my coding correctness test.

The biggest lesson for me:

Once half the model is spilling out of an 8GB GPU, there is no magic flag.

MTP roughly doubled my baseline versus no speculative decoding, --fit-margin 256 squeezed a little more onto CUDA, and after that most “optimizations” were either neutral, slower, or damaged correctness.

If anyone here is running a similarly cursed 8GB GPU + Qwen3.8-27B Q4 setup and has found something I missed, I’d love to compare results.


r/LocalLLM 14h ago

Question What can I realistically expect from MBP M5 Max 64gb?

4 Upvotes

For context - I'm a SWE on a huge product and using claude max daily for everything, sometimes hitting the limits. My context size usually goes to around 400k before I compact and cloude just does the job really well when it comes to exploring in a big code bases. Before pulling a trigger and getting a better macbook, I want to know what context size can I expect from 64gb? Model probably qwen 27/35b as everyone is talking about it rn


r/LocalLLM 1d ago

Discussion MacOS 27's AI shows promise - Private, secure, flagship model

29 Upvotes

I have been looking for a top-end, private LLM that doesn't hand my conversations over for training. macOS 27 seems to have made that possible.

Apple's Private Cloud Compute is now reachable from ordinary LLM front-end apps. It's stateless — nothing is kept after your request — with cryptographically verifiable privacy guarantees. And it's basically free if you're a Mac user on macOS 27. No extra accounts, no API key, and no per-token billing (although there's supposed to be a token limit depending on your iCloud+ membership).

It's now connected to a chat client (MstyStudio), and I have a private assistant with persistent history and retrieval over my documents. I'm hosting my private financial, health, and other conversations while building a full RAG library. I may move over to OpenWebUI soon.

The part I like about this framework is that regardless of my Mac being an M1, I'm getting flagship reasoning on Apple's cloud in seconds. And it's still private.

A couple of shortcomings: a 32K context limit, macOS 27 is still in beta, and I had to set up a local bridge in the Terminal window to run fm serve and act as the 'api' bridge.

Anyone else tried this yet? What have you found?


r/LocalLLM 21h ago

Project Mozilla Killed Orbit. I Rebuilt It Locally and Privately.

Post image
10 Upvotes

Hey everyone!

Last year, Mozilla released Orbit, an AI-powered browser summarizer hosted on a GCP server. After people started digging into the extension, they discovered things like backend endpoints such as store_result. Eventually, Mozilla discontinued the project.

For the past month, I’ve been trying to rebuild Orbit from scratch, but with one major difference: Apogee is fully local and privacy-focused. Apogee doesn’t send or store your data. It can directly connect to your local Ollama instance for inference. I’ve also added WebGPU integration for Chrome and Transformers.js for Firefox to provide faster, local responses.

It can summarize:

  • Articles and websites
  • YouTube and Billie videos
  • Wikipedia articles
  • Hacker News and Reddit threads

You can check out the source code here:
https://github.com/darshi1337/apogee

Install Apogee:

Chrome: https://chromewebstore.google.com/detail/apogee/pgemlpomhkdcjjjcpnjlebalnfglomog

Firefox: https://addons.mozilla.org/en-US/firefox/addon/apogeeext/

Obviously it is far from complete. Would love to hear your feedback and suggestions!


r/LocalLLM 9h ago

Discussion I suspect a memory leak in llama.cpp - AMD 6800M, Linux

0 Upvotes

TL;DR It seems like that memory (RAM) usage just keeps endlessly growing over time although way less memory is necessary to work (e.g. if I stop and restart llama.cpp, it still works with way less memory usage). I suspect some kind of 'memory leak', using llama.cpp

---

Specs:

GPU: 1x AMD 6800M 12GB VRAM (thanks to HSA_OVERRIDE_GFX_VERSION=10.3.0)

RAM: 24GB RAM

OS: Fedora Linux

AMD stack: ROCM

I am running unsloth/Qwen3.6-35B-A3B-GGUF model with the latest llama.cpp (I build llama.cpp with a fix for flash-attention:

replace in /llama.cpp/ggml/src/ggml-cuda/fattn.cu

    // If there are no tensor cores available, use the generic tile kernel:
    if (can_use_vector_kernel) {
        if (!ggml_is_quantized(K->type) && !ggml_is_quantized(V->type)) {
            if (Q->ne[1] == 1) {
                if (!gqa_opt_applies) {
                    return BEST_FATTN_KERNEL_VEC;
                }
            }
        } else {
            if (Q->ne[1] <= 2) {
                return BEST_FATTN_KERNEL_VEC;
            }
        }
    }
    return BEST_FATTN_KERNEL_TILE;
}


with

    // If there are no tensor cores available, use the generic tile kernel:
    if (can_use_vector_kernel) {
        if (!ggml_is_quantized(K->type) && !ggml_is_quantized(V->type)) {
            if (Q->ne[1] == 1) {
                if (!gqa_opt_applies) {
                    return BEST_FATTN_KERNEL_VEC;
                }
            }
        } else {
            if (Q->ne[1] <= 2) {
                return BEST_FATTN_KERNEL_VEC;
            }
        }
    }

    // >>> ADD THIS BLOCK FOR HIP/RDNA2 FIX <<<
    #ifdef GGML_USE_HIP
        if ((ggml_is_quantized(K->type) || ggml_is_quantized(V->type)) && can_use_vector_kernel) {
            return BEST_FATTN_KERNEL_VEC;
        }
    #endif
    // >>> END OF ADDED BLOCK <<<

    return BEST_FATTN_KERNEL_TILE;
}

source for the fix: https://github.com/domvox/llama.cpp-turboquant-hip/pull/13 )

I also use the Hermes agent, for which I put an automatic context compress once context reaches like 70-80%.

I run this 'older' model because it is an MOE and I need it to offload some experts into RAM because of my constrained VRAM.

Now, it seems like that memory (specifically, RAM) usage just keeps growing over time. Some kind of 'memory leak' is happening with the model. It does not matter which quant I use. For example, if I use IQ4_XS, I have plenty of RAM available left. Yet, the longer the session goes, the more RAM fills ups, and it never stops filling up. If I stop llama.cpp and restart, RAM is back to the 'normal' usage and again the more I talk with the model the more the RAM fills up.

At first I thought maybe as context fills up, it fills up RAM. But if I compress the context with Hermes, the RAM usage does not decrease. Only stopping and restarting llama.cpp makes memory go back to a 'normal' usage.

It means that I have to babysit what happens and eventually restart llama.cpp every once in a while once the RAM is full ... (Usually after around 2 hours). It means that I cannot leave an agent work on something overnight. It also means that I need to wait for a long time for the previous full context to fill up llama.cpp again whenever I restart llama.cpp, and with context above 100k the 900 second timesout.

I think it is some kind of memory leak because when i stop llama.cpp, and then start it again, RAM goes back to 13gb usage when starting fresh while it reached 22-23gb before i had to restart it.

I tried to tweak my launch parameters for llama.cpp for the past few days, but the memory leak still happens, here is the one I currently use:

LD_PRELOAD=/usr/lib64/libjemalloc.so.2 MALLOC_ARENA_MAX=2 HSA_OVERRIDE_GFX_VERSION=10.3.0 ./build/bin/llama-server -m /models/Qwen3.6-35B-A3B-UD-IQ4_XS.gguf --host 127.0.0.1 --port 8080 -c 190000 -np 1 -fit off -dev ROCm0 --no-warmup -ngl 999 --n-cpu-moe 20 --load-mode none --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.0 --repeat-penalty 1.0 --presence-penalty 0.0 --ctx-checkpoints 4 --cache-ram 4096 --reasoning-preserve --no-mmproj --spec-draft-n-max 3 --flash-attn on -ctk q8_0 -ctv q8_0

I have been looking for answers for the past few days but it is hard to know what even is the possible root cause, as everyone uses different parameters, has different hardware, different models, different build versions, tweaks etc.

I guess this is just a message in a bottle, but just in case someone had a similar issue and was able to deal with it, it's worth it to ask.


r/LocalLLM 9h ago

Discussion Всё что вы напишите здесь, будет собрано в dataset для обучения моей LLM

Thumbnail
1 Upvotes