- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo | ||
| src | ||
| tests | ||
| .gitignore | ||
| .yamllint.yml | ||
| Cargo.toml | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
forge-kv-cache
Tiered (hot LRU + cold on-disk) content-addressed KV block cache with an
append-only lineage ledger. Blocks are keyed by
sha256(model_hash || position_range), so identical content always resolves
to the same block id — that makes TieredBlockCache::pull_from a trivial,
conflict-free set union.
Consumed by (in Toilville_Rituals):
packages/ritual_engine(Cargo.toml—forge-kv-cache, featuremlx)packages/ritual_engine/bridge-cache-kv— thin async-trait wrapper overeviction::EvictionPolicy,lineage::LineageEvent,store::{CacheConfig, TieredBlockCache},traits::{BlockCache, BlockSpec}packages/ritual_engine/bridge-inference-mlxandforge-kv-mlx— via themlxfeature'smlx_cache::ForgeKvSession, which bridges mlx-lm's synchronousKeyValueCache::update_and_fetchto this crate's async allocate path over a background channel.
History
This repo was recreated 2026-07-16. Consumers had depended on
ssh://git@git.toilville.dev:2222/Toilville/forge-kv-cache.git (tag
v0.1.0) for some time — proven by the full dependency graph still recorded
in Toilville_Rituals/packages/ritual_engine/Cargo.lock — but the repo
itself had never actually been pushed to this Forgejo instance. Two
downstream projects (Toilville/forge-services and a spel-archive
worktree) had each carried a no-op stub as a workaround in the meantime.
Feature flags
mlx— macOS + Apple Silicon only. Enablesmlx_cache::ForgeKvSession, which depends onmlx-rs(built from source via CMake + the Metal Toolchain on first build).
Testing
cargo test # core store — allocate/restore/evict/batch/pull
cargo test --features mlx # + ForgeKvSession session bridging