Svarog is not just an LLM anymore. Svarog is an agentic coder (a router that drives Claude Code with an open model stack), and it is growing three new organs: a memory codec that stores long histories as a few learned entries, split-the-byte compression that keeps each entry at only the precision it needs, and Gamma Engine, real-time camera video that runs entirely in your browser.
The starting point is a known approach from published research on memory for video world models: write each chunk once into a few learned entries, give each a small landmark, read only the top-K. What Svarog adds (Swiss patent application filed 25 Nov 2026):
Toy world, CPU only: 1.25 M parameters, 2500 training steps; chunks of eight 16×16 views; 4 candidate entries of 96 values; landmarks of 4×8 summaries + entropy + pose + time; top-4 read. Requested quality is varied; bytes are per 8-frame chunk.
| requested | entry count only, 16-bit | joint entries × bit-width (ours) | bytes saved |
|---|---|---|---|
| 22.56 dB | 668 B · 18.40 dB | 586 B · 18.30 dB | 12 % |
| 21.56 dB | 500 B · 18.44 dB | 375 B · 18.33 dB | 25 % |
| 20.56 dB | 395 B · 18.47 dB | 250 B · 18.33 dB | 37 % |
| 19.56 dB | 320 B · 18.52 dB | 158 B · 18.36 dB | 51 % |
| 18.56 dB | 280 B · 18.52 dB | 113 B · 18.36 dB | 60 % |
| what is stored per chunk | bytes |
|---|---|
| raw 8-bit pixels of the 8 views | 6144 |
| one entry + landmark, 16-bit / 4-bit / ternary | 264 / 122 / 93 |
Honest status: the allocation result above holds (12–60 % fewer bytes for 0.10–0.16 dB). In this first toy run the retrieval part did not yet beat a simple recent-memory baseline; a retrained version is running on our GPUs now and its results will be posted here when measured.
router/ctx_codec.py is a dependency-free context codec for the Svarog router, enabled with SVAROG_CODEC=1 (off by default; with the flag off the router sends exactly the same messages as before, which a test checks).
Each provider tier gets its own read budget. In the test session (120 turns) a fact planted in the first turn is recalled while the conversation sent upstream shrinks to under half. All 5 tests pass.
| what | hardware | result |
|---|---|---|
| style network 320×240, onnxruntime, webcam | Ryzen 9 5900HS, CPU only | 3.5–4.75 fps · 205–291 ms (4 runs) |
| style network 224×168, onnxruntime, webcam | same | 10.8 fps · 88 ms |
| temporal memory (blend 0.6), 320×240 | same | flicker 6.8–9.6 → 3.3 × input |
| browser, WebAssembly 4 threads, 224×168, headless test | same laptop, busy | 4.5 fps |
Try it: gammaengine.ch. It's a fixed-style filter today, not the prompt-driven 720p restyling that cloud services run on data-centre GPUs. Prompt-driven one-step diffusion (SD-Turbo + tiny VAE) is next, on GPU.
KV cache. Random rotation + Lloyd-Max levels is what keeps very low bit-widths alive:
| KV cache | bits / value | perplexity | Δ |
|---|---|---|---|
| fp32 | 32.00 | 17.25 | +0.00 |
| naive-uniform | 4.50 | 17.95 | +0.71 |
| rotate+uniform | 4.50 | 18.10 | +0.85 |
| rotate+lloyd | 4.25 | 18.61 | +1.37 |
| naive-uniform | 3.50 | 24.54 | +7.30 |
| rotate+lloyd | 3.25 | 21.37 | +4.12 |
| naive-uniform | 2.50 | 122.97 | +105.73 |
| rotate+lloyd | 2.25 | 38.14 | +20.89 |
Weights, post-training only. 8-bit is free and 4-bit costs a little; everything below 2 bits collapses without quantisation-aware training, which is what sub-1-bit methods rely on. That training needs GPUs and is on our list.
| weights | bits / weight | perplexity |
|---|---|---|
| fp32 reference | 32.00 | 16.7 |
| int8 absmax per row | 8.02 | 16.7 |
| int4 group-128 | 4.12 | 19.9 |
| ternary absmean (b1.58) | 1.61 | 495272.3 |
| binary sign x row scale | 1.02 | 52405.1 |
| low-rank fp16 @ 1.0 bpw | 1.00 | 3600.7 |
| littlebit-style @ 1.0 bpw | 1.00 | 631146.6 |
| low-rank fp16 @ 0.55 bpw | 0.55 | 3584.3 |
| littlebit-style @ 0.55 bpw | 0.55 | 220245.0 |
| low-rank fp16 @ 0.3 bpw | 0.30 | 1847.6 |
| littlebit-style @ 0.3 bpw | 0.30 | 200924.5 |
| low-rank fp16 @ 0.1 bpw | 0.10 | 1908.3 |
| littlebit-style @ 0.1 bpw | 0.10 | 3131.2 |
| # | track | why this rank | status |
|---|---|---|---|
| 1 | agent memory codec in the Svarog router | works on every model tier including hosted ones, no training needed to start, clear evidence that memory raises agent success | built (text level), off by default |
| 2 | spatial world memory | the learned video version needs a jointly trained video model (beyond our GPUs); a geo-landmark version for our Zürich scout data reuses track 1's code | toy codec measured; geo version planned |
| goal | what it takes |
|---|---|
| faithful reproduction of a video memory codec | roughly 20k–60k H100-hours (≈ USD 54k–270k), licensed posed video data (most public sets are non-commercial), a pose-conditioned video model |
| minimal real-video experiment | 300–1,000 posed trajectories at 128 px, a 20–60 M parameter codec, ~10–80 h on a 16 GB GPU (≈ USD 1–10 rented) |
| prompt-driven camera changer | a working NVIDIA driver on our laptop (needs a reboot), then SD-Turbo + TAESD; 16 GB GPU for 30 fps |
| sub-1-bit LLM weights | quantisation-aware training on GPUs; post-training alone is not enough (see table above) |
The enabling techniques behind real-time world models and live camera-to-video, and where Svarog stands on each. It's a map, not a claim to be 30× faster.
| # | technique | Svarog / Gamma Engine |
|---|---|---|
| 1 | Causal autoregressive (chunk-wise) video diffusion | plans |
| 2 | Diffusion forcing: independent noise level per frame | can't yet |
| 3 | Training on its own imperfect rollouts (self-forcing) | can't yet |
| 4 | Few-step distillation (DMD, consistency, adversarial) | uses (1-step SD-Turbo) |
| 5 | Bidirectional teacher distilled into a causal student | can't yet |
| 6 | Long-rollout distillation against drift | can't yet |
| 7 | Rolling or pipelined multi-frame denoising | can't yet |
| 8 | Per-frame generation inside a hard latency budget | uses |
| 9 | Synthetic or engine-generated training data | plans |
| 10 | KV cache carried across frames | plans |
| 11 | Anchor frames and attention sinks | can't yet (output blending instead) |
| 12 | Short context window plus retrieval | uses (Svarog context codec) |
| 13 | KV recompute on a prompt switch | can't yet |
| 14 | Learned memory codec: write, landmark index, top-K read | uses + patent pending |
| 15 | Skipping redundant compute (similarity filter, feature caching) | plans |
| 16 | Feature-bank temporal consistency | plans |
| 17 | FP8 arithmetic | plans (Blackwell GPU) |
| 18 | 4-bit compute and storage | uses for memory entries; plans for weights |
| 19 | Megakernels and kernel fusion | can't yet |
| 20 | Graph compilers (TensorRT, torch.compile, OpenVINO) | uses (browser runtime) |
| 21 | Fast attention kernels | plans |
| 22 | Dynamic sparse / linear attention, token merging | plans |
| 23 | Tiny VAE decoders | uses (TAESD) |
| 24 | Removing guidance cost | uses |
| 25 | Stream batching across denoising steps | plans |
| 26 | Multi-GPU communication | not needed on-device |
| 27 | Hardware portability | uses (WebGPU → WebAssembly fallback) |
| 28 | Real-time transport and latency metering | plans |
| 29 | Live session control without reconnecting | plans |
| 30 | Cheap pose or action conditioning | uses (pose + time landmarks) |
Published research on memory codecs for video world models (2025–2026); Landmark Attention (2023); InfLLM (2024); Quest (2024); MemGPT (2023); WorldMem, VMem, Context-as-Memory (2025); StreamDiffusion (2023), StreamV2V (2024); BitNet b1.58 (2024); LittleBit (2025); TurboQuant (2025); fast neural style transfer (Johnson et al. 2016). Svarog and Gamma Engine are independent and not affiliated with any of these authors or companies.