-
Notifications
You must be signed in to change notification settings - Fork 46
feat: Add Valkey and RDMA support for KV-cache indexing #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add Valkey backend support as Redis-compatible alternative - Implement RDMA configuration for future high-performance scenarios - Add comprehensive test suite for Valkey functionality - Update documentation with Valkey configuration options - Provide example implementation and usage guide - Maintain full backward compatibility with existing Redis backend Fixes llm-d#134
There was a problem hiding this 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 Valkey backend support as a Redis-compatible alternative for KV-cache indexing, including RDMA configuration for high-performance scenarios. The implementation maintains full backward compatibility with the existing Redis backend while providing enhanced performance options.
- Add Valkey backend with RDMA support configuration
- Implement comprehensive test suite for Valkey functionality
- Provide example implementation and configuration documentation
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
pkg/kvcache/kvblock/valkey_test.go | Comprehensive test suite for Valkey backend functionality |
pkg/kvcache/kvblock/redis.go | Extended Redis implementation to support Valkey backend with RDMA |
pkg/kvcache/kvblock/index.go | Added Valkey configuration support to index factory |
examples/valkey_example/main.go | Complete example demonstrating Valkey usage |
examples/valkey_example/README.md | Documentation for Valkey example usage |
examples/valkey_configuration.md | Configuration guide for Valkey backend |
docs/configuration.md | Updated configuration documentation with Valkey options |
docs/architecture.md | Added Valkey backend description to architecture |
README.md | Updated main README with Valkey example reference |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
shouldSucceed: true, | ||
}, | ||
{ | ||
name: "valkey with RDMA enabled", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after comma should be removed.
name: "valkey with RDMA enabled", | |
name: "valkey with RDMA enabled", |
Copilot uses AI. Check for mistakes.
name: "valkeys:// SSL URL scheme", | ||
config: &RedisIndexConfig{ | ||
Address: "valkeys://" + server.Addr(), | ||
BackendType: "valkey", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after comma should be removed.
BackendType: "valkey", | |
BackendType: "valkey", |
Copilot uses AI. Check for mistakes.
expectError: false, | ||
}, | ||
{ | ||
name: "valkey:// scheme", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after comma should be removed.
name: "valkey:// scheme", | |
name: "valkey:// scheme", |
Copilot uses AI. Check for mistakes.
// DefaultValkeyIndexConfig returns a default configuration for Valkey. | ||
func DefaultValkeyIndexConfig() *RedisIndexConfig { | ||
return &RedisIndexConfig{ | ||
Address: "valkey://127.0.0.1:6379", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after comma should be removed.
Address: "valkey://127.0.0.1:6379", | |
Address: "valkey://127.0.0.1:6379", |
Copilot uses AI. Check for mistakes.
// Convert valkey:// to redis:// for protocol compatibility | ||
config.Address = strings.Replace(config.Address, "valkey://", "redis://", 1) | ||
} else if strings.HasPrefix(config.Address, "valkeys://") { | ||
// Convert valkeys:// to rediss:// for SSL protocol compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after compatibility should be removed.
// Convert valkeys:// to rediss:// for SSL protocol compatibility | |
// Convert valkeys:// to rediss:// for SSL protocol compatibility |
Copilot uses AI. Check for mistakes.
|
||
const ( | ||
envValkeyAddr = "VALKEY_ADDR" | ||
envValkeyEnableRDMA = "VALKEY_ENABLE_RDMA" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after string should be removed.
envValkeyEnableRDMA = "VALKEY_ENABLE_RDMA" | |
envValkeyEnableRDMA = "VALKEY_ENABLE_RDMA" |
Copilot uses AI. Check for mistakes.
// Test prompts to demonstrate caching behavior | ||
prompts := []string{ | ||
"Hello, how are you today?", | ||
"What is the weather like?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after comma should be removed.
"What is the weather like?", | |
"What is the weather like?", |
Copilot uses AI. Check for mistakes.
"kvBlockIndexConfig": { | ||
"valkeyConfig": { | ||
"address": "valkey://valkey-server:6379", | ||
"backendType": "valkey", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra trailing space after comma should be removed.
"backendType": "valkey", | |
"backendType": "valkey", |
Copilot uses AI. Check for mistakes.
Summary
Fixes #134