Skip to content

feat: salt KV block hashes with LoRA adapter name#243

Merged
github-actions[bot] merged 1 commit into
llm-d:mainfrom
sagearc:hash-lora-name
Jan 5, 2026
Merged

feat: salt KV block hashes with LoRA adapter name#243
github-actions[bot] merged 1 commit into
llm-d:mainfrom
sagearc:hash-lora-name

Conversation

@sagearc
Copy link
Copy Markdown
Collaborator

@sagearc sagearc commented Jan 5, 2026

Previously, KV blocks were hashed using only the base model name, which could
cause collisions between the base model and its lora adapters.

We now use the LoRA name (if present) to generate unique block hashes.
This ensures cache isolation and completes the support needed for LoRA
adapters.

closes #167

Signed-off-by: Sage Ahrac <sagiahrak@gmail.com>
Copilot AI review requested due to automatic review settings January 5, 2026 09:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for LoRA (Low-Rank Adaptation) adapters by using the adapter name as the model identifier in KV block keys, preventing hash collisions between base models and their LoRA variants.

Key Changes:

  • Introduces effectiveModelName logic that uses the LoRA adapter name (if present) instead of the base model name for KV block identification
  • Fixes an error handling bug where parentRequestKey lookup failures were silently ignored
  • Ensures consistent use of the effective model name across all KV block operations (storage, parent key lookup, and token processing)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/kvcache/kvevents/pool.go
@vMaroon
Copy link
Copy Markdown
Member

vMaroon commented Jan 5, 2026

Awesome work @sagearc

/lgtm
/approve

@github-actions github-actions Bot added the lgtm Looks good to me, indicates that a PR is ready to be merged. label Jan 5, 2026
@github-actions github-actions Bot merged commit 6f62751 into llm-d:main Jan 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Looks good to me, indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Lora Support

3 participants