Skip to content

Add Pythonhashseed in quickstart example#2597

Merged
maobaolong merged 3 commits intoLMCache:devfrom
jmkuebler:patch-1
Mar 2, 2026
Merged

Add Pythonhashseed in quickstart example#2597
maobaolong merged 3 commits intoLMCache:devfrom
jmkuebler:patch-1

Conversation

@jmkuebler
Copy link
Copy Markdown
Contributor

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jmkuebler, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the quickstart documentation for centralized KV cache sharing by explicitly addressing a critical configuration requirement. By adding the PYTHONHASHSEED=0 environment variable to the example commands and providing a clear explanation, it ensures that users can successfully achieve external prefix cache hits and consistent KV cache behavior across multiple vLLM instances, preventing potential issues related to hash inconsistencies.

Highlights

  • Documentation Update: Added an important note to the share_kv_cache.rst documentation, explaining the necessity of setting PYTHONHASHSEED=0 for consistent KV cache hashing in cross-process centralized sharing scenarios.
  • Quickstart Example Enhancement: Integrated PYTHONHASHSEED=0 into the vllm serve command examples within the quickstart guide for centralized KV cache sharing, ensuring the examples are fully functional and demonstrate best practices.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/source/getting_started/quickstart/share_kv_cache.rst
    • Added an 'Important' note regarding the PYTHONHASHSEED environment variable for centralized cache sharing.
    • Included PYTHONHASHSEED=0 in the first vllm serve command block.
    • Included PYTHONHASHSEED=0 in the second vllm serve command block.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses a missing PYTHONHASHSEED setting in the quickstart example for centralized KV cache sharing. By adding this environment variable, it ensures consistent hashing across processes, which is essential for cache hits to work as expected. The changes are accurate and improve the documentation and example commands. I've included one minor suggestion to enhance the clarity of the added documentation note.


This section demonstrates how to share KV cache across multiple vLLM instances using a centralized LMCache server.

**Important**: For centralized cache sharing (which is cross-process cases), ensure all processes use the same `PYTHONHASHSEED` to keep the hash of the KV cache consistent across processes: ``export PYTHONHASHSEED=0``.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For clarity and better grammar, I suggest rephrasing this sentence. The current phrasing (which is cross-process cases) is a bit awkward.

Suggested change
**Important**: For centralized cache sharing (which is cross-process cases), ensure all processes use the same `PYTHONHASHSEED` to keep the hash of the KV cache consistent across processes: ``export PYTHONHASHSEED=0``.
**Important**: For centralized cache sharing (a cross-process use case), ensure all processes use the same `PYTHONHASHSEED` for consistent KV cache hashing. For example: ``export PYTHONHASHSEED=0``.

Copy link
Copy Markdown
Collaborator

@maobaolong maobaolong left a comment

Choose a reason for hiding this comment

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

@jmkuebler Thanks for this update. LGTM

@jmkuebler
Copy link
Copy Markdown
Contributor Author

@maobaolong who else could review this PR so we can get it merged?

@maobaolong maobaolong enabled auto-merge (squash) February 24, 2026 08:31
@maobaolong
Copy link
Copy Markdown
Collaborator

@jmkuebler I'd love to merge this PR, but it lack required conditions

  • two approved
  • all required ci checks passed.

@sammshen Would you like to take another look?

@sammshen sammshen added the full Run comprehensive tests on this PR label Mar 2, 2026
@maobaolong maobaolong merged commit 51a18a4 into LMCache:dev Mar 2, 2026
20 checks passed
hlin99 pushed a commit to hlin99/LMCache that referenced this pull request Mar 2, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
Signed-off-by: Ofer Kiselov Nahman <ofer.kiselovnahman@weka.io>
oferki pushed a commit to oferki/LMCache that referenced this pull request Mar 3, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
mauryaavinash95 pushed a commit to mauryaavinash95/LMCache that referenced this pull request Mar 7, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
shaoxiawjc pushed a commit to shaoxiawjc/LMCache that referenced this pull request Mar 11, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
Signed-off-by: shaoxiawjc <wjc2800@163.com>
realAaronWu pushed a commit to realAaronWu/LMCache that referenced this pull request Mar 20, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
Signed-off-by: Aaron Wu <aaron.wu@dell.com>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
jooho-XCENA pushed a commit to xcena-dev/LMCache that referenced this pull request Apr 2, 2026
Add Pythonhashseed

In the quickstart example, the pythonhashseed was not set. Thus, there would be no External prefix cache hits.

Signed-off-by: Jonas M. Kübler <44084297+jmkuebler@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full Run comprehensive tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants