Repository navigation
Releases
Releases · zellige-ai/basinkv
BasinKV v0.1.1
What's New in BasinKV v0.1.1
SGLang Hybrid SWA OKVP1 Prefix Caching & Session Spill/Restore
- Lifts the
cache_mode="off"restriction for pagedSWAKVPoolhybrid sliding-window attention (SWA) models in SGLang (Gemma 4 26B-A4B, Gemma 4 E4B Shared-KV, Gemma 3, gpt-oss), supportingcache_modein{"off", "ram", "nvme", "mixed"}. - Co-saves a bounded lossless sliding-window KV tail (
swa.k/swa.v) with CRC32 integrity inside backwards-compatibleOKVP1checkpoints, supporting both exact-length hits, SWA-validated sub-prefix slicing, and aligned/unalignedspill_session/restore_session. - Preserves fail-loudly launch guards (
cache_mode="off") for per-request SWA rings (swa_req_ring=True) and Inkling 2 (rel_extent > 0).
Live A100-80GB Verification (Pinned SGLang a3f0bff5, Quest + INT8, 16,037-token Dual-Needle Prompt)
google/gemma-4-E4B-it(Shared-KV,nvme):204.22 MB.okvp1(1,024-tok bounded SWA window), cold3.220s-> warm exact hit0.319s(10.1x, exact) -> warm sub-prefix SWA-needle hit0.523s(6.2x) -> cold process restart NVMe reload0.466s/0.323s(6.9x/10.0x, exact),0warnings.google/gemma-4-E4B-it(mixed): cold2.041s-> warm RAM exact hit0.226s(9.0x, exact) -> warm sub-prefix SWA-needle hit0.342s(6.0x),0warnings.google/gemma-4-26B-A4B-it(nvme):567.75 MB.okvp1(2,048-tok bounded SWA window), cold4.908s-> warm exact hit1.796s(2.7x, exact) -> warm sub-prefix SWA-needle hit1.167s(4.2x) -> cold process restart NVMe reload0.877s/0.627s(5.6x/7.8x, global + in-window SWA needles PASS),0warnings.
Install
pip install basinkv==0.1.1BasinKV v0.1.0
BasinKV v0.1.0
First public release of BasinKV, Zellige AI's bounded-VRAM sparse KV-cache offloading and tiered RAM/NVMe prefix caching implementation across llama.cpp, SGLang, and vLLM V1.
Install (vLLM V1 zero-fork plugin)
pip install basinkvbasinkv registers OasisKVConnector through the vllm.general_plugins entry point, so unmodified vllm serve can use --kv-transfer-config '{"kv_connector":"OasisKVConnector",...}' with no fork or module path.
Highlights
- vLLM V1 Mode 1 (zero-fork plugin, verified on
v0.19.1andv0.34.0):- Tiered RAM LRU + 4 KB-aligned NVMe
OKVP1prefix caching withINT8,WHT-INT4(1.94x-1.97xsmaller on disk vsINT8), or lossless BF16 (none). - Full
SupportsHMAmulti-group support: Dense (Qwen3-8B), Full + SWA (Gemma 3 4B,Gemma 4 26B-A4BwithD = 512+D = 256), and Recurrent + Full hybrids (MambaSpec: live-verified onibm-granite/granite-4.0-h-microin bothmamba_cache_mode="none"and"align"with lossless exact-boundary recurrent checkpoints).
- Tiered RAM LRU + 4 KB-aligned NVMe
llama.cpp(pinnedca123ba76, backend-neutral API v7):- NVIDIA CUDA: Single-user (
-np 1, full decode CUDA graphs) and parallel slots (-np 2..256, unified-kvuand--no-kv-unified),Quest INT8+INT8host KV andSphereIndex INT4+WHT-INT4host KV,D = 512, Shared-KV tail layers (Gemma 4 E4B),Inkling 2 Minirelative-position bias, andOKVS1v2/v3 prompt cache. - Apple Silicon Metal (
ggml-metal): 19 MSL 2.4-fno-fast-mathkernels (<= 22,112 Bthreadgroup memory), ARC + MRC ObjC++17 core (6,204/6,204live tests), live-verifiedllama-cli --oasiskvandllama-server --oasiskv -np 4withOKVS1RAM prompt cache. - AMD ROCm/HIP: Unified CUDA/HIP core compile-verified with 0 warnings and 0 spills across
gfx90a,gfx942,gfx1100,gfx1151, andgfx1201(live AMD hardware run pending).
- NVIDIA CUDA: Single-user (
- SGLang (pinned
a3f0bff5):- Multi-user ragged serving (
B = 16 x 64K = 1.024Mtokens verified),NEXTNMTP speculative decoding with static draft ring, optional fused Triton block-sparse cold prefill, SWA hybrids (Gemma 4 26B-A4B,Gemma 4 E4B,Gemma 3 27B,gpt-oss 20B), andOKVP1RAM/NVMe prefix caching + session spill.
- Multi-user ragged serving (
Links
- PyPI: https://pypi.org/project/basinkv/0.1.0/
- Supported models & live verification matrix:
docs/SUPPORTED_MODELS.md - Tuning & presets:
docs/TINKERING_AND_TUNING.md