Skip to content

feat(prefill): add tiered KV hot promotion and offload - #171

Merged
FluffyAIcode merged 1 commit into
mainfrom
AgentMemory/tiered-kv-offload-0716
Jul 16, 2026
Merged

feat(prefill): add tiered KV hot promotion and offload#171
FluffyAIcode merged 1 commit into
mainfrom
AgentMemory/tiered-kv-offload-0716

Conversation

@FluffyAIcode

Copy link
Copy Markdown
Owner

Summary

  • promote every successful remote snapshot into Primary's bounded hot LRU for repeat decode workloads
  • retain the original snapshot in allens cold/offload cache; Primary eviction never deletes the offload copy
  • add thread-safe cache budget resize with cold LRU eviction and lease safety
  • adapt allens cache capacity from physical memory minus active MLX model bytes and a 2GiB reserve, bounded by 0.25GiB minimum and 8GiB ceiling
  • label kv:// mounts as hot or cold-offload and expose promotion metrics through existing prefill telemetry

Tests

  • platform-neutral Python suite — 837 passed, 1 skipped
  • TypeScript SDK — 54 passed, 100% coverage and typecheck
  • remote import promotion, promotion failure isolation, adaptive budget bounds, cache resize/lease behavior, mount tiering, installer and launchd tests pass
  • Python compile, shell syntax, plist lint and diff checks pass

Live validation after merge

Redeploy allens, run one strict remote prefill, replay the exact prefix to prove a Primary local hot hit with no new remote job, then pressure the Primary LRU and verify the allens cold copy remains fetchable.

Made with Cursor

Promote successful remote snapshots into Primary's bounded hot LRU while retaining cold copies on allens, and adapt worker offload capacity to real MLX model memory headroom with explicit reserve and safety bounds.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@FluffyAIcode
FluffyAIcode merged commit 4e17643 into main Jul 16, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant