feat(llm-api-gateway): add prompt cache key to chat completions - #823
Conversation
Refs: #822 Signed-off-by: jcameron <jcameron@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe gateway now accepts ChangesPrompt cache affinity
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The PR adds prompt-cache affinity handling while preserving existing request and response behavior; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Client
participant ChatCompletions
participant SessionAffinity
participant Stargate
Client->>ChatCompletions: Send prompt_cache_key
ChatCompletions->>SessionAffinity: Select and validate affinity source
SessionAffinity->>Stargate: Forward raw body and hashed x-cache-affinity-key
Stargate-->>Client: Return x-multi-turn-session-id
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🎉 This PR is included in version nvcf-llm-api-gateway-v0.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
TL;DR
prompt_cache_keyto Chat Completions using the existing NVCF cache-affinity path.Additional Details
400before body selection.For the Reviewer
api/session_affinity.go.provider/stargate_test.go.For QA
go test ./api ./providergo test ./...go build ./...bazel test //src/invocation-plane-services/llm-api-gateway/... --test_output=errors --flaky_test_attempts=2./tools/ci/check-docsgit diff --checkIssues
Closes #822
Checklist
Summary by CodeRabbit
New Features
prompt_cache_keysupport for chat completion and Responses requests.Bug Fixes
Documentation
Tests