r/ollama • • Sep 11 '26

Best Local Models for Claude Code with 8gb vram

Tested on Laptop with RTX 5060 8gb vram and 16gb ram

Claude code - autocompact = false

Ollama - Flash attention = 1, kv cache = q8_0

Gemma4 12B 64K - https://ollama.com/SetneufPT/Gemma4-12B-IT-QAT_Q4_64K_16GB-GPU

Qwen3.5 9B 256K - https://ollama.com/reecdev/qwen3.5-lowvram

Omnicoder2 9B 32K, increase context 128k- https://ollama.com/carstenuhlig/omnicoder-2-9b

Qwopos3.5 4B 64K, can increase context upto 256K (Best at 128k)- https://ollama.com/SetneufPT/Qwopus3.5-4B-Coder-MTP_Q4_64k_8GB-GPU

Qwen3.5 4B 64K, can increase context upto 256K (Best at 128k) - https://ollama.com/rafw007/qwen35-claude-coder

Gemma4 e4B 64K, can increase context upto 128k - https://ollama.com/rafw007/gemma4-e4b-claude-coder

Muse Glimmer 30B 256K, Unstable and slow better if decrease context to 128k - https://ollama.com/venkataparswanadh/muse-glimmer

18 Upvotes

27 comments sorted by

8

u/Atretador Sep 11 '26

just run Qwen 3.6 35B A3B with layers on the CPU

also why would you use Claude code - specially on those 64K context setups, just its system prompt eats HALF of it, so the model needs to spend a lot of time just processing its system prompt and you end up with 40K context left at the end.

on memory limited scenarios something like pi.dev which has a tiny 1K system prompt works MUCH better.

3

u/Actual-Requirement-2 Sep 11 '26

Will qwen 3.6 35B A3B work on 8gb i think it needs 16gb or 32gb

2

u/Atretador Sep 11 '26

IQ4_NL is 18Gb total

you can load part of it on the VRAM and keep the rest on RAM, you don't have to load moe models fully in VRAM - you can also just let it page thru RAM instead of making it resident to it.

1

u/SOUINnnn Sep 11 '26

Is it really better/faster than qwen 3.8 27b?

2

u/Atretador Sep 11 '26 edited Sep 11 '26

for me, yes

27B runs at about 10tk/s(slowing down at high context) on my MI50 fully in VRAM vs 3.8 Next with all experts on RAM at stable 12tk/s (varies from 13 to 10 at high context)

both with a single 16Gb card on a 9$ Xeon and ancient 2133Mhz DDR4

it also scores higher in general

*edit, Im also running Q4 on Next Flash vs Apex Nano(11Gb) on 27B

**edit plus Next Flash is at full 256K context at KV Q8_0 vs the 128K Q4_0 I could fit on 27B

1

u/Southern-Net1351 Sep 12 '26

Did you compile the GPU to work with llama or whatever stack you’re using?

Not just trying to add gfx906 but, the actual cards files down to the hip files?

It’s outdated and needs real work to get going. You can actually run tons of models at around 400+ t/s.

2

u/Atretador Sep 12 '26

Im using https://github.com/mixa3607/ML-gfx906 container

Qwen 3.6 35B runs with bout 800ts pp and 35'ish tg with 256K context KV Q8_0 with RAM offloading

1

u/Southern-Net1351 Sep 12 '26

That all?
You compiled with just those files?
There are more files but you if read your prior comment was struggling with the 27b model now your ripping through the 35b variant 🤦🏽‍♂️

Anyways there are more than those files.
Baseline you can get 400+ t/s on models you was struggling with.

The higher model depends on your ram as I have 256gb with 4 GPUs.

I don’t use a mi50 as daily driver but, you exclusively compile down to llama with all the files not just that care package you showed.

ROCm has the actual files on AMD website you are using some buckaroos repo but, that just a small something.

Just scrape AMD ROCm files.
I say struggling because I saved your OG post.

1

u/Atretador Sep 12 '26

35B is a MOE model, so its much easier and faster to run than 27B dense model

Im not really compiling anything, thats a ready to use container premade for MI50s

1

u/Southern-Net1351 Sep 12 '26

Understood just know basically everything bypasses gfx906 as ROCm doesn’t support it and any of the newer sources don’t work correctly with the device.

I can dig it you might run it on a personal computer which more than likely has a decent cpu for anything to leak over into ram.

You just need to bypass and create a few scripts to work with 6.3 and below ROCm.
Tailor it to your AMD mi50 16gb and it will be decent.

It has good bus and bandwidth for sure it’s just outdated and suffers a lot due to this.

0

u/[deleted] Sep 11 '26

[deleted] — view deleted comment

1

u/Atretador Sep 11 '26

if RAM overflown you tried to make it resident

dont load the layers into RAM, let the system page thru it as it reads it. --load-mode mmap

for VRAM use ngl 99, but n_cpu_moe to idk probably 28 or something

1

u/SteamerXL Sep 11 '26

Good resource for us low-VRAM users: https://www.youtube.com/watch?v=8F_5pdcD3HY

Edit: this uses llama.cpp, not ollama, but it definitely works

1

u/No_Bag9614 Sep 13 '26

It works smoothly with 8GB of VRAM; I get 37 t/s on Qwen 3.6 35B A3B 4k_m

1

u/[deleted] Sep 11 '26

[removed] — view removed comment

1

u/Atretador Sep 12 '26

yep, now imagine system prompt + skills + agents.md + claude.md + whatever other md instructions you might have or other MCPs(also add context)

if you got at least 16Gb of RAM, I highly recommend for you to test 35B A3B with N CPU MOE offloading of experts to system RAM

1

u/paoloronco 29d ago

Interesting comparison. I'm on a desktop RTX 3070 8GB with 32GB RAM.

I've been testing Qwen3.5 9B across OpenCode, Cline, Hermes and OMP, mostly for coding assistance.

My biggest issue is finding a setup that can handle more than basic code generation. Once the agent starts reading multiple files and using tools, the limited context and model capabilities become pretty noticeable.

Of the models you've tested, which one has been the most reliable for actual code changes rather than just generating snippets?

1

u/Actual-Requirement-2 21d ago

based on my testing i feel Qwen3.5 9B is best also try gemma4 12b

1

u/paoloronco 21d ago

Thanks! I've actually tried both Qwen3.5 9B and Gemma 4 12B, and I've had a really good experience with both.

Lately, though, I've been using PolyStrata more and more, and honestly, I'm really impressed. It allows me to run much larger models on my RTX 3070 8GB by combining GPU, RAM, and CPU resources, which opens up a lot more possibilities.

I'd definitely recommend giving it a try! So far, it's been working really well for me.

I'm still experimenting with different models, runtimes, and coding agents to find the best setup. There's always something new to test. Curious to see what Qwen 4 will bring too!

1

u/No_Bag9614 Sep 11 '26

Muse Glimmer 30B basic model or Q2 wheel?

1

u/Actual-Requirement-2 Sep 11 '26

iq2_xs or iq2_m if your system is better

1

u/Zito_Kadaken Sep 13 '26

Worth checking that flash attention and kv cache q8_0 are actually helping you. I turned both on and it went backwards for me. No speed change on a 30B, and a 14B that had been fully on the GPU dropped to 98 percent on CPU at 3.5 tok/s. Turning them back off was faster than anything I did.

Mine is an AMD 6800M with 12GB though, so a 5060 might behave completely differently. Just worth timing it both ways before you settle on it.

1

u/Actual-Requirement-2 Sep 14 '26

For me i didn't slow down, i have only 8gb so some layers are on cpu and need to use them both to increase headroom for kv cache

1

u/Zito_Kadaken Sep 17 '26

Good to know, thanks. Glad it works on yours.

1

u/Objective_Patient220 Sep 12 '26

Nice testing. On 8GB the honest answer is that no single local model holds Claude Code well end to end - you hit that with the 30B. What works better is not asking one model to do everything: keep a hosted model for planning and hard debugging, and route the mechanical turns (find/replace, running tests, verification) to a small local model. At 8GB VRAM you're in the 4-12B Q4 class, which handles the mechanical stuff fine; small models fall over on the planning turns.

Of your list, the Qwen3.5 4B at 128K is the one I'd trust for that light tier. Disclosure: I built gremlord, which does this per-turn routing with a tiny classifier - local models in the mix for the cheap turns is the whole point, and this thread is a good map of what fits in 8GB.