Skip to content
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

Make Disk Cache Configurable by environment variable #196

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ylow
Copy link
Contributor

@ylow ylow commented Mar 7, 2025

Make the chunk cache configurable through environment variable, specifically HF_XET_CACHE_SIZE_GB. Defaults to 10GB. Setting it to 0 disables the chunk cache.

@ylow ylow requested a review from rajatarya March 7, 2025 20:02
@ylow ylow changed the title Cursor generated configurable cache Make Disk Cache Configurable by environment variable Mar 7, 2025
@rajatarya rajatarya marked this pull request as ready for review March 18, 2025 06:36
@rajatarya rajatarya requested a review from assafvayner March 18, 2025 06:36
@rajatarya
Copy link
Collaborator

My only concern with this PR is that the unit-tests don't actually confirm that chunk cache behaves as expected when capacity set. If there was an integration test that would cover that case I would feel better.

@rajatarya rajatarya removed their request for review March 18, 2025 06:39
@@ -32,6 +33,14 @@ const MAX_CONCURRENT_DOWNLOADS: usize = 8; // Download is not CPU-bound
const DEFAULT_CAS_ENDPOINT: &str = "http://localhost:8080";
const READ_BLOCK_SIZE: usize = 1024 * 1024;

fn get_configured_cache_size() -> u64 {
env::var("HF_XET_CACHE_SIZE_GB")
Copy link
Contributor

Choose a reason for hiding this comment

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

should use new configurable_constants! macro for this here, if needs to rebase off main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants