GPTCache icon indicating copy to clipboard operation
GPTCache copied to clipboard

Add Valkey backend support with conditional SORTBY handling

Open daric93 opened this issue 1 month ago • 2 comments

This PR introduces Valkey integration for the Redis-based vector store in GPTCache. https://github.com/zilliztech/GPTCache/issues/673.

Key changes include:

Valkey compatibility:

  • Detects Valkey vs Redis behavior for FT.SEARCH.
  • Handles cases where Valkey does not support SORTBY (https://github.com/valkey-io/valkey-search/issues/48.).

Conditional SORTBY logic:

  • Adds runtime capability check before appending .sort_by("score") to queries.
  • Falls back gracefully when SORTBY is unsupported (avoids query errors).

No breaking changes:

  • Existing Redis functionality remains unchanged.
  • Valkey support is transparent to callers.

daric93 avatar Nov 10 '25 16:11 daric93

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: daric93 To complete the pull request process, please assign xiaofan-luan after the PR has been reviewed. You can assign the PR to them by writing /assign @xiaofan-luan in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

sre-ci-robot avatar Nov 10 '25 16:11 sre-ci-robot

Welcome @daric93! It looks like this is your first PR to zilliztech/GPTCache 🎉

sre-ci-robot avatar Nov 10 '25 16:11 sre-ci-robot