Skip to content

docs(xet): document shard/chunk cache and other Xet environment variables - #2668

Merged
rajatarya merged 3 commits into
mainfrom
rajat/xet-docs-env-vars-audit
Jul 31, 2026
Merged

docs(xet): document shard/chunk cache and other Xet environment variables#2668
rajatarya merged 3 commits into
mainfrom
rajat/xet-docs-env-vars-audit

Conversation

@rajatarya

@rajatarya rajatarya commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What

Expands the Environment Variables section of Using Xet Storage with the Xet client's user-tunable variables that weren't yet documented. Three new subsections:

  • GeneralHF_XET_HIGH_PERFORMANCE (alias HF_XET_HP), HF_XET_CACHE
  • Shard CacheHF_XET_SHARD_CACHE_SIZE_LIMIT, HF_XET_SHARD_CHUNK_INDEX_TABLE_MAX_SIZE, HF_XET_SHARD_CACHE_SUBDIR
  • Chunk CacheHF_XET_CHUNK_CACHE_SIZE_BYTES

Why

HF_XET_SHARD_CACHE_SIZE_LIMIT came up in a customer migration: with HF_XET_HIGH_PERFORMANCE=1, the on-disk shard cache can grow enough to fill the disk, and capping it below free space is the fix — but the variable wasn't documented here. This change also folds in the "other Xet environment variables" listed on the huggingface_hub reference page so the Hub page is self-contained.

Accuracy notes (verified against xet-core v1.5.1 and main)

  • Shard cache soft limit is 16 GB (xet_runtime/src/config/groups/shard.rs), not 4 GB. The huggingface_hub env-vars page still says 4 GB — stale; worth a follow-up there.
  • Chunk cache default is 0 (disabled): hf_xet's Cargo default enables no-default-cache. Per @seanses, the 10 GB build-feature default doesn't apply to Git Xet either — Git Xet v0 goes through the bridge, where the variable has no effect. Documented as a single default plus that caveat.
  • Two variables dropped after review (@seanses): HF_XET_RECONSTRUCT_WRITE_SEQUENTIALLY (writes are now always buffered sequential writes pinned to one writer thread) and HF_XET_NUM_CONCURRENT_RANGE_GETS (superseded by adaptive concurrency). Neither exists in xet-core anymore; both still appear on the huggingface_hub env-vars page — stale, follow-up needed there too.

Scope

Limited to user-facing knobs. Internal/testing fields (CAS endpoint/scheme/prefix, session xorb-flush internals, dedup fragmentation estimators and global-dedup query controls, shard target sizes, progress-aggregation internals, USE_VECTORED_WRITE, HF_HUB_DISABLE_XET) are intentionally left out. Purely additive — no existing rows changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_012XmgpfqHUeQtJthDXJddq9


Note

Low Risk
Documentation-only additions to the Hub Xet guide; no runtime, auth, or data-path code changes.

Overview
Expands the Environment Variables section in using-xet-storage.md so Hub readers can tune Xet without cross-linking only to huggingface_hub.

Adds a General table for HF_XET_HIGH_PERFORMANCE / HF_XET_HP and HF_XET_CACHE, plus new Shard Cache and Chunk Cache sections. Shard docs call out the 16 GB soft on-disk limit for HF_XET_SHARD_CACHE_SIZE_LIMIT, pruning at run start, and when to lower the cap (e.g. under high-performance mode filling disk). Chunk cache docs note hf_xet defaults to disabled (0) and that HF_XET_CHUNK_CACHE_SIZE_BYTES does not apply to Git Xet v0.

Existing adaptive concurrency, network, buffer, and logging tables are unchanged.

Reviewed by Cursor Bugbot for commit cebcfd0. Bugbot is set up for automated code reviews on this repo. Configure here.

…bles

Add Shard Cache, Chunk Cache, and Deduplication sections to the
Using Xet Storage environment-variable reference, plus a General
section for the high-level flags: HF_XET_HIGH_PERFORMANCE (alias
HF_XET_HP), HF_XET_CACHE, HF_HUB_DISABLE_XET,
HF_XET_RECONSTRUCT_WRITE_SEQUENTIALLY, and HF_XET_NUM_CONCURRENT_RANGE_GETS.

Adds HF_XET_SHARD_CACHE_SIZE_LIMIT (the customer-requested variable) and
the rest of the shard config (target sizes, in-memory chunk index cap,
cache subdir), the chunk cache size, and the global-dedup query controls.

Defaults verified against xet-core (v1.5.1 and main):
- shard cache soft limit is 16 GB (the huggingface_hub reference page
  still says 4 GB — stale).
- chunk cache defaults to 0 for hf_xet (built with no-default-cache) but
  10 GB for Git Xet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XmgpfqHUeQtJthDXJddq9
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Drop HF_HUB_DISABLE_XET from the General table, remove the shard
target-size knobs (HF_XET_SHARD_TARGET_SIZE, HF_XET_SHARD_MAX_TARGET_SIZE),
and remove the Deduplication section entirely — these are not intended
for users to change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012XmgpfqHUeQtJthDXJddq9
Comment thread docs/hub/xet/using-xet-storage.md Outdated
Comment thread docs/hub/xet/using-xet-storage.md Outdated
Comment thread docs/hub/xet/using-xet-storage.md Outdated
- Remove HF_XET_RECONSTRUCT_WRITE_SEQUENTIALLY: writes are now always
  buffered sequential writes pinned to a single writer thread, so the
  knob no longer exists in xet-core.
- Remove HF_XET_NUM_CONCURRENT_RANGE_GETS: per-file range concurrency is
  tuned by adaptive concurrency (documented below).
- HF_XET_CHUNK_CACHE_SIZE_BYTES: default is 0 (disabled); the 10 GB
  "Git Xet" default was wrong — Git Xet v0 goes through the bridge, where
  the variable has no effect.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8jqRXpFx1SoS9V8iHbkL4

@seanses seanses left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@rajatarya
rajatarya merged commit bb345af into main Jul 31, 2026
3 checks passed
@rajatarya
rajatarya deleted the rajat/xet-docs-env-vars-audit branch July 31, 2026 13:59
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.

3 participants