[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-111180":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":12,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":8,"rankLanguage":8,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":8,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},111180,"FlashStates","FutureMLS-Lab\u002FFlashStates","FutureMLS-Lab",null,"Python",303,28,11,1,0,62,180,48,91.34,"Apache License 2.0",false,"main",[],"2026-11-21 07:03:21","2026-11-23 14:01:29","\u003C!-- markdownlint-disable MD033 MD041 -->\n\u003Ch1 align=\"center\">FlashStates\u003C\u002Fh1>\n\n\u003Ch3 align=\"center\">\nUnlocking Flexible Hybrid State Management for Agentic LLM Inference\n\u003C\u002Fh3>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.alphaxiv.org\u002Fabs\u002F2611.flashstate\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPaper-alphaXiv-a83234.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3MTguNDEgNTA0LjQ3Ij48cG9seWdvbiBmaWxsPSIjZmZmZmZmIiBwb2ludHM9IjU5MS4xNSAyNTguNTQgNzE4LjQxIDM4NS43MyA2NjMuNzIgNDQwLjI4IDUzNi41NyAzMTMuNjIgNTkxLjE1IDI1OC41NCI%2BPC9wb2x5Z29uPjxwYXRoIGZpbGw9IiNmZmZmZmYiIGQ9Ik0yNzMuODYuM2MzNC41Ni0yLjQxLDY3LjY2LDkuNzMsOTIuNTEsMzMuNTRsOTQuNjQsOTQuNjMtNTUuMTEsNTQuNTUtOTYuNzYtOTYuNTVjLTE2LjAyLTEyLjctMzcuNjctMTIuMS01My4xOSwxLjExTDU0LjYyLDI4OC44MiwwLDIzNC4yMywyMDQuNzYsMjkuNTdDMjIzLjEyLDEzLjMxLDI0OS4yNywyLjAyLDI3My44Ni4zWiI%2BPC9wYXRoPjxwYXRoIGZpbGw9IiNmZmZmZmYiIGQ9Ik02NjMuNzksMS4yOWw1NC42Miw1NC41OC00MTguMTEsNDE3LjljLTExNC40Myw5NS45NC0yNjMuNTctNTMuNDktMTY3LjA1LTE2Ny41MmwxNjAuNDYtMTYwLjMzLDU0LjYyLDU0LjU4LTE1Ny44OCwxNTcuNzdjLTMzLjE3LDQwLjMyLDE4LjkzLDkxLjQxLDU4LjY2LDU3LjQ4TDY2My43OSwxLjI5WiI%2BPC9wYXRoPjwvc3ZnPg%3D%3D\" alt=\"Paper on alphaXiv\">\u003C\u002Fa>\n  \u003Ca href=\"docs\u002FFlashStates_Release.pdf\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPaper-PDF-a83234.svg\" alt=\"Paper PDF\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fflashstates.ai\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWebsite-flashstates.ai-2A78D6.svg\" alt=\"Website\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Forgs\u002FFutureMLS-Lab\u002Fpackages?repo_name=FlashStates\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocker-ghcr.io%2Ffuturemls--lab-2496ED.svg?logo=docker&logoColor=white\" alt=\"Container images\">\u003C\u002Fa>\n  \u003Ca href=\"#citation\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCite-BibTeX-555555.svg\" alt=\"BibTeX\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-green.svg\" alt=\"License\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n## About\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"docs\u002Fdemo\u002Fflashstates-48-agents.mp4\">\u003Cimg src=\"docs\u002Fdemo\u002Fflashstates-48-agents.gif\" width=\"90%\" alt=\"Replay of 48 Claude Code agent sessions served by FlashStates, vLLM and SGLang on the same GPUs. Each circle is one agent; green slices are prompt tokens read from cache, red slices are recomputed. After 30 minutes FlashStates has finished 20 agents at 61.7K output tokens per minute with an 87% cache hit rate, vLLM 7 agents at 22.0K and 30%, SGLang 8 agents at 15.4K and 6%.\">\u003C\u002Fa>\n  \u003Cbr>\n  \u003Cem>48 coding agents on the same GPUs, replayed at 100× speed (GLM-5.3-Flash NVFP4, two B200 GPUs per engine). Each\n  circle is one agent: green is prompt read from cache, red is recomputed. Click for the video with sound.\u003C\u002Fem>\n\u003C\u002Fp>\n\nCoding agents resend a growing context on every turn. On a hybrid model, which mixes attention with linear-attention\nor state-space layers, a cached prefix is reusable only with its *hybrid state*: the attention KV of every token and a\n*recurrent checkpoint* at the prefix's exact end. vLLM saves recurrent checkpoints only at KV-cache block boundaries\nand evicts KV blocks by recency, so each turn recomputes the end of the previous one, and under load whole contexts.\n\nFlashStates changes this with:\n\n- **Arbitrary state checkpointing (ASC).** Recurrent checkpoints are saved at any token position: at the end of a\n  prompt, inside a long prefill and at the end of a request. The next turn resumes exactly where the previous one\n  ended.\n- **Cost-aware hybrid state management.** A recurrent checkpoint and the KV blocks it needs are admitted and evicted\n  together, by the prefill they save per block of cache. The policy needs no per-workload tuning.\n- **A Mooncake store tier (optional).** Each finished request's hybrid state is written through to a Mooncake store in\n  host memory, whose master evicts whole states by the same priority.\n\nThis repository holds:\n\n- **FlashStates' vLLM** ([FutureMLS-Lab\u002Fvllm](https:\u002F\u002Fgithub.com\u002FFutureMLS-Lab\u002Fvllm\u002Ftree\u002Fflashstate), vLLM v0.33.0) and\n  **FlashStates' Mooncake** ([FutureMLS-Lab\u002FMooncake](https:\u002F\u002Fgithub.com\u002FFutureMLS-Lab\u002FMooncake\u002Ftree\u002Fflashstate), Mooncake\n  0.3.13.post1), as the submodules `third_party\u002Fvllm` and `third_party\u002Fmooncake`.\n- **A B200 image for GLM-5.3-Flash NVFP4, Qwen3.8-Flash-Next FP8 and Nemotron 3 Super FP8** on the official\n  `vllm\u002Fvllm-openai:v0.33.0` image ([how the image is built](docs\u002Fhow-the-image-is-built.md)).\n- **A GB300 image for Kimi-K3.1-Pro** on the official `vllm\u002Fvllm-openai:kimi-k31-cu134` image, with FlashStates' vLLM\n  and Mooncake from the forks' `flashstate-k31pro-gb300` branches.\n- **Benchmarks**: a closed-loop replay of public coding-agent traces against the official image, and the scripts that\n  turn the runs into tables and figures.\n\n### Overview\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Ffigures\u002Foverview.png\" width=\"85%\" alt=\"(a) vLLM resumes each agent turn from the last recurrent checkpoint at a block boundary and recomputes up to the end of the previous turn; SGLang checkpoints more densely but runs under memory pressure; FlashStates resumes from the exact end of the previous turn. (b) GLM-5.3-Flash with 1M context at 48 concurrent sessions: prefill throughput per GPU, median uncached tokens and p90 time to first token for vLLM, SGLang and FlashStates\">\n\u003C\u002Fp>\n\n(a) vLLM keeps recurrent checkpoints only at block boundaries, so each turn resumes from the last one before the end of\nthe previous turn and recomputes the rest (red). SGLang checkpoints more densely, but under memory pressure a turn can\nfall back further. FlashStates checkpoints the exact end of each turn and resumes there.\n(b) GLM-5.3-Flash at 48 concurrent sessions: FlashStates serves 3.1× vLLM's and 4.0× SGLang's prefill throughput per\nGPU, with 24× fewer median uncached tokens and 88% lower p90 time to first token than vLLM.\n\n### Results\n\nOn closed-loop replays of coding-agent sessions, with two B200 GPUs per server, FlashStates reaches up to **3.02×**\nvLLM's decode throughput and **3.14×** its prefill throughput, and cuts the median uncached prompt tokens per request\nby **96%** and p90 time to first token by **88%** (GLM-5.3-Flash at 48 concurrent sessions). With 512 GiB of host cache\nper engine, its input throughput peaks **26%** above the best vLLM or SGLang run in the figure (24% above vLLM's best\nmeasured run, at 60 sessions).\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Ffigures\u002Fgpu-only-serving.png\" width=\"90%\" alt=\"Decode and prefill throughput per GPU, median uncached tokens per request and p90 time to first token at 24 to 48 concurrent sessions, vLLM and FlashStates, on GLM-5.3-Flash, Nemotron 3 Super and Qwen3.8-Flash-Next\">\n  \u003Cbr>\n  \u003Cem>GPU only: three models at 24 to 48 concurrent sessions.\u003C\u002Fem>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Ffigures\u002Fmooncake-tradeoff.png\" width=\"75%\" alt=\"Input tokens per minute per GPU against p50 decode speed per request at 32 to 80 sessions for FlashStates and vLLM with a Mooncake store and SGLang with HiCache's host tier, each with 512 GiB of host memory for cache\">\n  \u003Cbr>\n  \u003Cem>GLM-5.3-Flash with 512 GiB of host memory for cache per engine (a Mooncake store for vLLM and FlashStates,\n  HiCache's host tier for SGLang), 32 to 80 sessions; bubble area shows p90 time to first token.\u003C\u002Fem>\n\u003C\u002Fp>\n\nOn Kimi-K3.1-Pro, one engine on two GB300 trays (eight GPUs, decode context parallelism 8) with DSpark speculative\ndecoding and a 640 GiB Mooncake store, FlashStates' output throughput per GPU peaks **36%** above vLLM's best (8,683\nagainst 6,377 tokens per minute, both at 52 sessions), with a p90 time to first token of **2.0 s** against 9.1 s, over\nminutes 15 to 45 of hour-long runs.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Ffigures\u002Fk31-tradeoff.png\" width=\"75%\" alt=\"Output tokens per minute per GPU against p50 decode speed per request at 24 to 52 sessions for FlashStates and vLLM on Kimi-K3.1-Pro, each with a 640 GiB Mooncake store per engine on GB300\">\n  \u003Cbr>\n  \u003Cem>Kimi-K3.1-Pro on GB300 with a 640 GiB Mooncake store per engine, FlashStates and vLLM, 24 to 52 sessions in\n  steps of 4; bubble area shows p90 time to first token.\u003C\u002Fem>\n\u003C\u002Fp>\n\n[`benchmarks\u002F`](benchmarks\u002FREADME.md) gives the setup, the metrics and the source of each figure's numbers, and reruns\nevery B200 configuration against the official image. Its tables list our reruns of the four B200 configurations\nagainst the official `vllm\u002Fvllm-openai:v0.33.0` image (the three models with GPU memory only, and GLM-5.3-Flash with the\nMooncake store), and the Kimi-K3.1-Pro figure's points with their prefill throughput, median uncached tokens and cache\nhit rate.\n\n## Getting Started\n\n### 1. Pull an image\n\n| GPU | Models | Image |\n|---|---|---|\n| B200 | GLM-5.3-Flash, Qwen3.8-Flash-Next, Nemotron 3 Super | `ghcr.io\u002Ffuturemls-lab\u002Fflashstates-b200:v0.1.0-b200` |\n| GB300 | Kimi-K3.1-Pro | `ghcr.io\u002Ffuturemls-lab\u002Fflashstates-gb300:v0.1.0-kimi-k31-gb300` |\n\nThe same images are on Docker Hub as `weili0234\u002Fflashstates-vllm`. The [v0.1.0 release](https:\u002F\u002Fgithub.com\u002FFutureMLS-Lab\u002FFlashStates\u002Freleases\u002Ftag\u002Fv0.1.0) lists their full tags and digests. To build from source, see [docs\u002Finstall.md](docs\u002Finstall.md).\n\n### 2. Serve a model\n\nThis serves GLM-5.3-Flash on two B200 GPUs:\n\n```bash\ndocker run --rm --gpus '\"device=0,1\"' --ipc=host --network host \\\n    -v \u002Fmodels\u002Fglm53flash:\u002Fmodel:ro \\\n    ghcr.io\u002Ffuturemls-lab\u002Fflashstates-b200:v0.1.0-b200 \\\n    vllm serve \u002Fmodel --tensor-parallel-size 2 --enable-prefix-caching \\\n    --mamba-frontier-checkpoint --mamba-prefill-export \\\n    --prefix-cache-eviction gds --prefill-cost-coefficients 1.862e-5 3.33e-6 \\\n    --prefix-cache-leaf-last --prefix-cache-leaf-idle-seconds 60\n```\n\nClients use vLLM's OpenAI-compatible API unchanged. [docs\u002Fwhat-flashstate-changes.md](docs\u002Fwhat-flashstate-changes.md) explains each FlashStates flag. The prefill cost coefficients are per model, and [`benchmarks\u002Fconfigs\u002F`](benchmarks\u002Fconfigs) has the settings for every model, with and without the Mooncake store. Kimi-K3.1-Pro runs on two GB300 nodes; see [its branch README](https:\u002F\u002Fgithub.com\u002FFutureMLS-Lab\u002Fvllm\u002Fblob\u002Fflashstate-k31pro-gb300\u002F.github\u002FREADME.md).\n\n### 3. Reproduce a result\n\nEach result point starts a fresh server, replays a fixed number of agent sessions, and writes the readings:\n\n```bash\nMODEL_DIR=\u002Fmodels\u002Fglm53flash HF_HOME=\u002Fdata\u002Fhf GPUS=0,1 PORT=8000 \\\n    benchmarks\u002Frun_point.sh glm53flash-nvfp4-gpu flashstate 48 results\u002Fglm53flash-nvfp4-gpu\u002Fflashstate\u002F48\n```\n\nA point takes about 50 minutes on GLM-5.3-Flash and about 80 minutes on the other models. [`benchmarks\u002FREADME.md`](benchmarks\u002FREADME.md) covers the traces, model revisions, baselines and tables.\n\n## Repository layout\n\n| Directory | What it contains |\n|---|---|\n| `third_party\u002Fvllm\u002F` | FlashStates' vLLM: vLLM v0.33.0 plus FlashStates |\n| `third_party\u002Fmooncake\u002F` | FlashStates' Mooncake: Mooncake 0.3.13.post1 plus the store client and master changes |\n| [`docker\u002F`](docker) | The B200 image ([how it is built](docs\u002Fhow-the-image-is-built.md)) |\n| [`benchmarks\u002F`](benchmarks\u002FREADME.md) | Reproducibility scripts |\n| [`analysis\u002F`](analysis) | Readings, tables and figures from the runs |\n| [`docs\u002F`](docs) | [Release paper](docs\u002FFlashStates_Release.pdf), [install from source](docs\u002Finstall.md), [what FlashStates changes](docs\u002Fwhat-flashstate-changes.md), [how the image is built](docs\u002Fhow-the-image-is-built.md), the figures and their readings |\n\n## Status\n\nFlashStates is research code, and its options may change. The B200 results use two B200 GPUs per server, and\nKimi-K3.1-Pro one engine on two GB300 trays. On other GPUs, size the KV cache for the card.\n\n## Citation\n\n```bibtex\n@misc{flashstates2026,\n  title  = {FlashStates: Unlocking Flexible Hybrid State Management for Agentic LLM Inference},\n  author = {Li, Chenxi and Xu, Weili and Zhang, Tianyi and Wang, Jue and Zhou, Zhongzhu and Xu, Chenfeng},\n  year   = {2026},\n  url    = {https:\u002F\u002Fgithub.com\u002FFutureMLS-Lab\u002FFlashStates}\n}\n```\n\n## License\n\nApache License 2.0 ([LICENSE](LICENSE)). FlashStates' vLLM and Mooncake derive from\n[vLLM](https:\u002F\u002Fgithub.com\u002Fvllm-project\u002Fvllm) v0.33.0 and [Mooncake](https:\u002F\u002Fgithub.com\u002Fkvcache-ai\u002FMooncake)\n0.3.13.post1, and the replay client from [AIPerf](https:\u002F\u002Fgithub.com\u002Fai-dynamo\u002Faiperf) through\n[agentx-harness](https:\u002F\u002Fgithub.com\u002FSemiAnalysisAI\u002Fagentx-harness); [NOTICE](NOTICE) lists every included third-party\nwork. The workload is SemiAnalysis's public coding-agent traces.\n","FlashStates 是一个面向智能体（Agentic）大语言模型推理的混合状态管理框架，专为支持注意力机制与线性\u002F状态空间层混合架构的模型而设计。其核心功能是高效缓存和复用前缀计算中的注意力键值（KV）与状态空间层的递归检查点（recurrent checkpoint），显著提升多轮交互式代理的吞吐量与缓存命中率。技术特点包括细粒度状态对齐、GPU端原生状态复用、与 vLLM\u002FSGLang 等推理引擎兼容的插件化集成。适用于需要高并发、低延迟响应的编程助手、多步推理代理、RAG增强型对话系统等场景。",2,"2026-11-24 04:40:21","CREATED_QUERY"]