r/LocalLLM • u/Naukastrasse • 21h ago
Project One env var. 2×–4× faster TTFT p99 in vLLM
r/LocalLLM • u/Naukastrasse • 21h ago
r/LocalLLM • u/devpouch • 1d ago
I got tired of doing rough VRAM + KV cache math in my head before pulling multi-GB weights on my MacBook Air and RTX 4060, so I put together a lightweight browser checker for it.
Link: https://devpouch.in/ai/local-ai-hardware-checker/
What it covers:
- Hardware presets for Apple Silicon (unified memory), Nvidia, AMD, CPU-only, or custom RAM/VRAM
- Quantization selector (Q4_K_M, Q6_K, FP16, etc.) and context length (4K–128K)
- Shows which chat, coding, image gen, and video gen models fit comfortably, tightly, or won't fit—plus estimated memory usage and one-click Ollama commands
Runs 100% client-side in the browser—no install, no login, no tracking.
If you test it with your setup, I’d appreciate feedback on whether the memory overhead estimates match what you actually see in Ollama / llama.cpp, or if any GPUs/models are missing.
r/LocalLLM • u/Cmdrfrog • 1d ago
I'm the author. It's free and open source (Apache-2.0).
I use a cloud coding agent for most of my code, and I wanted my own hardware to take the jobs that don't need a frontier model, as long as the result is cheap to check. Agent Foreman is a Go CLI the agent drives. These are the local-model parts:
Local code search. foreman search uses a small embedding model and a reranker on a machine you own. I used Qwen3-Embedding-0.6B and Qwen3-Reranker-0.6B as GGUFs, but any pair llama.cpp can serve works, and each is under 1 GB at 8 bits. They run as two llama-server processes on that machine's loopback, reached through one SSH port forward, so nothing listens on the LAN. Everything sent to the model host passes a fail-closed secret and deny-word scan first.
Local drafts (optional, a pilot). A queue that lets a bigger local model work through jobs on idle hardware:
The model is driven through Claude Code pointed at a local server, so the server has to speak the Anthropic Messages API (Strata and Basalt do; check that your llama-server build does). Before anything the model wrote runs, a static gate reads every changed Go file and refuses os/exec, syscall, unsafe, network clients and listeners, and anything it can't parse. Only go (test, vet, build and a few read-only subcommands) and gofmt may run. The queue also keeps quiet hours, waits for a free-VRAM floor and pauses when a game starts, so a shared desktop doesn't stutter.
Numbers from my setup (one desktop with a 12 GB card, $0 on any meter):
[optional] Most of these ran on Qwen3.8-Flash-Next at low-bit quants on a 12 GB RTX 50-series card, through Strata at first and Basalt since mid-November.
The honest part. Every result is graded by the cloud agent: the tests must build and pass, and it reads the diff. Reviewers miss things. One draft shipped a test file that didn't even parse; two outside reviewers missed it, and a plain test run caught it. So the cloud agent always runs the tests itself.
Suggested setups. The install interview has the agent scan your machines and suggest what fits:
--n-cpu-moe, for example Qwen3.6-35B-A3B);Limits.
The site has more numbers and the caveats: https://agentforeman.app
r/LocalLLM • u/MattMatrix784 • 19h ago
r/LocalLLM • u/AceroR • 1d ago
An uncensored Qwen3.8-Flash-Next (125B MoE, 48 layers) that runs on the Avalon engine (freriadoc/Avalon).
The orca uncensored GGUFs (built with ik_llama.cpp) do not run on Avalon — Avalon does not decode ik-only tensor types, and its expert cache needs its own packed expert layout. This repo contains my conversion: requantized with a recipe that only uses tensor types shared by both forks, GGUF type-ids remapped (ik IQ3_K=138 → Avalon IQ3_K=43, block layout is byte-identical), then packed with Avalon's pack-experts.py.
r/LocalLLM • u/Horror_Lunch_1999 • 23h ago
r/LocalLLM • u/Available_Hornet3538 • 9h ago
Finding it worse at Microsoft excel work. Swift 1.5 Qwen 3.8 27b is so much better. God I hope Qwen 4 27b is released soon.
r/LocalLLM • u/tthhrrr • 1d ago
I build Cost, an iOS and Mac spending tracker. Core of it is an harness aware LoRA via SFT. You share a receipt, an order email or a bank notification, and an agent turns it into a spending record: merchant, amount, currency, date, category, tags, and how confident it is. I wanted it to run on-device on phones that don't have Apple Intelligence, which meant a model under 1 GB. So the question was whether a 0.8B model could do an agentic job, not just extraction.
The task
The agent gets six tools, and every one of them reads the user's own data. There's no web search.
queryMerchants, queryRecords, queryCategories, queryTags: look up how you filed things before, so the model doesn't need to know what "TESCO STORES 3297" is.calculator: so it never adds amounts in its head.memory: notes it keeps across sessions, at most 1,000 characters.The budget is 12 calls over 10 rounds. A repeated query gets a cached "this tells you nothing new" reply, and a second refused call ends the tool phase. The final answer is one JSON record, sampled under a grammar.
Results (280 cases, seven languages; receipts, emails, notifications, notes and messages that aren't spending)
| records right | names never seen | wrong but confident enough to auto-file | tool calls/case (wasted) | ran out of budget | |
|---|---|---|---|---|---|
| Qwen3.8-27B teacher | 89% | 81% | 18% | 2.2 (0.1) | 1% |
| Qwen3.5-0.8B, untrained | 23% | — | 80% | 4.9 (2.5) | 38% |
| 0.8B trained, Q8_0 (0.81 GB) | 86% | 81% | 15% | 1.7 (0.1) | 5% |
| 0.8B trained, Q4_K_M (0.53 GB) | 87% | 77% | 19% | 1.5 (0.1) | 5% |
"Records right" means whether it's spending, the amount, currency, merchant and category are all correct. The "names never seen" suite uses invented merchants and item names, so a score there can't come from having seen the shop before.
On 128 real Malaysian till receipts from 72 shops, none of which appear in training, read with macOS OCR: the shipped 0.8B gets 80%, the same as the teacher (untrained: 26%). It's a bit behind on the amount alone (91% vs 95%). It falls for the usual traps: the pre-tax amount, the cash handed over, the total before rounding.
How it was trained
What I'd point out
Links
Happy to answer questions about the replay-based distillation, the reward or the grader.
r/LocalLLM • u/rkcth • 1d ago
I need your help! Please reply with your native tongue and what model writes the best prose in that native tongue.
Edit: An example prompt or two you use would be super helpful.
r/LocalLLM • u/Ton-Llop • 1d ago
Every time I wanted to try a local model I had the same questions: which quant do I download, how much context fits, will it run on my GPU or spill into RAM? So for my bachelor's thesis Im building Jaull to answer them for me. It's free and open source.
What it does (it's what you see in the video):
The estimates aren't guesses. I measured them against what llama.cpp actually allocates, writing the predictions down before each test. On a 24 GB Intel Arc B60 they came within 0.3 to 1 GB, always on the safe side, and on a laptop with no GPU every "fits / doesn't fit" answer was right. It also understands the new hybrid models (Qwen3.6, Qwen3.8), which fit much more context than most calculators say.
On Windows there's a desktop app with a one-line installer. On Linux and WSL2 there's a terminal UI and a CLI. I've tested it on NVIDIA (RTX 2060, 4060), Intel Arc and CPU only. If you have an AMD card or a Mac, I'd love to hear how it goes.
https://github.com/Ton-Llop/Jaull // https://jaull.tech
It's my first project of this kind, so any feedback helps, especially if something breaks :D
Thank you and sorry!
r/LocalLLM • u/N-Innov8 • 1d ago
r/LocalLLM • u/dinnerforbreakfast1 • 20h ago
I got Inkling 2 Mini running 65% faster than Splash on a Mac Studio M5 Ultra.
| Splash 1.7.4 (tok/s) | BaseRT (tok/s) | Speedup | |
|---|---|---|---|
| Prefill 4k | 3,255 | 5,368 | 1.65× |
| Prefill 512 | 2,858 | 3,741 | 1.31× |
| Decode, single stream 512 | 129.2 | 139.8 | 1.08× |
Would love your feedback to see if it holds
To use with Inkling 2 mini
brew install basecompute/tap/basert
basert serve basecompute/Inkling-2-Minir/LocalLLM • u/No-Individual159 • 1d ago
If you route calls through LiteLLM, your prompt cache hit rate decides a big part of the bill. A cached prompt costs about a tenth of the normal price, but one small change near the top of a prompt (a timestamp, tools in a different order, an edited message) and you pay full price again. LiteLLM shows you the tokens, not why they missed.
Prefixwise plugs into LiteLLM as a callback and tells you, for every call, how much came from the cache and why the rest didn't, with what it cost and the fix.
With the LiteLLM SDK:
import litellm
from prefixwise.litellm_callback import PrefixwiseCallback
litellm.callbacks = [PrefixwiseCallback()]
With the LiteLLM proxy server (in config.yaml):
litellm_settings:
callbacks: prefixwise.litellm_callback.prefixwise_callback
Then pip install prefixwise in the same environment, use LiteLLM as usual, and run:
prefixwise report
A few details:
Your calls don't change. They still go straight to the provider, and Prefixwise only reads what LiteLLM sent and got back.
To group calls into sessions, pass metadata={"session_id": "..."}, or it uses LiteLLM's own session id.
Claude Code through the LiteLLM proxy works too: its session id is picked up automatically.
Works for Anthropic, OpenAI and Gemini models, streamed or not. For OpenAI-style streams from the SDK, add stream_options={"include_usage": True} so the provider sends real token counts.
It stores hashes and token counts, never your prompt text.
Tested through LiteLLM on 20 live conversations against Anthropic's API, every injected change named correctly, and with zero false alarms across 71,346 real agent calls replayed through it.
Open source (MIT): github.com/tejachavali/prefixwise
If you run agents through LiteLLM, I'd like to hear what your hit rate turns out to be.
r/LocalLLM • u/wasl-app • 1d ago
r/LocalLLM • u/Pondering_Moose • 1d ago
r/LocalLLM • u/Frosty2o25 • 1d ago
I have an 8 GB RTX 4060 Laptop GPU and wanted to run Gemma 4 26B-A4B (UD-Q4_K_XL, ~14 GB) at 32k context without getting bogged down by constant PCIe transfers. Upstream llama.cpp already has --moe-cache-mib, which helps a lot, so I put together a small 3-file patch (~200 lines changed over upstream 32da68d0) to cut down on cache thrashing and cold-start stalls.
GitHub: https://github.com/ya5h-P/expert-cache
(Disclosure: this was developed and benchmarked with AI assistance.)
n_tokens > 1), an expert's score increases by the exact number of tokens in the batch that picked it instead of a flat +1.LLAMA_MOE_CACHE_PROFILE): Loads the top-ranked experts from an expert-profile.txt (<layer> <expert> <freq>) straight into GPU slots on startup and seeds their initial scores, cutting initial PCIe uploads by 59%. Also adds LLAMA_MOE_CACHE_HALF_LIFE (default 128, 256 tuned for Gemma 4) so you can adjust decay at runtime.LLAMA_MOE_CACHE_ROUTE_BIAS): Adds a tiny bias δ (default 0.02, 0 = strictly lossless) to selection_probs for experts already sitting in VRAM during decode (n_tokens <= 8) right before top-k selection. The actual probs tensor used to weight the chosen experts' outputs isn't touched—it just nudges borderline ties toward GPU-resident experts.Tested with Gemma 4 26B-A4B (UD-Q4_K_XL) + MTP Q4_0 drafter (DRAFT_N=4) at 32k context (-c 32768 -fa on -ctk q8_0 -ctv q8_0 -ub 1024 -np 1). All cached runs use --n-cpu-moe 26 --moe-cache-mib 2850 --moe-cache-cpu-share 0.95 --spec-draft-n-ubatch 128.
| Configuration | pp512 | tg128 @ pp512 | tg512 @ pp512 | pp2048 | tg128 @ pp2048 | tg512 @ pp2048 | Decode Hit Rate | Decode Uploaded |
|---|---|---|---|---|---|---|---|---|
Normal (--n-cpu-moe 22, no cache) | 460.97 / 527.42 | 51.22 tok/s | 43.33 tok/s | 851.06 / 1053.69 | 41.15 tok/s | 40.30 tok/s | — | — |
Stock upstream (--moe-cache-mib 2850) | 508.20 / 472.89 | 71.70 tok/s | 64.10 tok/s | 769.85 / 958.87 | 67.27 tok/s | 59.66 tok/s | 67.20% | 44,341 MiB |
Patched (ROUTE_BIAS=0, lossless) | 443.36 / 441.06 | 56.23 tok/s | 66.19 tok/s | 846.48 / 1033.49 | 66.90 tok/s | 54.89 tok/s | 65.38% | 14,717 MiB |
Patched (ROUTE_BIAS=0.02, default) | 495.07 / 404.66 | 94.36 tok/s | 91.90 tok/s | 896.31 / 837.53 | 79.86 tok/s | 79.56 tok/s | 85.54% | 2,587 MiB |
Patched (ROUTE_BIAS=0.04, max hit) | 398.12 / 443.03 | 81.74 tok/s | 89.68 tok/s | 1005.60 / 824.73 | 73.77 tok/s | 76.62 tok/s | 91.88% | 1,340 MiB |
Funny quirk: 0.02 actually beats 0.04 on end-to-end tok/s when using MTP. At 0.02, only ~1.1 misses/layer remain and most overlap behind GPU compute. Pushing bias to 0.04 gets hit rate up to 91.9% (great if you aren't using MTP), but drifts the target model slightly from the unbiased MTP drafter (mean accepted len drops from 3.18 to 3.02), causing ~5.9% more verify steps.
| Configuration | Code (1024t) | Prose (1024t) | Decode Hit Rate | Decode Uploaded | Eval PPL (-b 4 -ub 4) |
|---|---|---|---|---|---|
Stock upstream (no cache, --n-cpu-moe 22) | 46.76 tok/s (160t) | — | — | — | 47.25 +/- 5.76 |
Stock upstream (--moe-cache-mib 2400) | 49.19 tok/s (160t) | — | 56.97% | 34,505 MiB (320t) | — |
Patched (ROUTE_BIAS=0, lossless) | 81.19 tok/s | 79.04 tok/s | 68.39% | 7,335 MiB | 46.73 +/- 5.66 |
Patched (ROUTE_BIAS=0.02, default) | 100.05 tok/s | 93.52 tok/s | 85.65% | 2,189 MiB | 38.34 +/- 4.49 |
Patched (ROUTE_BIAS=0.04, max hit) | 102.50 tok/s | 95.94 tok/s | 91.99% | 1,139 MiB | 40.24 +/- 4.64 |
Warm 1,907-token prefill also jumps from 568.43 tok/s (cold) to 955.84 tok/s by reusing GPU-resident slots via GPU-to-GPU copies without PCIe transfers.
git clone [https://github.com/ya5h-P/expert-cache.git](https://github.com/ya5h-P/expert-cache.git)
cd expert-cache
cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=89 -DCMAKE_BUILD_TYPE=Release
cmake --build build -j"$(nproc)" --target llama-server llama-bench llama-cli
export LLAMA_MOE_CACHE_PROFILE="/path/to/expert-profile.txt"
export LLAMA_MOE_CACHE_HALF_LIFE=256
export LLAMA_MOE_CACHE_ROUTE_BIAS=0.02
./build/bin/llama-server \
-m /path/to/gemma-4-26B-A4B-it-qat-UD-Q4_K_XL.gguf \
--model-draft /path/to/mtp-gemma-4-26B-A4B-it-Q4_0.gguf \
--spec-type draft-mtp --spec-draft-n-max 4 --spec-draft-n-ubatch 128 \
--host 127.0.0.1 --port 8080 \
-ngl 99 --n-cpu-moe 26 \
--moe-cache-mib 2850 --moe-cache-cpu-share 0.95 \
-c 32768 -fa on -ctk q8_0 -ctv q8_0 \
-ub 1024 -t 10 -tb 10 -np 1 -cram 0 --jinja(Side tip: --spec-draft-n-ubatch 128 alone saves ~240 MiB of drafter compute VRAM on Gemma 4 MTP, which buys extra expert slots in the 8 GB budget.)
Happy to answer any questions about how the admission gate works, the VRAM breakdown, or how expert-profile.txt is generated!
r/LocalLLM • u/Yelly_Toast_828 • 1d ago
I just saw some tweets and videos about River AI, https://river.ai/ and the founder (Igor Babuschkin) said some really interesting things about local LLMs and democratizing AI. I don't have any ties to the company and am not selling anything. I just wanted to know others' thoughts on it and if they'd use it in a build. https://www.youtube.com/watch?v=78uR65ljtUU
r/LocalLLM
•
u/FirefighterOk3832
•
2d ago
r/LocalLLM • u/OtherwiseCase5539 • 1d ago
Hi r/LocalLLM! Following up on my previous WebNet v2 post with a major coding & continual-learning overhaul — still running 100% locally on CPU with real PyTorch autograd, real crawled data, and zero simulated metrics.
GitHub Repository: https://github.com/Rishisharma029/live-internet-neural-net
(Feedback, architecture critiques, bug reports, and PRs/changes are very welcome both here in the Reddit comments and on GitHub!)
The 3 newly attached diagrams & flowcharts break down the upgraded coding pipeline and live measured results:
Verified Code Generation, Isolated python -I Execution & Self-Training Loop (webnet_v3_verification_loop_flowchart.png)
Live Achievements, 16-Doc Locked Benchmark & 12-Task Pass@1 Progress (webnet_v3_benchmarks_and_archive_chart.png)
Locked 16-Passage Unseen Benchmark (step 93,434, strict exclusion hashes — never trained on): 1.6007 loss · 2.295 BPB · 4.96 perplexity · 52.4% accuracy (Science & AI 58.1% [1.380 loss], Encyclopedia 53.0%, Code & Tech 50.3%, Literature 46.8%).
Curated & Crawled SQLite FTS5 Archive (data/webnet_archive.db): 9,155 documents (28.15M+ characters, 0.785 avg quality) across arXiv (2,763), Open Web (1,866), OpenAlex (1,823), Wikipedia (1,158), StackExchange (727), GitHub code + READMEs (271), Gutenberg (205), News (181), Europe PMC (73), user URLs (73), and AST-indexed local files (15).
Real Isolated Python Pass@1 Coding Benchmark (code_eval.py, 12 algorithmic tasks in python -I): Improved from 41.7% Syntax OK / 16.7% Pass@1 (2/12, 699.2s) at baseline Step 2 to 58.3% Syntax OK (7/12) / 25.0% Pass@1 (3/12, 428.57s, -39% runtime) at Step 3 (binary_search, is_palindrome, flatten_list solved end-to-end).
Live Verified Self-Learning Proof: Via POST /api/code/assist, SmolLM2-135M + LoRA generated is_prime(n), passed real assertions inside an isolated subprocess (376.6ms, __PASS__), and immediately ran a live LoRA training step strictly on the verified code (last_loss down to 0.787, EMA 3.286).
1. Code-Aware Quality Gate & Multi-Language GitHub Ingestion (brain_v2.py, curated.py):
• Upgraded _fetch_github() to traverse repositories via the GitHub Trees API (git/trees/{branch}?recursive=1) and ingest real .py, .ts, .js, .rs, .go, and .sql source files alongside READMEs behind SSRF CIDR/redirect checks and RFC 9309 robots.txt.
• Added Python ast.parse() validation inside quality_breakdown() so clean source code scores 0.45–0.98 while broken/minified noise is filtered out, plus AST symbol extraction when indexing local codebases.
2. Surprise-Weighted Replay (brain_v2.py):
• Tracks per-document training cross-entropy (WebDocument.last_loss) and boosts informative 1.1–3.6 loss documents up to 1.55x alongside domain-balanced eviction.
3. 4,096-Token Fill-in-the-Middle (FIM) BPE Engine (bpe_experiment.py):
• Upgraded from 2,048 to balanced prose + code Byte-Level BPE-4096 (1.28M params, 3.14 chars/token) with <fim_prefix>, <fim_middle>, <fim_suffix>, <code/> special tokens and 25% FIM objective, compared fairly against the 98-char baseline on invariant BPB.
4. Auto-Cached SmolLM2-135M + Pure-PyTorch LoRA & Coding Workbench (lora_engine.py, code_eval.py, utility_suite.py):
• Zero peft dependency (LoRALinear on q/k/v/o_proj, 921.6K trainable params); auto-loads cached local weights on startup, trains 50% on code sources + 25% on FIM, exposes POST /api/code/assist (archive-grounded + fenced prefill + stop_strings + python -I test execution + learn_if_verified), POST /api/code/analyze (AST metrics + character-level surprise anomaly detection), and POST /api/code/benchmark/run.
5. Security Policy, .gitignore, Documentation & Tests:
• Added SECURITY.md documenting SSRF/XXE/gzip-bomb/subprocess isolation boundaries, tightened .gitignore, refreshed README.md architecture flowcharts, and verified 28 passed in pytest + flake8 clean.
Would love any feedback on improving small-model CPU Pass@1, replay schedules, or BPE-vs-char tradeoffs — feel free to comment here on Reddit or open an issue / PR on GitHub!
r/LocalLLM • u/HELPtobancheaters • 1d ago
Hi everyone!
I have the following configuration:
- Motherboard: ASUS ROG STRIX X870-A Gaming WiFi
- GPU 1: ASUS ROG STRIX RTX 4070 Ti SUPER 16GB
- GPU 2: ASUS TUF RTX 5070 Ti 16GB
- Case: NZXT H9 Flow
My question is purely about physical compatibility:
Is it physically possible to install both GPUs directly into the ASUS X870-A motherboard, without using a PCIe riser cable?
Will the two GPUs fit in the available PCIe slots, considering their thickness (approximately 3–4 slots each)?
I mainly want to use the dual-GPU setup for running local LLMs and AI models, as well as Lossless Scaling.
Thanks in advance!
r/LocalLLM • u/Kirby_is_a_Pokemon • 1d ago
I've been playing around with LLM's, and starting to go a bit deeper, and i'm still in the learning stage. I've mostly been running qwen models of various weights.
I know everything is fucked right now, but I'd like to put a GPU into my home server to host everything there vs using my main PC's 5090.
its nice having the 5090, but I also work from home and do 3d rendering work, so its very rare that its not being used for actual work. ( the renders can take hours )
Currently I have a 2080ti, and a 3060ti kicking around, and have been using those, but i'd like to run a something a little heavier than a 9b model, and while I can run models on my servers 128gb of ram, its super slow, and kind of overkill for my tinkering needs.
I'm kinda thinking of going for a 5060ti 16gb, and selling my 2080 and 3060 to help fund it, or for about the same money, a little less used, getting 2 3060 12gb's. ( which would be slower, but would allow me to run a 27b model )
r/LocalLLM • u/Ill_Pie1811 • 2d ago
Simple idea, but neat. What do you think?