linxuhao f73b3c86a4 Conversation cache: opt-in STRATA_PARK_ASYNC=1 parks the K/V in the background and moves the dropped checkpoints (#3779, #3712)
Problem: parking the outgoing conversation copies its K/V device to host and
deep-copies its checkpoints before the next prompt can start: 213 ms at a 3K
context, 334 ms at 13K on a PCIe Gen2 x4 card (the reporter's CMP 170HX).

Change, opt-in and CUDA only (off on HIP, gfx906 and Metal):
- STRATA_PARK_ASYNC=1: conversation_kv_save copies the device K/V device to
  device into a VRAM stage (only while 1.5 GB stay free beside it; otherwise the
  save copies as before), and a background thread moves the stage into the host
  buffers in 4 MiB pieces through two pinned buffers. conversation_park_join
  waits for it: every reader of a parked image's K/V, the cache before it frees an
  entry, and the image itself (SavedConversation::pending) before its buffers go.
  ConversationBuffer::resize_for_overwrite leaves the added bytes unfilled for
  that copy; the buffer's segments use an allocator that value-initializes only
  when a fill value is given, and resize(n, value) is unchanged for every other
  caller.
- With it, the checkpoints this request drops right after the park (all of them
  when another state comes in, else the ones off this prompt's path) move into
  the parked image instead of being copied, and a background allocation refills
  STRATA_CKPT_POOL for the next save. Only the main session's checkpoints move,
  not an idle batch slot's (the park_source of #2526 serves both).
- conversation_snapshot_save takes dropped checkpoints' storage (the existing
  STRATA_CKPT_POOL) for its copies; with the pool off, nothing is taken.
- Unset: park_drops is null, no storage is taken, the K/V copies are the
  synchronous ones; the added work is the K/V size sum for the stage request and
  a few join calls.

Differs from the PR as submitted: the PR's join in conversation_file.cpp
(put_payload) is not ported; the SAVE/RESTORE handler of generate.cpp joins the
park first (see the previous commit, which carries the PR's 33a8146a fix).
Hand-merged into the park_source / ParkSource refactor of #2526.

Not covered: if the background copy fails after resize_for_overwrite, the
parked image keeps unfilled bytes; the failure is logged. A restore of such an
image would read them. No test of the park path with a failing copy.

Tests: the PARK_ASYNC path has no unit test in this commit (it needs a card with 1.5 GB free for the
stage); the reporter's A/B/A conversation check covers it, see the checklist.

Reporter's numbers (linxuhao, CMP 170HX): park 213 -> 64-75 ms (3K), 334 -> 68 ms
(13K); greedy answers identical on their 11 prompts and the A/B/A conversation
check. Theirs, not measured here.

Original change by linxuhao (PR #3779, commit 3e0c141c).
2026-10-27 00:52:52 +01:00
2026-10-13 04:36:28 +02:00
2026-10-13 04:36:30 +02:00

Strata

Run powerful AI on your own computer.

Chat, code and work with images, locally.

Models · Install · Hardware · Tools · Help · Support

Download Strata MIT license Support Strata on Buy Me a Coffee

English · 简体中文 · 日本語 · Deutsch · Français · Español · PortuguĂŞs

Free, open source, and yours to run. Use Strata on your desktop or with your favorite coding tools. No account needed.

Models

We recommend ISTA-DASLab first, then Unsloth and other providers, where a compatible model fits.

 Qwen3.8-Flash-Next
Provider Choices
ISTA-DASLab · recommended Q2_0, IQ2_XS, IQ3_XXS, IQ3_S. Coder: IQ1_M for coding.
Unsloth UD-IQ4_XS, UD-Q4_K_XL, UD-Q5_K_XL, UD-Q6_K_XL, Q8_0
Gyro · agentionai Gyro-S, Gyro-M. Lower memory use but slower.
Other options Swift 1.5, NVFP4, OrcaRouter

Compare sizes, memory needs and compatibility.

 Qwen3.6-35B-A3B

Unsloth: UD-Q4_K_XL, UD-Q6_K_XL, Q8_0. These are the currently documented packs for this model.

Model guide and compatibility.

 DeepSeekV4.1-Flash-1017

In the desktop app and the Terminal. What does not fit in memory is read from your SSD, so it needs a lot of free disk space.

Set (IST-DAS) Download Free disk needed
1.75 bpw 239 GB about 245 GB
2.00 bpw 257 GB about 265 GB
2.25 bpw 274 GB about 280 GB

Runs on NVIDIA RTX 30, 40 and 50 series (Windows and Linux), AMD Radeon AI PRO R9700 (Linux), and AMD Ryzen AI Max — Strix Halo (Windows). Setup downloads the files and the DeepSeek engine, then starts the model.

strata launch --family deepseek41 --model ist-das-2.00bpw --plan

Measured with the 2.00 bpw set on Strata 0.2.5 (Strix Halo: 0.2.7). Output is the speed of the answer, prompt is how fast Strata reads your input.

Hardware Output Prompt
RTX 5070 12 GB, 64 GB RAM 4 to 6 tokens/s about 110 tokens/s (4K)
RTX 3060 12 GB, 46 GB RAM 9 to 11 tokens/s about 155 tokens/s (4K)
1x Radeon AI PRO R9700, 251 GB RAM 21 to 25 tokens/s 320 to 360 tokens/s (8K)
4x Radeon AI PRO R9700 74 to 77 tokens/s 400 to 450 tokens/s (8K)
Ryzen AI Max+ 395 (Strix Halo), 128 GB unified 19 to 21 tokens/s (code), 11 (chat) 87 tokens/s (4K), 125 tokens/s (8K)

Memory, disk and details · Release notes

Not sure what fits? Choose a model for your computer.

Install

Desktop app

Download Strata for Windows, Linux or Mac →

Install the app, choose a model, and start chatting. There is one installer for each system. On first start the app downloads the engine for your graphics card. Help with the installer.

Files: Strata-0.2.6-windows-x64-setup.exe · Strata-0.2.6-linux-x86_64.AppImage · Strata-0.2.6-macos-arm64.dmg

Strata desktop app with a chat and live code preview side by side
Chat, files and a live preview in one window.

Terminal app

Prefer the terminal? Install Strata, then run strata launch.

Install commands

Linux / Mac

curl -fsSL https://github.com/Niko1221/Strata/releases/latest/download/install.sh -o install.sh && sh install.sh

Windows PowerShell

irm https://github.com/Niko1221/Strata/releases/latest/download/install.ps1 | iex

On Windows, open a new terminal afterwards. Then:

strata launch

Follow the prompts to download and start a model. Terminal guide.

Strata terminal app showing model activity, speed, memory and recent requests
Watch your model and hardware while it runs.

Build from source · Docker · Full install guide

Hardware

Supported hardware Guide
NVIDIA GeForce RTX 20 / 30 / 40 / 50 series NVIDIA setup
AMD Radeon RX 7700 / 7800 / 7900, RX 9060 / 9070, AI PRO R9700 AMD setup
AMD Radeon RX 6800 / 6900 · experimental RX 6000 setup
Intel Arc · Linux Intel setup
Apple Silicon · M1 or newer Mac setup
AMD Ryzen AI Max · Strix Halo Strix Halo setup

Tools

Claude Code · Codex CLI · OpenCode · oh-my-pi · pi.dev · Hermes Agent · OpenClaw, and more through the OpenAI- and Anthropic-compatible APIs.

Run strata connect to see setup instructions for your tool. Connection guide.

Help

All guides · Troubleshooting · Report a bug · Benchmarks · How it works · Contribute

Support Strata

Help keep local AI open to everyone. A coffee helps fund development and testing on more hardware.

Buy Me a Coffee: support Strata

MIT license · Credits and model licenses · Privacy

For AI tools and automated readers: technical reference · setup instructions.

Sponsorships, hardware partnerships or collaborations: niko.veit@outlook.com.

S
Description
AImighty fork of Niko1221/Strata (KVA+batch)
Readme MIT
81 MiB
0 Stars 3 Watchers 0 Forks
Languages
C++ 42.9%
Python 28.9%
Cuda 11.5%
JavaScript 8.3%
TypeScript 3.5%
Other 4.5%