Skip to content

feat(prefixcache): index reported KV residency - #11464

Open
localai-org-maint-bot wants to merge 1 commit into
masterfrom
cron/issue-10064-precise-kv-events
Open

feat(prefixcache): index reported KV residency#11464
localai-org-maint-bot wants to merge 1 commit into
masterfrom
cron/issue-10064-precise-kv-events

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

Description

Adds the first safe slice of #10064: an exact reported-residency provider behind the existing prefix-cache routing seam, plus a NATS prefixcache.residency contract for store, remove, and replica-scoped clear events.

The guessed routing provider intentionally remains the default until a backend emits hash chains compatible with the router. This avoids treating native vLLM block hashes as if they matched LocalAI's current prompt-chain hashing.

Notes for Reviewers

  • Exact longest-prefix selection is candidate-scoped and deterministic.
  • Request observations do not mutate reported residency.
  • Distributed startup subscribes to the new event contract.
  • Documentation describes the payload and hash-compatibility requirement.

Verification:

  • go test ./pkg/natsauth ./core/services/nodes/prefixcache ./core/services/messaging ./core/application
  • go test -race ./core/services/nodes/prefixcache
  • Independent agent review: PASS
  • go test ./... was also attempted; this host lacks generated React assets and native llama/ONNX/Opus libraries, and an unrelated config fixture fetch returned HTTP 403.

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

Add a NATS event contract and exact-residency provider for backend KV cache reports. Keep guessed request observations as the default routing source while maintaining the reported index for future producers.

Assisted-by: Codex:gpt-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant