r/llamacpp • • 16h ago

Text-to-Cypher on a 9B model keeps breaking on messy entity names. What do you do?

1 Upvotes
  • I'm working with a fully offline LLM setup using 2× NVIDIA A16 GPUs (~15 GB VRAM each), running Qwen 3.8 9B at Q8 through llama.cpp.

The task is translating natural-language questions into Cypher queries for a read-only Neo4j database.

I'm running into two recurring challenges:

1. Query generation reliability

The same question can produce different Cypher queries across runs. Most are syntactically correct, but occasionally the model introduces small errors, such as generating ]> instead of ]->, or dropping a digit from an identifier.

I've added an EXPLAIN-based validation step with one retry, which catches most issues, but some failures still slip through.

2. Inconsistent entity matching

The underlying data isn't always normalized. For example, the same vehicle plate might appear as ABC-123 in some records and ABC 123 in others. Place names have similar inconsistencies involving hyphens, spaces and formatting.

Exact matching therefore misses valid records.

There's also an intent-resolution problem: an unfamiliar identifier format can sometimes be interpreted as a continuation of the previous question rather than a new query.

3. Latency

End-to-end response latency is currently around 43 seconds at the median. The pipeline makes two sequential LLM calls per request, and this is becoming a significant bottleneck.

I'm also evaluating Gemma 4 E4B Q8 as an alternative.

I'd love to hear from people who have deployed smaller open-weight models for Text-to-Cypher or structured query generation in production.

A few things I'm particularly interested in:

  • How much reliability can you realistically get from validator-and-retry loops?
  • Do you use deterministic templates for common query patterns and reserve the LLM for more complex questions?
  • Is fine-tuning on domain-specific question-to-Cypher pairs worth the effort?
  • How do you handle entity normalization and identifier extraction without relying on the LLM?
  • Have you found effective ways to reduce sequential LLM calls without sacrificing accuracy?

I'm particularly interested in approaches that work fully offline, with limited GPU resources and smaller models.

Would appreciate insights from anyone who's tackled this in production.


r/llamacpp • • 18h ago

Unofficial llama.cpp fork: NariQ (Nari Labs trellis-coded Qwen3.8-27B) on AMD RDNA4 with HIP/ROCm on Windows, DFlash2 speculative decoding

Thumbnail
github.com
3 Upvotes

Target model

nari-labs/Qwen3.8-27B-NariQ-GGUF, the NariQ Qwen3.8-27B GGUFs. All tests and numbers on this page use Qwen3.8-27B-NariQ-3.0bpw.gguf (3.0 bits per weight), together with the vision projector and the DFlash2 draft (see Models). The 2.5 and 2.0bpw files use the same code but were not measured.

Stock llama.cpp (ggml-org master) cannot load NariQ files. So the reference for the comparison below is nari-llama.cpp itself, not ggml-org master.

Where it starts from

  1. nari-llama.cpp branch nariq/b12431**:** the NariQ release b12431-nariv0, on upstream llama.cpp b12431.
  2. The RDNA4 HIP port of nari-llama.cpp PR #8 (057395dec, 25/11/2026). It runs the Trellis products on gfx12 WMMA on Linux, without the speculative draft.
  3. Merged with ggml-org llama.cpp master of 28/11/2026 (ec3dac264). This brings the recent llama.cpp server, DFlash/DSpark speculative decoding and the HIP improvements.
  4. The RDNA4/Windows work listed in What was changed, on branch nariq-hip of this repository (e003768ba, build 12914).

All the detail on https://github.com/Filters83/nariq-hip-rdna4

Hope can help 😄


r/llamacpp • • 19h ago

Host performance optimization TUI

Thumbnail
gallery
9 Upvotes

For whoever might find it beneficial... I've created a little TUI script for optimization of your (mainly) Linux host. Macos/wsl and docker are also supported, although the optimizations for those are limited for obvious reasons.

It supports pretty much every modern Linux distribution, hardware and most inferance related GPU's. Feel free to submit an issue or pull request if you find bugs or want support for something that isn't supported yet!

https://github.com/bramvanoploo/strata-performance-setup


r/llamacpp • • 1d ago

Plenty of VRAM left, still spills to RAM

Thumbnail
reddit.com
1 Upvotes

r/llamacpp • • 1d ago

A 52 KB WebAssembly engine that runs Qwen3.5-2B in a browser tab

10 Upvotes

r/llamacpp • • 1d ago

AMD-specific llama.cpp patch nearly doubles prefill/decode

Thumbnail devnull.land
1 Upvotes

r/llamacpp • • 1d ago

54% faster generation by removing the Linux OS and llama.cpp

Thumbnail reddit.com
0 Upvotes

r/llamacpp • • 2d ago

Help needed with llama.cpp's replies.

Thumbnail reddit.com
1 Upvotes

r/llamacpp • • 2d ago

Inkling 2 Mini (unsloth GGUF) still broken on mainline llama.cpp

Thumbnail
reddit.com
2 Upvotes

r/llamacpp • • 2d ago

A community RTX 4090 port of Astral Inference Server: 143.1 vs 74.7 tok/s decode against llama.cpp on one 4090

Thumbnail
github.com
1 Upvotes

r/llamacpp • • 2d ago

CVE-2026-137567: unauthenticated out-of-bounds write in llama.cpp GGML RPC

0 Upvotes

Based on the CVE record published by VulnCheck on November 26 and the upstream ggml-org/llama.cpp patch references, CVE-2026-137567 affects the GGML RPC server in llama.cpp.

The reported issue is an out-of-bounds write through RPC_CMD_COPY_TENSOR. The described sequence uses BUFFER_GET_BASE to obtain a buffer base, then submits a zero-element destination tensor with a pointer below that base. The impact described in the CVE record is a server crash or possible code execution.

The affected range is b11450 to before b12658. The CVE record lists b12658 as the fixed build and gives the issue a CVSS 4.0 score of 9.3.

The upstream change in PR #32651 centralizes validation of RPC client data. It includes tensor-size overflow checks and request-region validation.

For operators, I would check:

  • Whether ggml-rpc-server is running at all.
  • Whether it is bound to loopback or exposed on a routable interface.
  • Which clients can reach the RPC port.
  • Whether the deployment is running a build containing the upstream fix.
  • Whether the server runs under an account with access to more files or devices than it needs.

The upstream RPC server warns against exposing the service to an open network. The default listener is loopback on port 50052, although deployments can change both.

This is related at a broad architectural level to our earlier MCP STDIO RCE discussion, but the mechanics differ. MCP STDIO launches local subprocesses; this CVE targets tensor metadata and memory handling in GGML RPC.

Technical references:

TechGines background analysis: https://www.techgines.com/post/mcp-stdio-rce-vulnerability-anthropic-200000-servers

For teams running distributed inference, how are you isolating GGML RPC workers today: dedicated inference VLANs, host-level ACLs, VPN/mesh access, or a separate authenticated proxy layer?


r/llamacpp • • 2d ago

Ternary Bonsai 2.5 27B on a Mac mini M2 Pro: 13.4 → 20 tok/s with Metal kernel changes

1 Upvotes

I have a Mac mini M2 Pro with 32 GB of RAM and I've been trying to push Ternary Bonsai 2.5 27B (Prism ML, PQ2_0) as fast as it can go on it.
Got token generation from 13.4 to 20 tok/s (+49%). Same GGUF, output identical at temp 0, perplexity unchanged, prefill untouched. The weights stayed exactly as they were; it's all in the Metal backend of Prism's llama.cpp fork.
The fun part: the 2-bit matmul wasn't memory bound, it was compute bound. Fixing that was most of the win.

github.com/Loomstar-app/llama.cpp/tree/perf/pq2-decode-m2


r/llamacpp • • 2d ago

[Resources] FLYX: 1M context on a 16GB GPU + 32GB RAM, in a 57MB zero-dependency exe

Thumbnail gallery
2 Upvotes

r/llamacpp • • 2d ago

Ran PrismML's Ternary Bonsai 2.5 27B on a single 3090 against Qwen3.8 Q4_K_M to see if the speed is worth it.

Post image
1 Upvotes

r/llamacpp • • 3d ago

Inkling 2 Mini GGUFs, various sizes for Mac GPU (vision included)

Post image
1 Upvotes

r/llamacpp • • 3d ago

We gave Qwen3.5 9B and Qwen3.6 35B A3B 12 everyday file jobs on a 12 GB GPU: 35/36 and 36/36

Post image
3 Upvotes

r/llamacpp • • 3d ago

a fast flash attention 2 kernel for volta, for FP16 keys and Q8_0 values in the KV cache. performance gains in both prefill and substantially in decode - benchmarks included with integration instructions for drop in integration with your engine

Thumbnail github.com
1 Upvotes

reposting here! it's a native llama implementation


r/llamacpp • • 3d ago

Inkling 2 Mini on one RX 9070 XT: SaloQT's rdna4-amd-infer vs llama.cpp (same model, same context, same benchmark)

15 Upvotes

If you have an RDNA4 card and want to run Thinking Machines' Inkling 2 Mini, look at SaloQT/rdna4-amd-infer. I ran it against llama.cpp on the same model file, the same context size and the same benchmark.

The project

  • SaloQT/rdna4-amd-infer by SaloQT is a C11 inference engine for RDNA4 (gfx1201).

    • It has 310 hand-written GPU kernels, 217 of them for Inkling 2, all fused with no register spills.
    • It includes DSpark speculative decoding, a 4-bit global KV cache, and a VRAM expert cache that fits the full 256K context on a 16 GB card.
    • It also has vision and an OpenAI-compatible server.
  • It's built on hanw/amd.c by Han Wang, a from-scratch C11 inference engine for the same GPU with a formally verified indexing/quantization core. SaloQT credits it clearly, and the base engine is largely kept as-is. SaloQT added the Windows port, the Inkling and Saluki kernels, and the model-specific features on top.
  • Licensing: neither repo has a license file yet, so treat both as personal use only.

Setup

  • Hardware: RX 9070 XT 16 GB (RDNA4, gfx1201), i9-14900K, 32 GB DDR5, PCIe 5.0, Arch Linux with ROCm.
  • Model: AtomicChat's Inkling-2-Mini IQ3_XXS GGUF for every engine (the ie engine and my fork read a layout-converted copy of the same weights).
  • Context: 256K for every engine, each with its own memory layout for that size. The llama.cpp builds keep the experts of 9 outer blocks in system RAM; my fork adds a hot-expert VRAM cache. rdna4-amd-infer keeps all 12 outer blocks' experts in RAM behind a 64-slot VRAM cache per block.
  • Benchmark: the same script for every engine, greedy:

    • three short prompts (code, edit, prose), up to 512 tokens each, twice;
    • a 14K-token prompt, twice;
    • a 56K-token prompt.
  • Speeds: each server's own timings.
  • Safety: total VRAM capped at 15.8 GB, desktop included.

Engines

EngineBuildSpeculative decoding
llama.cppggml-org master 87f816en-gram only (master can't load any Inkling drafter)
llama.cpp + DSpark PRmaster + PR #32218 (e4b1cb5)DSpark (depth 5) + n-gram
My forkUnsloth's llama.cpp fork + 37 Inkling patches (fused kernels, banded flash attention, expert cache)DSpark + n-gram
rdna4-amd-inferSaloQT 90c7d21DSpark, 7 drafts

Stock llama.cpp needs ubatch 32 at 256K, because its Inkling attention reserves a 12.9 GB buffer at 512.

Results (IQ3_XXS, 256K context)

EngineCode / edit / prose14K prompt read, then decode56K prompt read, then decodePeak VRAM
llama.cpp23 / 22 / 23 tok/s181 tok/s, then 44146 tok/s, then 2314.6 GB
llama.cpp + DSpark PR31 / 26 / 17out of VRAM*—15.8 GB
My fork89 / 88 / 601,726, then 1061,512, then 7214.8 GB
rdna4-amd-infer146 / 153 / 1083,084, then 1342,997, then 10412.8 GB

*The PR's DSpark drafter needs extra VRAM; at this placement it went over the 15.8 GB cap during the 14K prompt.

The decode after the 14K prompt is higher than on the short prompts for the llama.cpp builds because the summary repeats text from the prompt, which n-gram drafting picks up.

Against stock llama.cpp, rdna4-amd-infer is 5–7× faster on short chats, 17–21× faster at reading long prompts, and 4.6× faster decoding after a 56K prompt, while using less VRAM.

Notes

  • The engine reads only specific quants: IQ3_XXS experts with IQ4_NL down projections. Q4_K_M and similar files still need llama.cpp.
  • SaloQT targets Windows, but it builds and runs fine on Linux with the system ROCm. Image decoding is Windows-only (WIC) out of the box.
  • One machine, greedy benchmarks, ±5–10% noise because the desktop shares the GPU.

If you have an RX 9070 / 9070 XT, try it, and give SaloQT's repo and Han Wang's amd.c a star.


r/llamacpp • • 3d ago

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

Thumbnail
github.com
1 Upvotes

r/llamacpp • • 4d ago

GLM-5.3-Flash on numallama CPU-only inference | 256 ARM Cores + 1TB RAM

1 Upvotes

r/llamacpp • • 4d ago

Inkling 2 mini on 1x3090: 125 TPS at 100k tok depth, 1700 pp/s, 401K ctx, same KLD as UD-4K XL; 3x faster than stock llama.cpp

Thumbnail
reddit.com
2 Upvotes

Updated as of today: boosted speed ~10% on decode (140+ tps) and 30-40%+ on prefill (24-2700/s) vs yesterday. No quality loss.


r/llamacpp • • 4d ago

Best llama.cpp Fork / Inference Engine for Running Inkling Small 2 Mini at Maximum Context on 16GB VRAM + 32GB RAM?

Thumbnail reddit.com
1 Upvotes

r/llamacpp • • 4d ago

I tried fitting a quantization grid myself — sort of works on small models

1 Upvotes

I'm just a regular local-model user. Independent researcher, no lab, no affiliation. I use some models locally and wanted better quantization quality, so I started poking at it.

I tried fitting the grid per tensor, from the weight distribution plus Hessian diagonals. No training, no gradients, CPU/GPU only.

Tested on SmolLM-135M and Qwen2.5-0.5B. On Qwen at 4 bits, ppl went from 22.65 to 19.23 versus a uniform grid (fp16 is 17.07). On SmolLM at 3 bits, 1580 to 52.6 — still nowhere near fp32 at 23.36 but it is massive improvement from 32 to 3 bit - model still alive. So something is there, but it needs a lot more work. The llama.cpp version is a reference kernel: slower than Q4_K_M and worse in the runtime test, so don't treat it as a drop-in upgrade.

I wrote it up and put everything online — the preprint, the paper, code with raw results, the GGUFs, and a llama.cpp fork with the Q4_LUT format:

Ask away if you want details on the fitting or the format — I'll answer what I can.


r/llamacpp • • 5d ago

I almost sold my daughter's Roblox laptop for a used 3090. Instead, I linked it to my AMD desktop over Ethernet and hit 42.99 tok/s on Qwen3.8-27B (Q4_K_M, 64k)

Post image
0 Upvotes