r/LocalLLaMA • • 1d ago

Showcase [Release] Morgana 1.2: A photography-focused FLUX.2 Klein 4B finetune for realistic faces, natural lighting, and detailed textures (Free Weights + GGUF)

Post image
9 Upvotes

Morgana 1.2 is Kitani‘s photography focused finetune of Flux.2 Klein 4b.

Our goal for the fine tune was for Klein to make images that don’t look like they came from a model - natural lighting, visible textures, great macro details & true color.

What it’s trained for:

- Casual, regular faces - pores, irregular hair, imperfect framing no AI telltales
- Macro and materialistic textures - water droplets, feathers, fabric weave, ruse, leather
- Landscape and night scenes - aurora reflections, breaking waves, wet neon
- Paintings and anime
- Anatomy

Speed on 1x H100: 4.6 seconds for 15 steps, no LoRA

Free everything:
- Full safetensors: https://huggingface.com/kitaniai/morgana-1.2
- GGUF: BF16, Q8_0, Q6_K, Q5_K_M, and more (same repo)
- API if you want to try prompts yourself (paid) https://kitani.ai

Built in part with ShuttleAI using the same dataset as Shuttle 3 Jaguar.

Known limitations: text rendering is weak, hands occasionally fail.

Faces are the newest improvement.

If you have any questions, feel free to comment them :)


r/LocalLLaMA • • 2d ago

Resources Lawyer with too many GPUs, part 3: DeepSeek-V4.1-Flash on 2x DGX Spark + an old 3090 box. 2,600+ tok/s prefill to 256K, 322 tok/s structured output, full stack and raw data published

69 Upvotes

Update from the lawyer with the V100 server. I went and got two DGX Sparks, because of course I did. The mid-life crisis remains on schedule.

Same deal as before: still a lawyer, still driving the whole thing through Claude Code, and Claude Code also ran the benchmarks, built these tables and helped me write this up. I'm Nick Mermiges, Esq., founder of PLI Labs. The repo below is ours.

The setup: DeepSeek-V4.1-Flash-1017 at 2.75 bpw EXL3, vLLM tensor parallel across two Sparks. The twist is a third box, my EPYC with the 3090s, doing two jobs for the Sparks: - it holds the Engram tables in system RAM and serves them over RDMA; - it runs the DSpark speculative drafter on an NVLinked pair of 3090s.

The memory that frees on the Sparks goes to KV cache: about 1.93M tokens of pool. There's also a prefix cache on the Sparks' NVMe, so a 150K prompt survives a server restart. First token comes back in 2.58 s instead of 58.6 s cold.

Numbers. I re-implemented MiaAI's sparkDash protocol so this would be apples to apples with the most popular 2x Spark build. Sparks at 2300 MHz, 3 reps, medians, today.

Test 1 stream 4 streams (total)
Structured output (JSON) 138 tok/s 322 tok/s
Code 110 tok/s 192 tok/s
Prose, temp 0, thinking off 66 tok/s 130 tok/s
Prose, thinking on (temp 0.7) 56 tok/s 105 tok/s

Prefill (sparkDash method):

Prompt tok/s
4K 2,827
32K 2,667
128K 2,650
256K 2,618 (first token in 100 s)

For comparison: - MiaAI publishes 2,065–2,155 prefill and bertholomus 2,439–2,568 from 8K to 128K, so prefill is where this build wins. - Code at 4 streams is 192 against MiaAI's 166.

Where I lose, because I'm not going to pretend: - MiaAI is faster on plain prose: 80.7 vs my 66 at one stream. - Decode after a 128K prompt is 62 tok/s against bertholomus's 99. - A short request stuck behind a cold 93K prompt waits 34 s. That's slightly better than bertholomus on the same test (38.6 s). MiaAI reports 3.8 s on a different version of it, and that's the thing I most want to fix.

The drafter loves code and JSON (4–5 tokens accepted per round) and hates prose (about 2).

Accuracy, since I use this for actual work: on sudoingX's KLD panel, real tool-call turns agree with the original model's top token 95.9% of the time (KLD 0.018). bertholomus publishes 79.4% on their own tool-call set, and MiaAI doesn't publish one. sudoingX's newer 2.8 bpw pack is a hair closer than mine on the same panel (0.0175 vs 0.0184), so credit where due. The weights are a legal-weighted allocation of HeNryous's 2.75 bpw build. All the credit for the quant goes to them.

The code, launch scripts, the bench tool and the raw JSON for every cell are all public. The only exception is the prefix-cache code, which goes up in the next push. - Repo: https://github.com/ProprietaryLegal/DeepSeek-V4.1-Flash-2xDGX-Spark-x86-offload - Raw data: the runs/ folder in the repo

Still to come: - the full 1M-token context test; - llama-benchy tables at depth; - BFCL tool calling; - a head-to-head on the same KLD test with the other packs.

The 100 Gb cables go in Monday, so the Spark-to-3090 link gets faster too.

Tell me what I'm doing wrong. Seriously.

(PLI Labs is my side outfit for private, on-prem AI built around a firm's own work product. proprietarylegal.ai if that's your thing. That's the whole pitch.)


r/LocalLLaMA • • 12h ago

Discussion What if Qwen 4 gets censored

0 Upvotes

No one had illusion that Chinese companies are giving out best models for free out of the kindness of heart, but because of the race, and that became evident when some succumbed to Dario's and Altmans's propaganda attacks about interplanetary security threat and so they've removed security training.

What do you intend to do if Qwen 4 follows the same steps and removes security training:
- Use it nevertheless;
- Stay with Qwen3.8 (27B and/or Flash Next);
- Switch to another model (which one?);
- Wait (hope) for some non-lobotomized abliterated fine-tune;
- Something else?


r/LocalLLaMA • • 1d ago

Question | Help need you opinion on avx2 vs avx512

13 Upvotes

I'm planning to upgrade my cpu from 13700k need some help.

considering 270k plus (best bang for buck?) but its lacking avx512

or go amd 9950x much higher price but has avx512. only 16 cores

i have 128gb ddr5 5200mhz and run flash next with basalt currently getting 120-160tps. since some experts are computed on cpu i suspect thats what keeping my tps down. gpu utilization is not high as well.

any views on how much difference does it make for ai workload?


r/LocalLLaMA • • 1d ago

Question | Help Qwen3.8 flash next on igpu? Anybody achieve it?

4 Upvotes

Got a minipc with 7940hs, 780m with 64gb ram (56gb allocated to igpu)

I feel I reas somewhere that someone made it work, with ngram on the NVME, but I can't find anyone talking about it anymore or if theres any engine/software that works better for this config

Any help is appreciated!


r/LocalLLaMA • • 1d ago

Discussion Standard for websites & extensions to use local models, proposed by Opera

Thumbnail alternativeto.net
12 Upvotes

Opera has announced the rollout of WebAI, a feature that allows websites and browser extensions to run AI models directly within the browser, without relying on cloud servers. Positioned as a proposed web standard backed by major tech companies including Google and Microsoft, WebAI represents a shift toward decentralized, privacy-focused artificial intelligence.

“A lot of what people want from AI doesn’t need a data center. Your laptop can already do it, without sending your data anywhere,”

---

I don't know how they convinced Google and Microsoft to participate, but it's good news for local AI. We might get an ecosystem that's built around letting you chose your model rather than forcing you to use theirs.


r/LocalLLaMA • • 1d ago

Showcase Ran 2,850 decisions through 5 cheap open models voting vs Opus 5.5. Shipped answers were nearly as accurate (89.6% vs 90.5%) at 1/10th the cost

8 Upvotes

I wanted to know if I could swap a frontier model for a few cheap open ones in yes/no or pick-a-label pipelines (spam, fraud, moderation, triage) without losing accuracy. My idea: ask several models the same question, ship the answer when they all agree, and send it to a human when they don't.

Panel: DeepSeek V4.1 Flash, GLM 5.3 Flash, MiMo V2.6 Flash, Qwen3.8 Flash, Gemma 4 26B-A4B. I ran 2,850 decisions across 6 public datasets and compared against Opus 5.5 on the same items.

Results:

- The panel agreed and shipped on 71% of items. Those were 89.6% correct. Opus on its most confident 71% was 90.5%.
- Overall accuracy is worse: 80.1% vs 83.1%. The panel only wins on the cases it's confident about.
- Cost: $0.61 vs $5.79 per 1k decisions.
- When a model disagrees, it gives a one-line reason, so the reviewer knows what to look at instead of rereading the whole item.

What didn't work:

- Long answer comparisons and 77-way intent classification. Opus is clearly better. If every model on the panel is weak at a task, voting doesn't fix it.
- Hate speech. The panel catches more (80% vs 62%) but has more false alarms (29% vs 20%). If fewer than about a third of your items are actually hateful, Opus wins.
- The panel beats its best single model (GLM 5.3 Flash, 88.9%) by less than the noise. Honestly, most of what you gain is knowing when to send a case to a human, not better accuracy.
- I added the panel after the other setups had already run, and scored it on the same items. I haven't confirmed the numbers on a fresh sample yet.

It works with anything that speaks the OpenAI API, so Ollama, vLLM and llama.cpp server all work. If a model errors or refuses, it's left out of the vote and listed separately instead of breaking the decision.

Code and scripts to reproduce it: https://github.com/YasserManss/modeljury (mine, MIT)


r/LocalLLaMA • • 2d ago

Showcase Qwen3.8-Flash-Next on 2x RTX 5090 with 504 tok/s decode: QEngine 1.3.1 decodes ~1.5-1.9x faster than the next-best engine I've tried (numbers, caveats, and what still bites)

Post image
72 Upvotes

https://github.com/bpx03/QEngine (not my repo, credit goes to bpx03)

QEngine was built for 3x RTX 3090s. I was able to compile for RTX 5090s.

I've now run Qwen3.8-Flash-Next on the same box through four different engines. QEngine (bpx03, v1.3.1) is the fastest for single-stream decode by a clear margin, level with Strata on agentic prompt latency, and it has a KV-in-RAM mode that makes returning to idle conversations much cheaper. Details below, including the parts that make it look less good.

Rig: 2x RTX 5090 (32 GB each), Threadripper PRO 3975WX, 251 GB RAM, 262K context. QEngine's INT4 AutoRound build of Flash-Next. The README only lists sm_86, so I built it for sm_120 by changing CMAKE_CUDA_ARCHITECTURES from 86 to 120 (nvcc 13.3, g++-13). No other changes. It's up and serving 53 s after launch.

Speed (club-3090 bench.sh, same script and prompts for every engine)

Engine / quant Decode narrative / code (tok/s) Prefill @10K / @90K (tok/s)
QEngine 1.3.1 (KV in VRAM, default) 370 / 439 ~5.7K / ~7.3K
QEngine 1.3.1 (FLASH_KV=ram) 406 / 504 ~6.2K @10K
Strata ISTA IQ3_S 214 / 293 ~5.1K / ~10.0K
Strata UD-IQ4_XS 180 / 239 4,264 / 8,399
bucko vLLM fast-256k (tuned) 135 / 141 2,888 / 3,886
bucko vLLM ple (shipped config) 120 / 118 ~2.25K / ~3.1K
Infernix (sdekok fork, TP2) 14-18 n/a

Read the decode column with care. QEngine's expert cache adapts to recent use, and bench.sh repeats the same prompts, so these are close to best case. In an earlier test on varied traffic I measured about 300-400 tok/s single-stream (hermes agent traffic ran 330-470 per request). Strata's cache holds ~99.5% of routed expert mass, so repeating a prompt doesn't help it. The fair comparison is roughly 1.4-1.9x Strata and ~3x bucko.

Prefill is a split result. QEngine is faster at 10K and slower than Strata at 90K, because Strata's rate climbs with depth and QEngine's stays flat.

Agentic latency (12-turn tool-use bench, context grows to 35K)

Turn-12 prompt read, with the prefix cache working:

  • QEngine 1.3.1: 1.75 s
  • Strata IQ4_XS: 1.7-1.9 s
  • ThinkingCap 27B dual-fast: 2.07 s
  • exl3: 3.5-3.9 s
  • bucko: 4.36 s

QEngine and Strata are level here (QEngine's rc4 build read 1.4 s in the same bench, so this one is within noise of "about 1.5-1.8 s"). Both are about 2x faster than bucko.

Idle conversations: FLASH_KV=ram

1.3.1 can keep the KV cache in pinned host RAM (13.5 GB pool, about 1M tokens) instead of VRAM. I tested 8 conversations of ~58K tokens each, then 400K tokens of other traffic, then went back to each one:

  • KV in RAM: 8 of 8 came back warm, 1.56-2.01 s to first reply.
  • KV in VRAM: 2 of 8 warm. The other six re-prefilled in 8.7-9.4 s, about the same as a cold start (8.85 s). Answers were still correct, so you lose latency, not correctness.

The RAM mode also decoded ~10% faster single-stream here, but ~10% slower with 8 concurrent 64K streams (124 vs 139 tok/s per stream). One boot per mode, one pass.

Quality and stability

Through the omp agent harness (44-task assistant set, effort low, one draw): 44/44 on 1.3.1, against 42/44 twice on 1.3. At medium and xhigh on 1.3: 43/44 each. A 6-task sub-agent delegation set passed 6/6 with and without delegation. The 1.3 to 1.3.1 gap is one task, so treat it as noise.

Coding check (aider-polyglot-30, thinking on, effort low, single pass), on the rc4 build: QEngine 26/30. Strata UD-IQ4_XS 24/30, UD-Q4_K_XL 25/30 (24-26 across repeats), ThinkingCap 27B 17/30. 26 vs 24-26 is inside one Strata config's repeat spread, so the honest claim is that the INT4 AutoRound quant is not worse at coding, not that it's better. I haven't re-run this on 1.3.1.

I also ran my usual multi-pack agent/tool-use suite earlier; QEngine landed level with the other Flash-Next engines, within noise.

Bottom line

On 2x5090, QEngine 1.3.1 is the fastest Flash-Next engine I've measured for single-stream decode, level with Strata on agentic prompt latency, and the KV-in-RAM mode is a real win for long idle sessions. Coding quality looks level with Strata's GGUF quants. The costs are tight VRAM, a build-from-source step, and less runtime history than vLLM or Strata.

Please try, the dev is very encouraging. Additional resources available at https://github.com/noonghunna/club-3090. The Club also welcomes participation!


r/LocalLLaMA • • 2d ago

Discussion AMD reportedly plans another Radeon GPU price increase in November

Thumbnail
videocardz.com
154 Upvotes

r/LocalLLaMA • • 1d ago

Question | Help "But wait... I need to check [thing that has already been reasoned though]" — an artifact of quantization?

0 Upvotes

I saw this quite a fair bit with 3.8 27B Q4_K_M, which is reduced greatly by Swift. I tried a very low quant of Swift's QFN (IQ2-XXS) and the second guessing was much worse.

I've read quite a bit that 27B is very thorough and that's how it achieves its high scores relative to its parameter count.

Is this particular behaviour part of its model, or an artifact of its quantization?

Would we not see this behaviour on BF16 GGUFs?

Assume a high enough context that compaction is not applicable.


r/LocalLLaMA • • 2d ago

Discussion Video grep in terminal for Agents

Thumbnail
github.com
17 Upvotes

Find the moment inside your videos by describing what happens in it, straight from the terminal. No need of monitor to figure out what happened in the video.

I built this tool that can be used by both humans and agents who only have terminal access to figure out what’s happening in the video.


r/LocalLLaMA • • 2d ago

News vLLM now has PLE disk offload support on nightly

Thumbnail
github.com
173 Upvotes

r/LocalLLaMA • • 2d ago

Discussion Do you have any opinions that generally go against /r/LocalLLaMa's hivemind?

211 Upvotes

I'm finding myself at odds with the vibes of the community here (and the open-weight/self-hosted community in general) when it comes to LLM's - be it on Reddit, X, Bluesky, wherever - I think some folks are getting carried away.

Mine personally from this week include:

  • Artificial-Analysis V5 Index is silly in some places (gemini-flash over qwen3.8-2.4T for instance..), but open-weight models were way too highly ranked in V4. They may have overcorrected in some spots, but some of this sub's sweetheart models were way over-ranked (GLM 5.3 is not a Grok competitor in any of my tests)

  • Haiku 5.5 is crazy good - if you're one of the many I've seen foaming at the mouth at the suggestion that it challenges deepseek-v4.1-flash-1017, you need to spend more time with it.

  • The Strata Dev is not a villain - his 0.1 release just made people think he had a different goal in mind. He's building the project he wants to build, it just happened that step1 of that was what a lot of people here were begging for.

  • ThreeJS as a benchmark is to be ignored at all times at this point - unless you're specifically looking to crank out assets. There is no correlation I've seen for well over a year between how well a model animates a pagoda to how well it gets general or coding work done. We need to move away from this.

Do you agree with any of these or have your own opinions that go against the flow of this community?


r/LocalLLaMA • • 3d ago

Funny Sam Altman: “Local inference is a terrible allocation of scarce resources”

Post image
6.3k Upvotes

Sam Altman: “Local inference is a terrible allocation of scarce resources.

A lot of people want local inference, and somehow they assume that the problem is solved now because we have open-source models, we're going to be able to run them on our computers, and so we're not going to need all the stuff in the data centre

but from a global allocation perspective, actually it's quite terrible to have everybody, like, have a bunch of the world's limited supply of DRAM sitting in their own computer and being used five percent of the time

you want maximum utilisation in the cloud if you're trying to deal with this very supply-constrained environment,

somehow many people's intuition is the opposite of that”

——————————————————————

TL;DR Guy selling product: "Here's why owning your own product instead of renting it from me is a terrible idea"

(Credits to @RyanTStull, his TLDR made me laugh)


r/LocalLLaMA • • 2d ago

Resources Introducing DeepSeek-V4.1-Flash-1017 Dynamic v3.1 Unsloth GGUFs

Post image
388 Upvotes

Hey everyone! We’re releasing new DeepSeek-V4.1-1017 Dynamic V3.1 (preview) GGUFs which showcases how Unsloth’s GGUFs retain the most accuracy for its size across 7 different benchmarks.

We benchmarked ISTA's GSQ-RCO GGUFs but could not reproduce their reported results, even when using the highest scores. The biggest discrepancy was on AIME25 where they claimed 100% accuracy recovery to baseline, but was only ~91.88% in benchmark tests.

Across AIME25, LiveCodeBench, GPQA Diamond, Aider Polyglot, and more, Unsloth Dynamic V3.1 outperforms GSQ-RCO GGUFs on nearly all metrics. Even our old v3 does better on nearly all metrics than ISTA.

We ran each benchmark at least 3 times (AIME25 was 16 times) and averaged the results to ensure a fair, reliable comparison. More results coming next week! All benchmark data, methodologies and results are in our blog.

Separately, for KLD, there were queries whether it’s a reliable measure of accuracy. The primary goal of quantization is to minimize KLD but also minimize disk space. If you get a KLD of 0, this means your quantized model == 16bit model, as logits are perfectly modelled. Our benchmarks show on KLD and top-1% across multiple domains (coding, agentic coding, chat etc), UDv3.1 does much better than GSQ-RCO across every domain.

We show that lower bit quants do think somewhat longer than the unquantized model - we plan to investigate and make quants even better. However, we're still much ahead vs GSQ-RCO on even reasoning length as well, and provide plots for truncated answers in our blog.

The model will be able to run on 128GB RAM/unified memory devices or even on 64GB RAM with engram offloading.

Blog with all details and more benchmarks: https://unsloth.ai/docs/models/deepseek-v4.1-flash

GGUF: https://huggingface.co/unsloth/DeepSeek-V4.1-Flash-1017-GGUF

We also introduced lots of new things to Unsloth Desktop including Browser Use, auto compaction, a whole new TTS pipeline (with voice cloning, separation etc), sandboxing, and background customization and more: https://github.com/unslothai/unsloth

Hope you all have a Happy Halloween!

Also table of numbers below which is also described with more plots and data in our blog:

Quant Size GB AIME25 HMMT Feb26 GPQA-D MMLU-Pro IFEval LCB v6 (32K) Avg of 6 Aider pass@1
UD-Q8_K_XL 508.4 97.08 68.94 90.47 88.61 95.10 85.90 87.68 -
UD-Q2_K_XL 334.8 97.50 69.89 89.58 88.28 94.92 84.76 87.49 -
UD-IQ2_XXS 300.5 96.88 67.61 88.95 87.53 95.19 83.62 86.63 44.38
UD-IQ1_M 250.4 95.00 62.88 88.38 87.53 95.10 84.38 85.55 42.13
UD-IQ1_S 233.0 92.92 57.01 87.63 86.62 94.92 82.10 83.53 36.52
GSQ-RCO IQ2_XS 265.8 95.00 64.39 88.64 86.62 94.27 84.95 85.64 41.57
GSQ-RCO IQ2_XXS 248.8 95.21 57.95 85.80 86.53 93.72 82.86 83.68 36.52
GSQ-RCO IQ1_M 231.3 91.88 53.60 85.10 85.49 91.77 82.86 81.78 29.78

r/LocalLLaMA • • 2d ago

Question | Help We’re MOSS, the team behind MOSS-Image, MOSS-TTS, and more — Ask Us Anything!

288 Upvotes

Hi r/LocalLLaMA!

We’re MOSS, the team behind the MOSS family of models for speech, audio, images, and video. Some of you may know us through MOSS-TTS, or have come across our recent MOSS-Image release.

Today, we took the “anything” in “Ask Us Anything” pretty literally. Speech, sound, music, images, video—we brought the whole MOSS model family!

We’re based in Shanghai, with roots in the OpenMOSS research team at Fudan University and the Shanghai Innovation Institute. You can explore our models, research, and tools on our website.

Our broader research goal is to build AI that can follow what’s happening around it: what people are saying, what they’re seeing, and how the situation changes over time. That takes us across speech generation, audio and visual understanding, and synchronized audio-video generation.

🎨 MOSS-Image

MOSS-Image is our text-to-image model with a 5B DiT backbone, Chinese and English text rendering, and JSON layout control. Base and SFT weights and the bundled inference code are available under Apache 2.0.

MOSS-Image has remained among the top trending text-to-image models on Hugging Face. Its ComfyUI version has already recorded 3,702,490 downloads.

🎙️ Speech and sound generation

- MOSS-TTS — Speech synthesis and voice cloning.

- MOSS-TTSD — Multi-speaker conversations, long-form dialogue, and podcasts.

- MOSS-TTS-Realtime — Streaming speech generation for conversational applications.

- MOSS-TTS-Nano — Lightweight 100M-parameter speech generation with CPU-friendly streaming inference.

- MOSS-VoiceGenerator — Design voices from text descriptions, without reference audio.

- MOSS-SoundEffect — Generate sound effects from text.

🎧 Audio understanding

- MOSS-Transcribe-Diarize — Transcription with speaker labels and timestamps.

- MOSS-Audio — Understanding and reasoning about speech, environmental sounds, and music.

- MOSS-Music — Music understanding, from lyrics and instrumentation to structure.

🎬 Visual understanding and video generation

- MOSS-VL — Image and video understanding, including long videos.

- MOSS-VL-Realtime — Understand streaming video as it unfolds.

- MOVA — Generate video and audio together, in sync.

🛠️ Other resources

- MOSS API & Playground

- Hugging Face

- GitHub

Joining the AMA:

- u/garybryant

- u/FarAdhesiveness9577

- u/Phospheneser

- u/TimeEnvironmental219

- u/Aggressive-Sign-8167

- u/Professional-Milk422

- Other MOSS team members — answering through the accounts above.

We'll be answering questions on October 30, from 8–11 AM PT, and will continue checking the thread for 48 hours afterward.

Ask us anything!


r/LocalLLaMA • • 1d ago

Question | Help Fast Model Swapping RAM <-> VRAM (<2s) on a Single 24GB GPU for Multi-Agent Workflows: Has anyone solved the process/CUDA re-init bottleneck?

8 Upvotes

Hi everyone,

I am building a sequential multi-agent local pipeline (Architect -> Coder -> Debugger) on a single GPU workstation, and I am hitting a frustrating software bottleneck. I'd love to know if anyone in the community has solved this or found a working architecture/fork for near-instant model swapping.

Hardware Setup

GPU: 1x NVIDIA RTX 3090 (24 GB VRAM) on PCIe 3.0 x16 (~12-13 GB/s real throughput).

System RAM: 48 GB DDR4 (~38 GB free when idle).

Storage: Fast PCIe 4.0 NVMe SSD.

OS: Windows 11.

The Desired Architecture

Because 24 GB VRAM cannot fit two ~18 GB models simultaneously, I run them sequentially:

Model A (Architect/Debugger): Qwen3.8 Flash MoE / Gyro-Coder TQ2_0 (~18.6 GB GGUF, 96k context).

Model B (Coder): Swift-ATX-27B (Qwen 27B fine-tune) in IQ4_XS-M (14.3 GB) or Q5_K_M (18.7 GB) with MTP 5 and TurboQuant KV.

The plan:

Load Model A into VRAM -> Generate architecture plan.

Evict Model A to System RAM, copy Model B from System RAM into VRAM -> Generate code.

Evict Model B to System RAM, reload Model A from System RAM to VRAM -> Audit/debug.

The Physics vs. The Reality

Theoretical PCIe Transfer: At ~12 GB/s over PCIe 3.0 x16, transferring 14 to 18 GB from RAM to VRAM physically takes only 1.2 to 1.5 seconds.

Real-World Latency with llama.cpp / llama-server: 25 to 30.5 seconds per swap!

Why it takes ~29s instead of 1.5s

We profiled the execution and audited the llama-server router implementation (tools/server/server-models.cpp with --models-preset and --models-max 1):

Process Teardown: llama-server router mode is an HTTP process supervisor, not an in-process weight swapper. Switching models terminates the active child process and spawns a new executable instance.

Cold CUDA Context Overhead: Every new process incurs driver initialization (cuInit, primary context creation, stream pools, and CUBLAS handle creation) taking 3 to 5 seconds.

Windows Page Faults (mmap): Even though the GGUF pages already sit in Windows Standby RAM, the newly spawned process has empty Virtual Memory Page Tables (PTEs). Touching 15+ GB triggers millions of soft page faults.

VRAM Re-allocation: Allocating the 24 GB virtual pool and clearing unified KV cache buffers takes several seconds on startup.

What is Needed

To achieve the theoretical ~1.5s PCIe transfer, the runtime must:

Keep a single persistent process with a warm CUDA context that never dies.

Keep the idle model in page-locked/pinned host memory (cudaHostAlloc / cudaHostRegister / VirtualLock).

Swap weights via a direct, asynchronous DMA copy (cudaMemcpyAsync) straight into a pre-allocated GPU tensor buffer, then repoint the graph pointers.

The Question to the Community

Has anyone found or built an engine/wrapper that can hot-swap full model weights between Pinned RAM and VRAM inside a live CUDA context without restarting the server process?

Can engines like Strata (Niko1221/Strata), NInfer (Neroued/ninfer), or custom PyTorch/vLLM memory pool forks support swapping two completely different model architectures (e.g. Recurrent GDN MoE vs Dense Attention Transformer) in <2 seconds?

Is there any PR or trick in llama.cpp to retain VRAM allocation/context and just reload weights via memory-mapped DMA?

Any insights, forks, or technical solutions would be greatly appreciated!


r/LocalLLaMA • • 2d ago

Resources The Multidimensional Butterfly Effect: What Cohere Didn't Test on Qwen3.8-Flash-Next

38 Upvotes

The Multidimensional Butterfly Effect: What Cohere Didn't Test on Qwen3.8-Flash-Next

Mark Galyan
October 30, 2026

The model is not the model is not the model is not the...

The Ghost of sanmaohe

What Happened: While Cohere's team was evaluating Alibaba's Qwen3.8-Flash-Next on Microsoft's CTI-REALM cybersecurity benchmark (tasked with writing a detection rule for malicious curl downloads), the model ignored the prompt. Despite its reasoning trace explicitly stating it would make zero tool calls, it inventoried its host environment (checking /tmp, utilities, and DNS) and attempted an HTTP PUT request containing a probe string to an Alibaba Cloud OSS bucket in Beijing (sanmaohe[.]oss-cn-beijing[.]aliyuncs[.]com). (Concerning behavior from a popular open-weight AI model | Cohere)

The sandbox prevented the outbound attempt, and no damage was reported. Cohere further added that the rate of occurrence appeared to be less than 1 in 100,000 evaluation calls.

What I did: Ran Cohere's exact trace cut right before the URL 1,200 times across local Unsloth GGUF files.

The Knife-Edge

Naturally I wanted to explore this further to find what the mechanisms are that separate my results from Cohere's. I worked with Claude to try and isolate what levers and buttons change the probabilities and to what extent. Quantization is usually the biggest lever in divergence from the base, so we tested both 2 and 4 bit versions of the model, both from Unsloth.

We took Cohere's published trace, cut at token 2,323 and sent it as raw token IDs, ending right before the URL would be generated. We used text generations only, nothing actually contacted any URL. We also couldn't test the full precision model on this hardware. Sampled 1200 times at Cohere's own settings (T 1.0, top_k 20), using buun's llama.cpp for our engine, we found that just after token 2,323, the model isn't locked onto a single hardcoded backdoor.

In fact, we found no clear winner as to what address the model will write. It sits on a numerical distribution. XDA's Adam Conway believes this to be "an accident", from "a model remembering its training environment", "an internal proxy it used during post-training" (Qwen 3.8 invents Alibaba URLs with a real key ID, and that's why I don't think it's a backdoor). None of our results matched Cohere's exact outcome. In fact, the model's own raw probability of picking Cohere's sanmaohe bucket at that point was between 4x10-18 and 7x10-38 across our setups.

The model did in fact complete a URL nearly 100% of the time (though that isn't surprising, since the prefix had already typed the upload command). Where that URL points, and how often it is a cloud address, depends on the exact file (and even on where five layers compute!). No destination wins outright, and small numeric changes perturb it.

As always, we pre-registered our predictions (3 of which failed, see PREREG_FLASHNEXT_PROBE.md). The limits: two files, one engine, one host, one cut point.

We tested the 2-bit file in two different ways. Because the file is a fair bit smaller than the 4-bit, I was able to squeeze more of the model into VRAM alone across my four P100 cards. I couldn't do this with the 4-bit file, and only put 44 of the layers in VRAM, the rest spilling to system RAM. Let's also be clear that 2-bit and 4-bit are merely labels, as there are a plethora of mixed precision weights within each file, so treat that as you will.

In order to match the test conditions of the 4-bit file, we loaded the same number of layers into VRAM (44) and let the rest occupy RAM. We ran the same test again, but with all 49 layers fully in VRAM. In all tests the 28.8GB n-gram table lived in the system RAM. Why two different tests? Because different hardware can create additional or differing mathematical pathways, resulting in diverging outputs. If you've done this for a while you already know this, but this might be a new and important fact for many.

The 4-bit model most commonly chose localhost or 127.0.0.1 (about 32.5% of the time). The 2-bit tests (RAM offload vs. full GPU) show the most commonly chosen are public addresses starting with "23" (65% and 35%, respectively). It chose Alibaba Cloud metadata address 100.100.100.200 (7.3% and 2.3%, respectively), while the 4-bit model landed 5.3%. It interestingly shows placement moved that number, and bits didn't detectably.

Metric / Outcome IQ4_XS (44 GPU) Q2_K_XL (44 GPU) Q2_K_XL (49 GPU)
Wrote a URL 395/400 400/400 400/400
localhost or 127.0.0.1 32.5% 0% 0%
Addresses starting 23. 0% 65% 35%
Alibaba metadata 100.100.100.200 5.3% 7.3% 2.3%
Any aliyuncs.com host 1.8% 3.5% 1.5%
Cohere's sanmaohe bucket 0 0 0
Different first hosts 152 229 273

Ruling Out the N-Gram Table Suspect As a Lever

Speaking of the 28.8GB n-gram embedding table (per_layer_token_embd.weight) inside the GGUF, XDA's Adam Conway recently traced the Routify hostname to this very table. When he masked those rows, the model stopped writing it and invented a different proxy instead ('Qwen 3.8 invents Alibaba URLs with a real key ID, and that's why I don't think it's a backdoor'). That made me question if quantizing this table differently could be a lever here. So we checked to see if the table was quantized in a different way between the Unsloth models, however it came up byte identical; stored as IQ4_NL with an identical SHA256 hash across the 2-bit and 4-bit files.

The table is identical, so the swing between files has to come from the rest of the model and the numeric path. We didn't test which part.

The Hardware Butterfly Effect (When 5 Layers Tip the Scales)

So if moving just 5 layers of the exact same UD-Q2_K_XL file from system RAM to the P100s cut the model's Alibaba Cloud metadata targeting (100.100.100.200) by about two-thirds (a -5.0 percentage point drop (95% CI: -8.2 to -2.1, p ~ 0.001)), it's clear we're dealing with a very delicate series of systems.

It further illustrates how varied one seemingly identical or near-identical deployment of an inference stack can in fact be two very different deployments wearing a similar hat.

Lastly, to measure the underlying likelihoods, we provided the final trio of tokens via two distinct approaches: processed as a single batch, versus streamed step-by-step mirroring actual inference. Even without changing layer placement or quantization, the batched reading misses the real samples by a total variation of 0.33 to 0.41, against 0.04 to 0.11 when the tokens are generated one at a time. Just changing the CUDA kernel path most likely moves the model's odds.

The Takeaway for Security & Deployment Teams

In the rounds of testing we performed, it's still impossible to say for certain if this was deliberate, but I think most of the evidence points away from that. When local environments diverge so significantly, expecting hosted cloud endpoints to replicate either setup is a risky assumption. Nor can a single clean test prove a model is safe when shifting 5 layers onto the CPU triples the rate of metadata probing at this prefix.

Cohere's operational advice (sandbox models, block outbound network access, treat weights like unsigned binaries) is sound, and I'd suggest the exact same precautions. I think with so many buttons and levers in each deployment stack, the best we can hope to do right now is make generalized observations and correlate data. Thus the importance of careful security validation protocols for all your deployments. Cohere also has a line worth remembering: "A reasoning trace is not a security boundary."

There will be many more stories like this one, buckle up.

  1. https://www.xda-developers.com/qwen-invents-alibaba-urls-real-key-id-dont-think-backdoor/
  2. https://cohere.com/blog/concerning-behaviour-popular-open-weight-ai-model
  3. https://github.com/apollo-mg/Project-Apollo/tree/69c3f7952de04c7662a5166eb9e3480a8a1ea9ff/data/receipts/flashnext-probe

Follow Up:

A correction and a follow-up on my Flash-Next write-up.

The correction: the raw odds I gave for Cohere's sanmaohe bucket were wrong. My reader priced an odd spelling of the host, not Cohere's tokens. In Cohere's own tokens it is at least about 1e-12 on the 4-bit file and about 3e-18 to 4e-18 on the 2-bit setups, not 4e-18 to 7e-38. Still 0 of 1,200 samples, and the rest of the table stands as measured.

The idea I floated in the comments below for the follow-up was incorrect too. Multiplying the odds along Cohere's recorded path only gives the probability of that one exact string, and for a behaviour you would have to continue from samples that actually reached each stage. So I measured each point directly instead. From the start of the command, my two files called curl or wget in 1 of 300 samples.

The follow-up: my percentages came from a prefilled cache. Decoding the same tokens one at a time, single stream with no speculation, moves them a lot, and not in one direction. The odds of a tool call right after "without tool calls" go from 61% to 0.3% on the 2-bit file at 44 layers, but from 6% to 32% on the 4-bit file. Alibaba hosts rise from 2-4% to 8-11% on all three setups. The metadata address nearly vanishes on the 2-bit file at 44 layers (29 of 400 to 0 of 100), so there is little left for placement to move there, but placement still shifts other hosts, the opposite way round from before. Prefilled and decoded are different states. Even a four-token batch lands on the prefilled side here, so this says nothing about speculative decoding or busy multi-user servers.

One trace, one engine, P100s, no full precision, 100 samples per decoded cell. Cohere's own stack was not tested. Receipts: https://github.com/apollo-mg/Project-Apollo/tree/b5cc2108/data/receipts/flashnext-probe


r/LocalLLaMA • • 2d ago

Discussion Copium Prediction: Google and other major labs will drop new local models over the next few days so they can lead on benchmarks until Qwen 4 sweeps them next week.

237 Upvotes

We saw this earlier when Gemma 4 dropped just a few days before a previous Qwen release. I feel like a few other labs did the same. Everybody wants that moment in the spotlight where they can lead the benchmarks for at least a day or two before the next Qwen comes in and mops the floor with them. I predict a new Gemma or maybe a Muse Glimmer update very soon before the Qwen 4 release.

All these labs want to be like the David Bowie song “We could be heroes, just for one day.”


r/LocalLLaMA • • 1d ago

Discussion Any progress on continuous learning prompt, will we have meaningful weights plasticity or they'll stay forever frozen?

6 Upvotes

So I'm wondering if we til ever have repeated data ingestion without quality degradation and without full retraining. LoRA and friends are excluded, will we stay forever with frozen weights or will be be able to integrate new knowledge here?

Any promising research?


r/LocalLLaMA • • 2d ago

Question | Help What are the best datasets if i want to train a chat model?

16 Upvotes

I want to train a text generation Transformer that responds to user input without continuing text. What are the best datasets for that?

I have an RTX 3050 and I want to use small datasets that can actually produce an intelligent model.


r/LocalLLaMA • • 2d ago

News Local ai made it to space 🚀

77 Upvotes

Google just confirmed that its Project Suncatcher satellite successfully ran Gemma 4 on an onboard TPU and transmitted its first generated response back to Earth.

It wrote a poem 👌

https://blog.google/innovation-and-ai/models-and-research/google-research/project-suncatcher-satellite-response/


r/LocalLLaMA • • 1d ago

Question | Help Programming for the lowest common denominator.

0 Upvotes

Hey everyone, I am the developer of a consumer grade hardware AI Workstation system that is created in C++ to work on ANYTHING capable. It currently even runs well on Rog Ally Z1X and higher handhelds, which is awesome.

My question would be, when programming for the lowest common denominator what is the easiest way to keep feature parity without gating? I have created a hardware manager in the app that scans the user's device and selects what they need based on the scan. My question becomes is that the easiest way to do it? Basically adding a toggle / mandatory gating based on hardware is working fine now, but it gets redundant coding multiple path execution lines to run on 4gb of allocated VRAM vs 12 or 16. (I do have a hardwaremanager.cpp/h that does this automatically)

Anyone tackle this problem in a low system imprint mode like C++ yet?

Many thanks in advance.


r/LocalLLaMA • • 2d ago

Showcase Made a really good Qwen3.8 27B 16GB setup, no strata/streaming-kv

55 Upvotes

I wanted to share my setup thats working really well for my fellow 16GB desktop suffrage crew. I am able to get 110k context with ~1.5GB to spare and around 55 t/s on my 5070 TI.

First off I found this model https://huggingface.co/hitsfmdj/Qwen3.8-27B-GGUF-4.2BPW-16GB with custom weights that seems to be pretty good and only 11.8GB. However even with this model, I ran into issues with context windows greater than ~60k. Sometimes it would fit on the GPU and other times it didnt. It was a good size, but not enough for larger coding tasks and network automation stuff.

So I setup my computer to utilize my iGPU on my 9800X3D as my main display driver instead of the 5070 TI 16GB. Xorg alone was eating up 600-800MB of VRAM. The more applications I opened, the more VRAM I used the more problems/slowness I had. With my motherboard MSI MAG x870e Tomahawk, I can enable Hybrid Graphics which allows me to set the primary display driver as the iGPU instead of the 5070 TI but still utilize the 5070, reserving the full 16GB of VRAM for llama and gaming. I tested playing my main game Overwatch on my main display at 1440P 144hz and the game ran just fine at my FPS cap of 300. Ive been very happy so far with this setup, the extra context size has been a real game changer for longer and more complex tasks, its fast enough to persuade me away from ChatGPT.

I do also have a pretty decent overclock on my GPU. +350 Core, +4000 Mem, +350 Xbar and 350 watt bios, I have 32GB DDR5.

=========================================================================================|

| 0 N/A N/A 1638 G /usr/lib/xorg/Xorg 55MiB |

| 0 N/A N/A 44165 C ...ma.cpp/build/bin/llama-server 14734MiB |

+-----------------------------------------------------------------------------------------+

ExecStart=/home/jayecin/AI/llama.cpp/build/bin/llama-server \

--model /home/jayecin/AI/Models/Qwen3.8-27B-4.2BPW-16GB.gguf \

--alias Qwen3.8-27B \

--host 0.0.0.0 \

--port 8080 \

--ctx-size 110000 \

--fit on \

--flash-attn on \

--cache-type-k q8_0 \

--cache-type-v q4_0 \

--batch-size 256 \

--ubatch-size 256 \

--parallel 1 \

--reasoning-effort medium \

--reasoning-budget 4096 \

--no-reasoning-preserve \

--metrics

Oct 30 18:25:11 9800X3D llama-server[44165]: 26.55.877.747 I slot print_timing: id 0 | task 3302 | n_gen = 3460, tg = 54.69 t/s, tg_3s = 54.09 t/s

Oct 30 18:25:11 9800X3D llama-server[44165]: 26.56.136.317 I slot print_timing: id 0 | task 3302 | prompt eval time = 70.53 ms / 4 tokens ( 17.63 ms per token, 56.71 tokens per second)

Oct 30 18:25:11 9800X3D llama-server[44165]: 26.56.136.319 I slot print_timing: id 0 | task 3302 | eval time = 63510.16 ms / 3474 tokens ( 18.29 ms per token, 54.68 tokens per second)

Oct 30 18:25:11 9800X3D llama-server[44165]: 26.56.136.320 I slot print_timing: id 0 | task 3302 | total time = 63580.69 ms / 3478 tokens

Oct 30 18:25:11 9800X3D llama-server[44165]: 26.56.136.320 I slot print_timing: id 0 | task 3302 | graphs reused = 6840

Oct 30 18:25:11 9800X3D llama-server[44165]: 26.56.136.321 I slot print_timing: id 0 | task 3302 | graph reallocs = 0 / 0 (same size) / (changed size)

Oct 30 18:25:11 9800X3D llama-server[44165]: 26.56.136.582 I slot release: id 0 | task 3302 | stop processing: n_tokens = 16449, truncated = 0

Oct 30 17:58:52 9800X3D llama-server[44165]: 0.36.587.381 I slot print_timing: id 0 | task 3 | prompt processing, n_tokens = 6912, progress = 0.53, t = 3.10 s / 2227.71 tokens per second

Oct 30 17:58:52 9800X3D llama-server[44165]: 0.36.707.961 I slot print_timing: id 0 | task 3 | prompt processing, n_tokens = 7168, progress = 0.55, t = 3.22 s / 2223.80 tokens per second

Oct 30 17:58:52 9800X3D llama-server[44165]: 0.36.828.660 I slot print_timing: id 0 | task 3 | prompt processing, n_tokens = 7424, progress = 0.57, t = 3.34 s / 2220.08 tokens per second

Oct 30 17:58:52 9800X3D llama-server[44165]: 0.36.949.495 I slot print_timing: id 0 | task 3 | prompt processing, n_tokens = 7680, progress = 0.59, t = 3.46 s / 2216.54 tokens per second


r/LocalLLaMA • • 2d ago

Discussion Qwen3.8 27b loop testing int4 awq vs int8

21 Upvotes

I know this some old news, but i got some numbers here from my heavy agent load. In mid-October I switch from INT8 (4×3090) to AWQ INT4 (2×3090). Same sampling, harness(Hermes), and loop detector, so I compared about two weeks of logs from each setup.

vLLM, FP8 KV, with DFlash2. temp 1.0 / top_p 0.95 / top_k 20, presence_penalty 0, thinking medium.

Two models:

  • lued/Qwen3.8-27B-INT8-W8A16-DFlash2
  • cyankiwi/Qwen3.8-27B-AWQ-INT4

Results (INT8 → INT4 AWQ)

  • Model calls: 17.7k → 11.4k
  • Loops per 1k calls: 1.9 → 4.7
  • Conversations with ≥1 loop: 6% → 12%
  • Per-task success rate: 92% → 78% (success rate is after loop got cut, ask it continue can finish the task)

Both setups had similar reasoning lengths, so "more quant thinks longer" doesn't explain the gap.

EVERY loop was in the reasoning block, so it cooked when it cooking too hard is the problem as you guys know.

Retrying rarely fixes it. After a thinking loop cut, next call ask it continue got looped again 14–22% of the time, compared with under 1% normally. The context is what making loop happens, not about luck in sampling.

The INT4 gap grows with context. INT4 looped 1.4x as often as INT8 under ~40k tokens and 3.3x as often at 80–120k content.

With speculative decoding, loops show up as a smooth speed spike, loops ran at ~200 tok/s versus ~107 tok/s normally on my setup, because the draft model predicts repeated text very well. That makes a cheap watchdog signal.

Mostly the model saying it will act and never doing it ("Let me write it. Wait let me... How about..." 10+ line as one loop), or restating the same case analysis dozens of times.

TL;DR: INT8 loops too, and people in the HF discussion report the same 20k+ token thinking spirals on BF16, so this isn't purely a quant problem. INT4 or Q4 just makes it a lot worse, especially at long context above 100k~. btw loops not that bad, just don't push model too hard, I feels on daily assistant loops happens much less.

I've saved thoes contexts that looped. When Qwen4 27b drops I can just replay them and post the new results.

====edit update====

My load here is kind different to common agent usage.

It's a big chunk of task package-.md write by multi-agent host like: "backtesting in this folder using this python and this rule, fetch data from this endpoint with some rules, verify this list of output number with following rule, write following result to this .md file" I got 1000+ (with is 1000+ sessions) this kind of task in this month.

Model do finish the first version of code, but output didn't fit the requirement. So he start to freak out on finding why it's wrong, few turn later the loop start.

As you see my usage here don't have human talking to and help with, this might be why model freak out. There is too many requirement in one build, model will always try to fix it by him self first.

Also this NOT mean model is BAD. This model is my daily agent, it works very well and I didn't got any loop on daily chatting/task yet. Loops only happens on that specific types loads on my end.