Repository navigation
Releases
v0.1.1: 4 GB by default, and steady on a busy machine
Two months of work on the CPU path since v0.1.0. ramvamp now runs inside a 4 GB memory budget by default, behaves on a machine that is busy with other things, prefills at 24-25 tok/s where v0.1.0 published 11.25, and has passed its last correctness gate: perplexity within 0.33% of llama.cpp on the same weights. The model and the installed .rvmp format are unchanged, so an existing install keeps working.
Highlights
The memory contract is 4 GB, with 19 expert slots per layer (EXP-033). The default expert cache grew from 1,440 MiB (11 slots per layer) to 2,485 MiB (19). Paired in one session, that is decode 1.26x faster at ctx 512 and 1.12x at ctx 3,961, with prefill and output unchanged, and a peak of 4,008 MiB at a 4K context against a 4,096 MiB ceiling. --cache-bytes 1440M keeps the 3 GB configuration (see Upgrade).
It runs on a machine in ordinary use (EXP-027, EXP-031). v0.1.0 split every matrix-vector product into six fixed slices, one per performance core, so anything else running on one of those cores slowed every token. Work is now handed out in chunks from a shared counter, and threads run wherever the scheduler puts them (--placement shared, the new default). In warm diagnostics on a busy machine, one busy core now costs prefill 4-5% instead of 19-22%. Output is bit-identical either way.
The common weights are read into memory once, not mapped (EXP-031). On a machine short of memory, the kernel reclaimed mapped common weights from a running model: once it took 801 MiB of them mid-run and decode fell to 1.43 tok/s. They are now read into anonymous memory at load (--common-memory resident, the default), which costs about 0.75 s of load time and 70 MiB of peak, and no measured resident run has had to read a page back. To make that hold, generate, chat, serve and logits now re-launch themselves once in a systemd-run --user scope with swap turned off. No root is needed, and it is skipped when swap is already off, when RAMVAMP_NO_SCOPE is set, or when there is no systemd user session.
Prefill's serial work moved onto the pool (EXP-028, EXP-029, EXP-032). The router, the per-row elementwise work and the per-expert glue used to run on one thread while the pool waited; they run on the pool now. The batched Q4_K and Q6_K kernels dot four activation rows per pass and share the weight-side work across them, bit-identically. v0.1.0 published 11.25 tok/s at ctx 512; this release measures 24-25 tok/s. Those come from different sessions, so they sit side by side rather than as a ratio; the paired gains are in the experiment log.
Gate 5 passed: perplexity (EXP-035). ramvamp perplexity scores a text file by llama-perplexity's exact protocol. On WikiText-2 it scores 6.3598 against llama.cpp b10217's 6.3810 on the same GGUF, -0.33%, inside a 1% bar set before the run at every one of 40 windows, with identical token streams. Every v0 correctness gate is now closed.
Longer replies were measured, and the cache is not the problem (EXP-034). The published decode figures are short windows that start from an empty cache. Measured cold over 128, 256 and 512 new tokens, the hit rate is flat at 67.1-67.7%: the cache fills within a few tokens. A long reply is slower anyway, by attention growing with context: 2.80, 2.79 and 2.61 tok/s over 128, 256 and 512 new tokens at ctx 512.
Agents can drive the chat panel. chat --tui publishes its state as a semantic tree over taria, so an agent can read the panel and type into it. Its input goes through the same key handlers a keyboard does, so it can reach no state a keyboard cannot.
Smaller fixes. tokenizer.json (11 MiB) no longer lingers in the page cache after load. On btrfs, direct reads of compressed extents go through the page cache, and loading the common weights now drops those pages behind it.
Measured performance
Intel Core Ultra 9 185H (CPU only, 16 GB RAM, Micron 2400 DRAM-less QLC NVMe) running Qwen3-30B-A3B Q4_K_M with a cold page cache inside memory.max=4G and memory.swap.max=0, at the default 19 slots per layer, with the machine in ordinary use and every run hygiene-clean (EXP-033):
| measured | |
|---|---|
| Decode | 2.78 to 2.81 tok/s at ctx 512 (--max-new 128), 1.96 tok/s at ctx 3,961 |
| Prefill | 24.48 to 25.27 tok/s at ctx 512, 18.23 at ctx 3,961 |
| Expert cache hit rate | 67.1% at ctx 512, 68.3% at ctx 3,961 |
| Peak RAM | 3,690 to 3,697 MiB at ctx 512 and 4,008 MiB at ctx 3,961, of a 4,096 MiB ceiling |
| Fidelity | WikiText-2 perplexity 6.3598 against llama.cpp's 6.3810, -0.33% (EXP-035); mean full-vocab KL 1.04e-2, top-1 8/8 (EXP-004) |
With --cache-bytes 1440M inside memory.max=3G (EXP-032): decode 2.18 to 2.24 tok/s and prefill 23.93 to 24.21 tok/s at ctx 512, peak 2,638 to 2,657 MiB.
Decode is I/O-bound, so these figures belong to this DRAM-less QLC drive as much as to the code. A faster drive should move them; by how much has not been measured. Conditions and the full table: docs/benchmarks.md. Every EXP-NNN is a row in docs/experiments.md.
Install
curl -sSL https://y0sif.github.io/ramvamp/install.sh | bashOr cargo install ramvamp ramvamp-repack --locked, or the Linux x86_64 tarball below. Linux x86_64 only.
Upgrade
No re-install of the model: the .rvmp format is unchanged.
The default now needs about 4 GB, not 3. If you relied on the 3 GB footprint, pass --cache-bytes 1440M, or set "cache_bytes": "1440M" in your profile. ramvamp plan shows what any configuration will need before loading anything.
Model commands now run in their own swap-off scope. If that gets in the way, for example inside a container or under your own cgroup setup, set RAMVAMP_NO_SCOPE=1. --common-memory mapped restores v0.1.0's mapped common weights.
Threads are no longer pinned one per core. --placement per-core (or RAMVAMP_PLACEMENT, or a profile's placement) restores v0.1.0's layout. On an idle machine it is still slightly faster, about 4% on decode's matrix-vector work in a microbenchmark; on a busy one it is much slower.
Full Changelog: v0.1.0...v0.1.1
v0.1.0: a 30B model in 3 GB of RAM, no GPU
ramvamp is a Rust runtime that runs a 30B-parameter Mixture-of-Experts model in about 3 GB of RAM on an ordinary Linux x86_64 machine with no GPU. It does that by never loading the checkpoint into memory: the always-needed common weights stay memory-mapped, and the routed experts, which are most of the model, live on an NVMe SSD in a page-aligned packed format and are read with io_uring and O_DIRECT only when the router asks for them, through a small per-layer cache.
This is the first release. It runs Qwen3-30B-A3B Q4_K_M on CPU inside a 3 GB memory cgroup with a cold page cache, and the forward pass is validated against llama.cpp on byte-identical weights.
Highlights
ramvamp serveis the shipping surface. OpenAI Chat Completions on127.0.0.1:/v1/chat/completionsstreaming SSE and buffered,/v1/models,/health. Tool calls work in both paths, parsed from Qwen's native<tool_call>tokens, sharing one parser and one id minter; the renderer is byte-identical to 20 committed transformers fixtures, and OpenCode drives it with real tool calls. It serves one request at a time on purpose, and reuses the KV cache across requests by longest-common-prefix match against the ids actually fed, so a repeated system prompt is not re-prefilled every turn. Fields it cannot honour exactly (n > 1,stop, forcedtool_choice, non-text content parts) come back as typed400s rather than being accepted and quietly ignored.ramvamp chat, with an optional live status panel. A multi-turn REPL.--tuiadds prefill progress, tokens per second, context used and the expert cache hit rate, updated while it generates. That exists because a long prompt is minutes of prefill before the first character appears, and silence is indistinguishable from a hang. Plainchatstays the reference behaviour.ramvamp-repack installis a streaming installer. Ranged Hugging Face downloads repacked directly into the.rvmplayout in one pass, with resume and verify. No full model, shard or tensor is ever materialized in heap memory, and the quantized bytes are copied unchanged: it repacks, it never requantizes.ramvamp generateandramvamp plan.generatestreams a completion to stdout with timing and expert-streaming stats on stderr.planresolves the dials and prints the projected memory footprint without loading the model, so "will this fit here" is answered in well under a second instead of by an OOM kill part way through prefill.- Context is a dial and configurations have names.
--context(default 4096) trades conversation length against resident bytes, and--profile/--config/RAMVAMP_CONTEXTname and reuse a set of dials. A 32K profile projects roughly 5,649 MiB and needs a bigger budget than 3 GB; the 3 GB contract is a property of the 4K default, not of the runtime. - The expert cache is small on purpose. At the default 1,440 MiB budget that is 11 slots per layer out of 128 experts. Per layer the router picks 8 of 128; hits dispatch to the compute pool immediately and the misses go to io_uring as one batch of O_DIRECT reads, which bypass the page cache and so cost the memory budget nothing, with the hit compute hiding their latency.
Measured performance
Intel Core Ultra 9 185H (CPU only, 16 GB RAM, Micron 2400 DRAM-less QLC NVMe) running Qwen3-30B-A3B Q4_K_M with a cold page cache inside memory.max=3G and memory.swap.max=0, release build, at the shipped 11 slots per layer:
| measured | |
|---|---|
| Decode | about 2 tok/s: 1.46 to 2.19 tok/s over ctx 64 to 3,961 (EXP-023), and 1.43 to 2.16 over the same rungs on a later branch (EXP-025) |
| Prefill | 11.25 tok/s at ctx 512 (EXP-023) |
| Peak RAM | 2,497 to 2,929 MiB of a 3,072 MiB ceiling: 2,497.0 at ctx 64 (EXP-025), 2,929.3 at ctx 3,961 (EXP-023) |
| Expert cache hit rate | 53.0% to 59.3% across five context rungs, no trend in context (EXP-023) |
| Model on disk | 17.35 GiB, about a 6x memory saving |
| Fidelity | mean full-vocab KL 1.04e-2 against llama.cpp, top-1 agreement 8/8 (EXP-004) |
Those are two decode ladders and not one curve. They come from different binaries in different sessions, and the drift between sessions is measured rather than assumed: the later session re-ran EXP-023's byte-identical binary at two rungs and read 1.85 tok/s against 1.91 at ctx 512, and 1.33 against 1.46 at 3,961, which is 3.1% and 8.9% slower a day later on the same machine with no code change. On a DRAM-less QLC part a decode figure describes its session as well as its device.
The conditions that make those figures valid, all of which each run satisfies: the page cache is evicted before the run and the eviction is proven with mincore rather than trusted; the run is inside memory.max=3G with memory.swap.max=0, because zram counts as swap and a run that swaps is measuring reclaim rather than decode; it is a release build, since the debug profile is opt-level = 1 and not comparable; and it runs as the user that owns the install, because the kernel will not report page-cache residency for a file the process neither owns nor may write, so a model unpacked by root and run by you degrades to buffered reads and changes both the memory figure and the throughput figure.
One caveat those decode figures carry: they are taken at --max-new 64 from a cache the prefill sweep emptied, so the published curve describes the first 63 tokens after a prompt. Steady-state decode at 256 generated tokens and beyond has not been measured cold.
Conditions, drive detail and the full table: docs/benchmarks.md. Every EXP-NNN above is an entry in docs/experiments.md with what it tested, its evidence and its verdict.
What this is good for, and what it is not
About 2 tok/s is not fast, and it is worth saying plainly rather than leaving it to be discovered. This is a local 30B endpoint for a machine that could not otherwise run one at all: low-volume local chat and completion, on 16 GB of RAM and no GPU. It is not an agentic coding backend, where a single turn is thousands of output tokens and 2 tok/s is unusable.
Throughput is stated per drive on purpose. Decode is I/O-bound: expert reads are 44.4% of a decode token at ctx 512 and 33.2% at 3,961, and because that bucket is measured as a residual it is a lower bound rather than the drive's busy time. The reference part is DRAM-less QLC and sustains about 1.6 GB/s at decode's own read geometry: 1.565 to 1.694 GB/s with a median of 1.633 across all 48 expert files. A mainstream TLC Gen4 drive should do materially better. By how much is unmeasured, and this project does not publish numbers it has not measured.
Install
One command, Linux x86_64 only:
curl -sSL https://y0sif.github.io/ramvamp/install.sh | bashThat puts ramvamp and ramvamp-repack in /usr/local/bin. Pin a tag with RAMVAMP_VERSION=v0.1.0, change the destination with RAMVAMP_INSTALL_DIR, and re-run the same line to upgrade. On anything that is not Linux x86_64 it refuses and installs nothing.
Or take the tarball on this release directly, which is what the installer fetches anyway. It holds both binaries plus the README and both licences.
curl -sSL -o ramvamp.tar.gz \
https://github.com/y0sif/ramvamp/releases/download/v0.1.0/ramvamp-linux-x86_64.tar.gz
tar xzf ramvamp.tar.gz
sudo install -m755 ramvamp ramvamp-repack /usr/local/bin/Then install the model. That is a 17.35 GiB download, the destination wants to be on an NVMe SSD, and it should be run as the user who will run the model:
# Download and repack the pinned Qwen3-30B-A3B in one streaming pass.
ramvamp-repack install --output ~/models/qwen3-30b-a3b.rvmp
# Chat in the terminal, with the live status panel.
ramvamp chat --model ~/models/qwen3-30b-a3b.rvmp --tui
# Or serve it on loopback.
ramvamp serve --model ~/models/qwen3-30b-a3b.rvmp --port 8080Building from source needs Rust 1.88 or newer and nothing else; the tree has no C dependencies.
git clone https://github.com/y0sif/ramvamp
cd ramvamp
cargo build --releaseRequirements and limits
- Linux x86_64 only. io_uring is a Linux interface and the fast kernels are AVX2 plus F16C. Both have fallbacks, a
preadpath and a scalar reference, so the runtime does run elsewhere, slowly, but no number above describes those paths and the release ships no binary for them. - One model. Qwen3-30B-A3B Q4_K_M is the v0 pin.
ramvamp-repackrefuses any GGUF whose architecture is notqwen3moe, by name. Gemma 4 is the intended second model and is roadmap, not present tense. - An NVMe SSD, or the numbers above mean nothing. Decode is I/O-bound and the drive is the dominant term. About 18 GB of free space for the installed model.
- The server is loopback only, with no
--hostflag, no auth and no CORS. The HTTP layer has no header-size cap, so anything that needs to be reachable from elsewhere belongs behind a reverse proxy, which is also where TLS and request limits belong. - One v0 correctness gate is still open: perplexity against llama.cpp. The reference side is banked at PPL 6.3810 +/- 0.16588 (
llama-perplexityb10217, WikiText-2 raw,-c 512 --chunks 40, same GGUF); the ramvamp side has never been run. It is unclaimed and self-contained. - Model weights are not included and remain governed by their own terms.
What is next
From docs/roadmap.md, which is the plan of record. These are commitments to sequence, not to dates.
- Gemma 4 26B-A4B as model two. Structurally cheaper than the v0 pin: 30 layers against 48, and it has a shared expert, which is unconditional per-layer compute that outstanding reads can be overlapped against. Qwen3 has none, so today the decode loop's ...