r/LocalLLaMA • • 17h ago

News another cut of nvidia gpu

Post image
823 Upvotes

r/LocalLLaMA • • 8h ago

News Latency doesn't lie: Jev is (probably) Qwen3.5-35B-A3B!

Thumbnail
modaic.dev
422 Upvotes

r/LocalLLaMA • • 12h ago

Resources Fine-tune Gemma 4 models

Thumbnail
gemma.ai
237 Upvotes

announced by googlegemma today:

"Want to fine-tune Gemma 4 on your own data, audio, receipts, or reasoning tasks? Our new fine-tuning hub is live on [censored for reddit]: 17 guides and 40+ illustrations covering the entire training pipeline. Ranging from continued pre-training and custom chat templates, all the way to (Q)LoRA and GRPO."

https://x.com/googlegemma/status/2125631619692429690

As you can see, different training techniques require different amounts of VRAM. The table below shows peak GPU memory (VRAM) across all five Gemma 4 models at a sequence length of 2,048 tokens:

ModelParametersQLoRAFull fine-tuning
Gemma 4 E2B2B effective~7 GB~32 GB
Gemma 4 E4B4B effective~9 GB~42 GB
Gemma 4 12B12B~11 GB~80 GB
Gemma 4 26B A4B26B (4B active)~21 GB~160 GB
Gemma 4 31B31B~22 GB~200 GB

r/LocalLLaMA • • 14h ago

Discussion SenseNova-Loop-9B (MLX 8-bit) three.js sky whale with a village on its back

212 Upvotes

Ran SenseNova-Loop-9B locally (MLX 8-bit, Mac Studio M5 Ultra) and asked for this: a huge gentle whale drifting through golden-hour clouds with a tiny storybook village on its back, windmill and lighthouse included.

Not one shot. I had it write the page in six parts (sky, clouds, whale, village, birds, buttons), each from its own brief, and when a part broke I sent back the console error or a screenshot with a note on what looked off, and it rewrote that part. All the code is its own; only three.js comes from a CDN.

The buttons let you ride along on its back and switch between golden hour, sunrise and a starry night.

Weights are on https://huggingface.co/sensenova/SenseNova-Loop-9B and the inference code is at https://github.com/OpenSenseNova/SenseNova-Loop


r/LocalLLaMA • • 18h ago

Resources Introducing Inkling 2 Mini Fast

Post image
196 Upvotes

Hi fellow llamas, it's been a while since I last posted :)

We wrote a blog post about releasing Inkling 2 Mini Fast: weight-tuned Inkling 2 Mini GGUFs that cut overthinking at default effort. On one Lucebox with our open-source ROCm engine, they run well ahead of published NVIDIA DGX Spark speeds.

Basically takes the model to answer 130 benchmark problems, from 668s on the base weights to 333s after tuning the overthinking out of them, and what that looks like on one R9700 next to published DGX Spark runs.

It dives into the different pieces involved: why every thinking token costs three passes on this model (the middle 12 layers loop three times per token), why lowering reasoning_effort wasn't the fix, weight tuning that halves output tokens while lifting accuracy from 83.8% to 87.7%, DSpark speculative decoding on an open-source ROCm engine (59 → 155 tok/s), prefill at up to 5x llama.cpp on the same card, and finally fitting the full 262K context in 32 GB of VRAM.

https://www.lucebox.com/blog/inkling2-mini-lucebox


r/LocalLLaMA • • 18h ago

Resources Looped Transformers:Thinking twice with the same weights

Thumbnail
huggingface.co
137 Upvotes

r/LocalLLaMA • • 23h ago

Resources Unlocking the Power of Loops in Pretrained LLMs with Loop Residuals

Post image
133 Upvotes

Looped Transformers iterate a shared block of layers to increase computation without adding parameters, offering stronger performance and test-time scaling. However, this power has so far required training from scratch and yielded only modest gains for LLMs. Finetuning existing models into loops is far cheaper, yet also brings only marginal gains over SFT. We propose LoopRes, an effective, scalable, and simple approach that turns loops into significant and consistent gains for pretrained LLMs. Building on Attention Residuals, LoopRes lets each looped layer attend directly to the outputs of earlier loops. Since these outputs are iterates of the same layers and become harder to tell apart, we give each a trainable loop-aware key that encodes its structural identity. Attending to all earlier loops also lets layers skip intermediate ones, so we restrict each layer to a residual window of the latest W loops, forcing every loop to build incrementally on recent ones. Across 6 pretrained LLMs from 3 model families and 9 benchmarks, LoopRes delivers significant and consistent gains: at 2× compute, it improves Qwen3-1.7B-Base by 29.1% over SFT, more than doubling the gain of the state-of-the-art baseline. The gains hold on larger models up to 30B and across all three families. More importantly, from 1.7B to 8B, LoopRes scales more steeply than SFT as compute grows, reaching a higher ceiling while needing less compute on long outputs. These results establish LoopRes as an effective looping approach, delivering both better performance and better test-time scaling.

paper https://github.com/NUS-HPC-AI-Lab/LoopRes/blob/main/docs/paper.pdf

code https://github.com/NUS-HPC-AI-Lab/LoopRes

model : https://huggingface.co/oahzxl/LoopRes-Qwen3-1.7B


r/LocalLLaMA • • 17h ago

News 3x speedup of DFlash2 for Inkling2m on llama.cpp (50 -> 150 on code tps)

Thumbnail github.com
129 Upvotes

Hey everyone! I know that just merged llama.cpp 1.1.0 will offer full Inkling 2 Mini support and so I played around with the branch a little. I have discovered that DFlash2 was really slow with it, so I debugged it and found that llama wasn't supporting looping transformers super well in it's drafters.

I looked around a found a fork with a potential fix here https://github.com/renoirvieir4/llama.cpp/commit/0280b55a24727af3d2bb53dddb6faf1da358b44e

I've tested it with 1.1.0, cut it a little and opened a PR in the link that you can now grab and build locally, getting the best experience of this model with no compromises:

SetupCode tok/sProse tok/s
Official b12726 + Inkling DFlash251.051.2
Patched master + Inkling DFlash2158.085.7

Huge thanks to https://github.com/renoirvieir4 for the OG fix!


r/LocalLLaMA • • 20h ago

Discussion Feedback requested: We're training harness adapters for Inkling-2-Mini and Qwen3.8-Flash-Next in public: weights, data and intermediate GGUFs are already up

118 Upvotes

Hey r/LocalLLaMA,

We're training a new batch of harness adapters and running the whole thing in the open, as it happens. That means you get the checkpoints while training is still going and your feedback on the checkpoints will be worth a lot.

What's training right now:

  • Inkling-2-Mini (Thinking Machines) on three harnesses: Pi, Hermes and DeepSeek-Harness
  • Qwen3.8-Flash-Next (Qwen) on Pi

What's open right now:

  • Weights, including intermediate checkpoints
  • GGUFs of the intermediate checkpoints, so you can run them in llama.cpp, LM Studio, Ollama and so on
  • Training data
  • Experiment logs, plus the decisions we make along the way, including the ones that go wrong

Live dashboard: https://harness-hub-community-adapters.hf.space/

On the dashboard you can:

  • See the live status of each training run
  • Get the commands to download any intermediate checkpoint
  • Comment on experiments and results with a Hugging Face account
  • Follow the new RL environments we're building in parallel

Let's build together the next generation of harness adapters!


r/LocalLLaMA • • 12h ago

Showcase we ran inkling 2 mini (26b) on an iphone 16 pro with optimized expert offloading

116 Upvotes

hello llamas! atomic chat team here again

a couple days ago we got inkling 2 mini running on macs capped at 8gb of memory, so the next question was how low it can go. we put it on an iphone 16 pro (8gb ram) and recorded it. the typing, the search wait and the answer are sped up in the video and labelled on screen

first we made a 1-bit quant of it (AD-IQ1_S, 6.88gb, 79.5% top-1 and kld 0.278 vs bf16). we didn't want it to eat all of the phone's memory, so we set a 4gb budget for weights, kv cache and buffers (the app itself uses more on top of that). we load the moe experts from the phone's storage when the model needs them. that part is normal expert offloading

inkling runs its middle layers 3 times per token, so those experts get used three times as often as the rest. we keep them in memory and only stream the others from storage. we also start loading the next experts while the gpu is still busy with the current ones and that alone gave us about +40% decode speed

metric"what model are you?""find the last news about inkling 2 mini" (web search on)
decode3.0 tok/s2.9 tok/s
time to first token3.1 s39.3 s
tokens out15105

~3 tok/s is slow, but it runs. the 39 s on the second question includes the web search and reading the results back in

gguf: https://huggingface.co/AtomicChat/Inkling-2-Mini-GGUF

app we ran it in: https://atomic.chat


r/LocalLLaMA • • 22h ago

New Model internlm/Sage-Interaction · Hugging Face

Thumbnail
huggingface.co
87 Upvotes

Sage-Interaction is a 9B-parameter omni interaction model built on MiniCPM-o 4.5. It processes streaming audio and video and generates speech in real time. It can respond to interruptions, resume after brief user acknowledgments or background speech, and react to changes in a live video stream.

The model can delegate longer tasks to a backend while continuing the conversation. The frontend handles real-time interaction, and the backend performs longer reasoning or tool-assisted tasks. When the result arrives, the frontend brings it into the ongoing conversation.


r/LocalLLaMA • • 21h ago

Discussion Which QFN quant are you using right now?

53 Upvotes

We have so many options to choose from, from ISTA, to Gyro, to Unsloth, etc ...
I personally have 24gb vram + 64gb ram, and I have used ISTA IQ3S, Gyro-M and currently running Unsloth IQ4XS at 65t/s on my AMD card which is great.

Things I have noticed now that I moved from ISTA to Unsloth v3.1 IQ4XS is that it seems more pragmatic in how it talks, it's more "steady" as in "accurate" with how it moves forward with its direction and reasoning, also the way it speaks is completely different than ISTA, I think it even thinks much less in comparison seriously.


r/LocalLLaMA • • 14h ago

Showcase Fine-tuned Gemma 4 26B-A4B for Home Assistant – GGUF available

51 Upvotes

Hey everyone,

I've been working on a local LLM for my Home Assistant setup and ended up fine-tuning Gemma 4 26B-A4B for smart home control and tool calling. I've been using it in my own home for about two months now, gradually improving it based on everyday use.

The main focus was improving everyday smart home interactions, especially in German, while retaining general conversation and function calling capabilities. The training also includes varying device inventories and room configurations to avoid overfitting to a single household.

A few technical details:

  • Based on Gemma 4 26B-A4B
  • Q4_0 GGUF (14.62 GB)
  • Focus on Home Assistant and Music Assistant
  • Native Gemma chat template and tool calling
  • German-focused training with additional English examples
  • Trained with reasoning disabled

The adapter scored 93.75% across 800 cases in my internal tool-calling development benchmark. However, this is not an independent benchmark, and I haven't repeated the full evaluation on the quantized model yet.

It's still experimental and has some known limitations, particularly around safety-sensitive device commands.

I figured I'd upload it in case anyone else is experimenting with local LLMs for Home Assistant and finds it useful.

https://huggingface.co/Maxinger15/LunaraHome-26B-A4B-GGUF

I'd be interested to hear how it behaves with other people's Home Assistant setups.


r/LocalLLaMA • • 20h ago

New Model Has anyone tried Raon-1-mini yet?

51 Upvotes

Has anyone tried https://huggingface.co/KRAFTON/Raon-1-mini yet? It seems to beat Qwen 3.6 35b (it is NOT a finetune). I tried it a little, it seems decent but I do not have any standardised way to measure model performance. Any experiences with it so far?


r/LocalLLaMA • • 4h ago

Showcase Libra-TTS: Text to speech with 16 languages, 0.3B, Apache 2.0

Post image
48 Upvotes

I made Libra TTS as part of my capstone project for my Master's degree in which I investigated compressing large models for on-device inference. Libra TTS is compressed (via SVD) from a model based on Qwen TTS-1.7B down to 0.3B but post trained for 16 languages, better prosody and accuracy and 8 default voices. (no voice cloning yet, I tried to grok it but I'm in a hurry to graduate). This size was picked to have a balance between quality and size for edge inference. It should work on most modern devices (especially Apple Silicon, which is what I've mostly tested with), much faster than realtime)

Languages supported:English, Chinese, Japanese, Korean, German, French, Spanish, Italian, Portuguese, Russian, Arabic, Hindi, Punjabi, Bengali, Urdu and Indonesian

I hope you all enjoy it. Licensed Apache 2.0.

DEMO on huggingface spaces:
https://huggingface.co/spaces/Ekam/Libra-TTS

https://huggingface.co/Ekam/Libra-TTS

https://github.com/ekambrar100/Libra-TTS


r/LocalLLaMA • • 14h ago

Resources Local Inference Lab Update: Almost 60,000 tok/s cold prefill (+82%) on DeepSeek-V4.1-Flash over PCIe (4× RTX PRO 6000 Blackwell) + upstream Flare scheduler upgrades

47 Upvotes

Follow-up to our earlier post on breaking 1,000+ tok/s on 4× RTX PRO 6000 Blackwell (SM12 0, PCIe — no NVLink) running DeepSeek-V4.1-Flash via NVIDIA Flare.

Last time, decode was already flying, while cold prefill sat around 31k–33k tok/s. Over the last few days we tore apart the SM120 prefill path and the speculative scheduler — and we just published a new signed gb202 release on Hugging Face that pushes cold prefill to 59,051 tok/s (peak 59,077 tok/s) on four PCIe workstation GPUs.

To put that in perspective: a 64K-token cold prompt (71k actual tokens) prefills in 1.20 seconds, and 128K (142.5k tokens) prefills in 2.46 seconds — verified via Prometheus flar e_prefill_tokens_total with 0% prefix-cache hit.


Cold Prefill Benchmarks (4× RTX PRO 6000 Blackwell, PCIe, 0% prefix reuse)

ContextActual Prompt TokensCold Prefill SpeedTTFTvs Previous gb202 Release
8K8,70044,712 tok/s0.194 s+43%
16K17,37951,264 tok/s0.340 s+57%
32K35,54056,997 tok/s0.624 s+72%
64K71,21259,051 tok/s (peak 59,077)1.205 s+77%
128K142,50857,944 tok/s2.460 s+82%

(Measured on 4× RTX PRO 6000 Blackwell with NVreg_EnablePCIERelaxedOrderingMode=1, --max-concurrency 32 --mtp-draft-tokens 7 --mtp-adaptive-verification --mtp-max-verification-token-budget 128 --mtp-adaptive-verification-alpha 1.0 --embedding-table-storage ram. Sanity-checked with greedy math, 4/4 partial-tail NIAH up to 32.5k, and 17.02M shared KV token capacity / 1 M max context per request.)


What's New — How We Nearly Doubled Prefill on PCIe GPUs (Without Touching Model Quality)

Almost the entire jump from ~32k → 59.1k tok/s comes from three stacked open-source changes (all 0-ULP bit-exact on attention):

  1. 2.27×–2.63× faster SM120 BF16 prefill MLA kernel (local-inference-lab/flashinfer#142):
    • Removed L2::evict_first thrashing on reused prefill KV gathers.
    • Doubled 16 → 32 heads per CTA (mg_n_hg = 2) in an 80.5 KiB hybrid SMEM layout — cutting KV gather & dequantization work in half with 0 bytes of register spills.
    • Compile-time split of SWA vs NVFP4 tile loops with hoisted vectorized scale loads and a bank-conflict-free 304 B NVFP4 staging stride.
  2. Full 20-layer row-sharded encoder attention (hyperflare-inference#508, hyperflare-recipes#29, #30):
    • Replicates encoder attention weights across TP4 (+2.32 GiB/rank) so all 20 encoder layers execute 4× row-sharded per rank instead of blasting full-chunk PCIe AllGathers/AllReduces across the bus.
    • Shrinks the Layer-20 encoder→decoder boundary gather by 64× — from 320 MiB down to 5 MiB (128-row active suffix only).
  3. Overlapped PCIe P2P transfers (hyperflare-recipes#30):
    • Routes encoder KV gathers over SM BAR1 P2P (DcpAllToAll) so the DMA copy engine overlaps MXFP8 FFN AllGathers completely behind attention, and hides Engram AllGathers inside the FFN compute window (prefill8192 shrinks from 6,839 → 5,379 CUDA graph nodes).

Bonus: Decode & Speculative Scheduler Upgrades

We also landed a scheduler upgrade upstream in Flare (main, already merged):

  • GPU Confidence Calibration + Cross-Lane Order-Statistic Allocation Surplus (NVIDIA/hyperflare-inference#515 — merged, plus follow-up #522 co-authored with @original-el8):
    • Previously, Flare's scheduler priced crowded packed speculative batches (B=16/32) from time-averaged per-lane acceptance curves, missing the fact that the GPU prefix allocator sees fresh per-step confidences across all lanes and cherry-picks the easiest (lane, depth) slots (Jensen's inequality).
    • By calibrating drafter confidence per depth/request and modeling the empirical cross-lane Lorenz concentration surplus, default alpha = 1.0 now beats the old main across the board (+9.3% on C=16, +18.6% to +20% on diverse/hard C=32 prompts, cutting unnecessary W=1 fallback by up to 35×) — no more alpha = 0.6 workaround needed!
  • Decode on this C32 release (alpha = 1.0):
    • C1 (unique prompt): 460.1 tok/s (5.95 ms/step)
    • 16k coding session (Tetris): 155.3 steps/s (6.42 ms/step), 612.4 tok/s end-to-end average
    • Diverse concurrent decode (512 out tokens each): 866 tok/s (C4) · 1,121 tok/s (C8) · 1,384 tok/s (C16) · 1,743 tok/s (C32) — and 2,668 tok/s on standard synthetic C=32 decode sweeps (2,704 tok/s at alpha=0.6).

Try It Now (Live on Hugging Face)

The new signed C32 (120-graph, 17.02M KV tokens) package is already live on the gb202 branch: 👉 https://huggingface.co/local-inference-lab/DeepSeek-V4.1-Flash-1017-FLARE/tree/gb202

docker run --pull=always --rm -it \
  --gpus '"device=0,1,2,3"' --ulimit memlock=-1:-1 \
  --security-opt seccomp=unconfined \
  -p 127.0.0.1:8000:8000 \
  -v flare-home:/home/flare \
  ghcr.io/local-inference-lab/flare:release \
  run local-inference-lab/DeepSeek-V4.1-Flash-1017-FLARE \
  --revision gb202 --filename model.safetensors \
  --gpus 0,1,2,3 --max-concurrency 32 --mtp-draft-tokens 7 \
  --mtp-adaptive-verification --mtp-max-verification-token-budget 128 \
  --mtp-adaptive-verification-alpha 1.0 --scheduler-policy balanced \
  --embedding-table-storage disk --prefix-cache-memory 64G \
  --kv-cache-limit memory --host 0.0.0.0 --port 8000

(With 320+ GiB host RAM, switch --embedding-table-storage disk to ram for full speed. Compatible with v0.2.3, with Flare main recommended for the #515 scheduler upgrade.)

local inference lab discord: https://discord.gg/gmvKSN3tVy


r/LocalLLaMA • • 16h ago

Discussion Closed AI endgame

35 Upvotes

Tinfoil hat moment. Well, no. Thing is, I think all of this is clear and not even hidden.

Dario's public appearances are more and more unhinged. He makes interviews saying, literally laughing, that soon AI will replace the whole workforce and AI megacorportions will have to give people a metaverse to entertain them and avoid worldwide unrest. It's such a perfect impression of a '50s villain that you expect him to end the interview with an unhinged cackle. But it's happening in real life.

Sam keeps a more sober facade, but from his interview the endgame is as much clear. OpenAI and Anthropic aim to develop ASI and literally govern the world. The models they provide are a way to gather trillions to develop this almighty ASI. "ASI will govern the world, and I'll command ASI!"

This is a distopian mix of pulp literature and cyberpunk foresight. It seriously is an existential threat. Now, it's not so easy. As Robert Heinlein admirably summarize, a button to launch nuclear weapons is useless if you can't press it. The monopoly of force still is in the hands of elected representatives which should be expression of the majority's will. It is yet to be shown how much this will stand where shit will hit the fan. It's many years that I think democracy as we know it is at the end of its useful life, but I thought it was a matter of several decennia. Now it seems things have accelerated beyond any reasonableness.

So, where do open models sit? Obviously they are needed to grant people access to what is going to be the most strategic asset ever. I guess we have to develop a way for the crowds to own model pretraining; the trickle of open frontier models won't last forever. The birth and affirmation of the FOSS movement has not been aimed at this specifically, but we are lucky it exists. Crowdsourcing frontier models is becoming urgent. Especially if you consider that with the recent turn of GPU producers, computing power is moving fast to concentrate in the hands of few instead of being distributed among people.

Fun times to be alive. I would never have thought to utter such an edgy sentence in fairness, but we open AI enthusiast are becoming the resistance.


r/LocalLLaMA • • 18h ago

Resources New models added to my SWE-Verified subset local benchmark : Flint, Hy4, Nanbeige, Inkling2Mini, Ling3.2Air, Nemotron, Bonzai2.5

Post image
33 Upvotes

Some good stuff waiting for Qwen4...

Also added some run with other engines like Basalt.

https://wonderrico.github.io/local_llm_benchmark/benchmark-main.html


r/LocalLLaMA • • 18h ago

Discussion capy-flash v0.16.5: LoopCD on Inkling 2 Mini. One flag, zero training, and on agentic tasks it stops spinning its wheels

Post image
31 Upvotes

Disclaimer. The agentic numbers come from our private bench: 9 real bugs taken from the history of a C++/CUDA inference engine, OpenCode with a cap of 80 steps, 3 trials per task, Claude Opus 5 as blind judge.

What it does. Inkling 2 Mini is a looped transformer: 12 of its layers run three times per token. LoopCD (Decoding Looped Transformers Better for (Almost) Free, Liu et al., Apple) exploits exactly this: it looks at what the model thinks after the first pass and pushes the final choice in the direction in which the later passes made it change. It does not touch the weights and requires no training. It acts only where the model is undecided between the first two tokens: where it is confident, nothing changes.

In capy-flash v0.16.5 it is an option off by default: --loopcd adaptive, with adjustable strength (--loopcd-omega, default 0.5 as in the authors' recipe).

Numbers:

  • agentic score 0.22 → 0.38, from 9th to 7th place out of 12, above Qwen3.8-27B NVFP4
  • it finds the spot to fix just as before, but writes the fix in 21 of 27 trials instead of 15, and earlier (step 40 instead of 55)
  • the gain is in medium-difficulty tasks: 0.11 → 0.50

The cost. Decoding loses 16.5 % with the MTP drafter, but per task the time rises only 4 %, because trials finish earlier. More patches that don't compile (6 of 21 vs 2 of 14). On normal text it predicts the next token worse: it's a thing for agents, not for chat.

Honesty: with 3 trials per task it's a strong signal, not a closed result (95% CI of the gain −0.03…+0.34). The authors report gains in the same direction on SWE-bench Pro, Terminal Bench and ARC-AGI v2 (post by Ruixiang Zhang).

github.com/ValerioDolci/capy-flash


r/LocalLLaMA • • 12h ago

Question | Help Deepseek V4.1 Flash 1017 EXL3 2.9bpw vs Qwen 3.8 Flash Next Q8

27 Upvotes

After using both Qwen 3.8 Flash Next Q8 and DS v4.1 flash 1017 EXL3 2.9 bpw (plus ten), I feel like overall quality of QFN is much much better.
To the point that I am seriously questioning the quants out there, even though the KLD of 2.9 bpw is impressive on paper.
I run QFN at 60-70t/s while DSv4.1F1017 at 35t/s, yet I feel like even at half the speed QFN would still be preferable for most tasks.

I am about to share also a small attempt I made to compare the two in 3D building and the output quality as well as the token efficiency, speed and intelligence in execution overall of QFN is just better in every way I could observe.

Am I doing something wrong here?
Any benchmarks worth running locally to check actual quants performances and compare models?


r/LocalLLaMA • • 15h ago

News Raon 1 Mini support has been merged into mainline llama.cpp

25 Upvotes

r/LocalLLaMA • • 18h ago

[Bi-Weekly Megathread] Project Showcase

24 Upvotes

Do you have something you'd like to share with the r/LocalLLaMA community. This is the place for it!

Recommendation on presentation:

  1. Please share plain english description of what your project does and why people should care about it
  2. How does it compare to existing options and why should people switch to your option?
  3. How have you tested and validated it? (i.e. can you show evidence that it wasn't vibecoded in a few hours by <insert current trending AI model>

NOTE: This community is geared towards open weight, open source, locally hostable software. Thus any closed source commercial service or other such projects will be removed.


r/LocalLLaMA • • 16h ago

New Model Dark Scarlett v1.0 26B A4B Uncensored - 0/686 refusals

Thumbnail
huggingface.co
22 Upvotes

Full story: https://rakshazi.me/blog/gemma-4-abliteration/

Quants: https://huggingface.co/rakshazi/Dark-Scarlett-v1.0-26B-A4B-Uncensored-GGUF

Clarification: SFW, blog post/model card/repo with scripts and recipes do not contain any unsafe materials


r/LocalLLaMA • • 16h ago

Showcase Lesson learned: Ollama's per-request context window was a trap. Switching to llama.cpp made my local D&D-style AI RPG up to 13× faster

19 Upvotes

Hello again!

A couple of months ago I posted about my game Warrior Quest and received a lot of positive feedback from the community.

However, I did get some suggestions to cut out Ollama. I was aware of the hatred for it on the subreddit, but it had a specific feature that I thought I liked.

You see, for my unique case of a video game, some of my queries don't require a large context window at all, so I thought I could increase performance by using a smaller context window on those queries. Ollama takes the context window as a per-request option, while llama.cpp sets it once when the server starts. Turns out that's a trap instead of a performance feature: changing the window size makes Ollama reload the model.

Each switch cost ~2.7 s against ~150 ms for a warm call, and switching back cost it again, so about 5 s every time it fired. The gains were negative. I fixed that on Ollama by giving each model one fixed window, so the numbers below are on top of that fix.

The other reason I clung to Ollama was cross-platform support. The game runs on Windows, Linux and Mac, and owning the GPU/runtime support was something I wanted to avoid, so I pushed the investigation down the priority queue (mind you, I was still developing the game and becoming a father, so I had a lot on my plate).

Last week I finally found time to try llama.cpp (llama-server), and the results were massive.

Why it's faster: every turn runs several stages (a router, a parser, the reply), and each has its own long system prompt. Ollama keeps one prompt cache per model, so the stages kept pushing each other out of it. With llama-server I give each stage its own cache slot and send every request to the slot that already holds its prompt, so a turn only reads the player's new line instead of re-reading ~3,000 tokens of prompt.

That's also why the slowest cards gained the most. A GTX 1660 Ti reads prompts at roughly 105-130 tokens per second, so re-reading a ~3,000-token prompt cost it 20+ seconds on one stage alone. Cache it and that wait is gone. A 4090 reads so fast it had less to win.

Time to first word of a reply, from the in-game speed test (qwen2.5 7B instruct):

HardwareBeforeAfterSpeed-upLess waiting
RTX 40901.3 s0.7 s1.86×46%
RTX 3060 Ti2.8 s1.3 s2.15×54%
GTX 1660 Ti (one tester's card)20 s5 s4×75%
GTX 1660 Ti (a different tester's card)41.3 s3.2 s13×92%
MacBook Pro M1 Pro (14C)5.7 s4.3 s1.33×25%

The answers didn't change: across my full test suites llama.cpp scored 566/567 and Ollama 567/567, with the one difference a borderline case.

And yes, the support burden I was worried about turned out to be real. The official CUDA build doesn't cover older cards, so I compile my own for GTX 10/16 and RTX 20. AMD and Intel run a Vulkan build, the Mac runs Metal, and Linux has its own builds. Ollama stays installed underneath as a fallback, so anything llama-server can't handle on a player's machine just drops back to the old path instead of breaking.

Thank you for reading! There is a speed test in the game and can be ran on the demo if anyone would like to add their own numbers/card to the list, or try out the game itself, it's really unique I think :)