← Back to Pull requests

coordinator: forward cache_salt and priority on fresh prefill bodies #4128

Closed
unknown closed this pull request without merging on Nov 10, 2026 10:17 UTC
View on GitHub
unknown unknown commented on Nov 10, 2026 09:26 UTC
Author

What type of PR is this?
/kind bug

What this PR does / why we need it:
For /v1/completions and /inference/v1/generate, the coordinator builds the prefill body from scratch with only the request id, model, prompt (or token ids) and transfer params. The client's cache_salt and priority are dropped. Chat Completions, Responses and Messages clone the client body, and decode forwards the client body on every API, so only these two prefill paths lose the fields.

https://github.com/llm-d/llm-d-router/blob/489761f1a1c68059d14295ba858fadd7d516655d/pkg/coordinator/steps/prefill.go#L165-L192

vLLM mixes cache_salt into the hash of a prompt's first block, and every later block hash chains from it (vllm/v1/core/kv_cache_utils.py, generate_block_hash_extra_keys). Without the salt, the prefill pod caches a salted prompt under its unsalted hashes, and another tenant's unsalted request with the same prefix gets prefix-cache hits on it. That removes the isolation cache_salt provides on a shared prefill pool. Prefill also ran at vLLM's default priority 0 instead of the client's value or the one the EPP injects.

The two fresh-body branches now copy cache_salt and priority from the client body when present. vLLM's CompletionRequest and GenerateRequest both accept these fields. FieldCacheSalt and FieldPriority are added to pkg/common/request.

Which issue(s) this PR fixes:
Fixes #4127

Test plan:

  • Completions and generate prefill bodies carry the client's cache_salt and priority, and omit them when the client did not send them (fails before the fix)

  • go test ./pkg/coordinator/... ./pkg/common/request/...
  • Release note _(write NONE if no user-facing change)_:
    ``release-note
    The coordinator forwards the client's
    cache_salt and priority to the prefill request on /v1/completions and /inference/v1/generate. Salted prompts on these paths are no longer cached on the prefill pod under unsalted block hashes, and prefill runs at the client's priority.
    ``

    Diff: 254 lines (+190 / -64) across 3 files Reviewer: blacksoxx Review duration: 50m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 254 lines diff across 3 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.332
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #4128"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 44.1% (MEDIUM) · Higher = larger blast radius
    44.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.4% · Safe to merge
    17.4%