Configuration Reference (TOML & Environment)

Complete reference for hypercache-agent.toml, hypercache-controller.toml, storage backing modes, and environment variable overrides.

All HyperCache configuration files live in configs/ and use strongly-typed TOML syntax. Passing -c <path> to ./hypercache or ./hypercache-admin loads the specified configuration file.

Which Config File Should I Use?

Configuration FileWhere It RunsBinary UsedPurpose
configs/hypercache-agent.tomlEvery GPU / CPU Worker Node./hypercacheConfigures local NVMe discovery (raw block drives or filesystem arenas), authoritative S3/NFS credentials, write-back/write-through behavior, and optional registration with a Central Controller.
configs/hypercache-controller.tomlCentral Controller / Head Node (Multi-node clusters only)./hypercache-adminConfigures the cluster coordinator bind IP/port (9120), shared Bearer token authentication (cluster_auth_token), and Peer-to-Peer fleet distribution (p2p_preload_enabled). Not needed for single-node setups.

1. Choosing Your Storage Backing Mode

HyperCache supports two ways to back your local NVMe cache pool depending on your environment:

A. Raw Block Device Mode (storage_backing_mode = "raw_block" or "auto")

Best for bare-metal GPU servers or Cloud VMs with dedicated, unmounted local NVMe drives (e.g., /dev/nvme1n1, /dev/nvme2n1). HyperCache automatically discovers unmounted drives, excludes your OS root disk (/), and stripes 4 MiB chunks directly across raw disk sectors with zero filesystem overhead.

storage_backing_mode = "auto"
device_discovery_mode = "auto"
exclude_root_device = true

B. Filesystem Direct I/O Arena Mode (storage_backing_mode = "filesystem")

Best for Kubernetes pods (emptyDir / local-storage PVCs), shared servers where drives are already mounted with ext4/XFS, or native NVIDIA GPUDirect Storage (cuFile). HyperCache pre-allocates aligned arena files inside the specified directories and opens them with O_DIRECT - requiring zero raw block privileges.

storage_backing_mode = "filesystem"
filesystem_cache_paths = ["/mnt/nvme0/hypercache", "/mnt/nvme1/hypercache"]
filesystem_arena_size_bytes = 107374182400 # 100 GiB arena capacity per directory

2. Worker Node Configuration (configs/hypercache-agent.toml)

Deployed on every GPU or CPU worker node running ./hypercache -c configs/hypercache-agent.toml start:

# ==============================================================================
# 1. STORAGE POOL & TIERING
# ==============================================================================
storage_backing_mode = "auto"              # "auto", "raw_block", or "filesystem"
device_discovery_mode = "auto"             # "auto" (scan /sys/class/block) or "manual"
include_partitions = true                  # Include unmounted partitions
device_prefixes = ["nvme", "sd"]
exclude_root_device = true                 # Always protect OS root disk (/)
chunk_size_bytes = 4194304                 # 4 MiB stripe chunk size
device_start_offset_bytes = 4096           # 4 KB alignment safety margin

# If using storage_backing_mode = "filesystem", specify mounted XFS/ext4 directories:
filesystem_cache_paths = []
filesystem_arena_size_bytes = 10737418240  # 10 GiB per arena file

# Tier 1 Host RAM / CXL Shared Memory Acceleration (/dev/shm or HugePages)
ram_cache_enabled = false                  # Set true (or pass --ram) for 50-100+ GB/s RAM tier
ram_cache_capacity_bytes = 34359738368     # 32 GiB (or auto-sizes to 75% of /dev/shm if omitted)
ram_cache_shm_path = "/dev/shm/hypercache"
ram_cache_hugepages = false                # Set true to back Tier 1 with /dev/hugepages
ram_cache_hugepages_path = "/dev/hugepages/hypercache"

# Dual-Tier Metadata Persistence (< 20 ms warm-boot recovery)
metadata_persistence_enabled = true
metadata_persistence_path = "/var/lib/hypercache/metadata.json"

# ==============================================================================
# 2. AUTHORITATIVE REMOTE STORAGE (S3 / NFS)
# ==============================================================================
authoritative_backend = "s3"               # Default backend: "s3" or "nfs"
s3_endpoint = "https://s3.us-east-1.amazonaws.com"
s3_region = "us-east-1"
s3_bucket = "model-weights-bucket"
s3_access_key = "YOUR_ACCESS_KEY"          # Or set via env: export AWS_ACCESS_KEY_ID="..."
s3_secret_key = "YOUR_SECRET_KEY"          # Or set via env: export AWS_SECRET_ACCESS_KEY="..."
allow_synthetic_s3_fallback = false        # Keep false in production so S3 errors fail fast

nfs_mount_path = "/mnt/nfs"

# Checkpoint Write Semantics & Fault Tolerance
write_through_enabled = false              # false = async Write-Back, true = sync Write-Through
peer_replication_factor = 1                # Set to 2 for k=2 peer replica before CommitWrite returns

# ==============================================================================
# 3. MULTI-NODE CLUSTER REGISTRATION (Optional - Omit for Single-Node Mode)
# ==============================================================================
node_id = "gpu-node-01"
# controller_url = "http://10.0.0.10:9120"
# cluster_auth_token = "your-cluster-token"

agent_enabled = false
agent_bind_address = "0.0.0.0"
agent_http_port = 9115

[node_labels]
gpu = "h100"
pool = "training"

# ==============================================================================
# 4. PROMETHEUS TELEMETRY (Optional - Off by Default)
# ==============================================================================
metrics_enabled = false
metrics_bind_address = "127.0.0.1"
metrics_port = 9110

3. Central Controller Configuration (configs/hypercache-controller.toml)

Deployed on the head/coordinator node in multi-node GPU clusters (./hypercache-admin -c configs/hypercache-controller.toml controller):

# ==============================================================================
# 1. CONTROLLER NETWORK BINDING
# ==============================================================================

# IP address to bind the Central Controller service on
# Set to "0.0.0.0" to listen on all interfaces, or bind to a private VPC IP (e.g. "10.0.0.10")
controller_bind_address = "0.0.0.0"

# Port for incoming worker node registrations, heartbeats, and admin API calls
controller_port = 9120

# Optional secondary admin port
controller_admin_port = 9121

# ==============================================================================
# 2. CLUSTER SECURITY & AUTHENTICATION
# ==============================================================================

# Shared secret Bearer token for cluster security
# Worker nodes must provide this token to register, and remote CLI calls require it.
# Local connections from 127.0.0.1 on the controller host bypass authentication automatically.
# Can also be set via: export HYPERCACHE_AUTH_TOKEN="your-cluster-token"
cluster_auth_token = "your-cluster-token"

# ==============================================================================
# 3. P2P FLEET PRE-WARMING & CONSISTENT SHARDING
# ==============================================================================

# When enabled, fleet-wide preload pulls 1/N of chunks from S3 per node and distributes
# the remaining chunks peer-to-peer across worker nodes to eliminate S3 egress storms.
p2p_preload_enabled = false

4. Configuration Key & Environment Variable Reference

4.1 Worker Node Keys (hypercache-agent.toml)

Config KeyEnv OverrideDefaultDescription
socket_pathHYPERCACHE_SOCKET"/run/hypercache/hypercache.sock"Local Unix Domain Socket path (falls back to /tmp/hypercache/hypercache.sock).
storage_backing_mode-"auto""auto", "raw_block", or "filesystem" (O_DIRECT arena files).
filesystem_cache_paths-[]Mounted ext4/XFS directories for O_DIRECT arena files.
filesystem_arena_size_bytes-10737418240Pre-allocated size per filesystem arena file in bytes (10 GiB default).
device_discovery_mode-"auto""auto" (scan /sys/class/block) or "manual" (use block_devices list).
block_devices-[]Explicit list of block devices when device_discovery_mode = "manual".
exclude_root_device-trueUnconditionally exclude OS root drive (/) from the storage pool.
chunk_size_bytes-4194304Stripe chunk size in bytes across RAM and NVMe tiers (4 MiB).
ram_cache_enabledRAM_CACHE_ENABLEDfalseEnable Tier 1 Host RAM / CXL shared memory tier (--ram).
ram_cache_capacity_bytesRAM_CAPACITY_BYTES34359738368Maximum Tier 1 RAM cache size (32 GiB or 75% of /dev/shm if omitted).
ram_cache_hugepages-falseUse Linux hugetlbfs (/dev/hugepages) for Tier 1 memory blocks.
authoritative_backend-"s3"Default remote storage backend ("s3" or "nfs").
s3_endpointS3_ENDPOINT"http://127.0.0.1:9002"S3 or S3-compatible endpoint URL.
s3_regionAWS_DEFAULT_REGION"us-east-1"S3 bucket region.
s3_bucketS3_BUCKET"hypercache-authoritative"Default S3 bucket name when not specified in the URI.
s3_access_keyAWS_ACCESS_KEY_ID""S3 access key ID.
s3_secret_keyAWS_SECRET_ACCESS_KEY""S3 secret access key.
nfs_mount_path-"/mnt/nfs"Root mount path for NFS / POSIX shared filesystem backend.
write_through_enabled-falsefalse = async Write-Back; true = synchronous Write-Through to S3/NFS.
peer_replication_factor-1Set to 2 to enable k=2 peer checkpoint replication on CommitWrite.
controller_urlHYPERCACHE_CONTROLLER_URLNoneURL of Central Controller (e.g. "http://10.0.0.10:9120").
agent_enabled-falseEnables Worker Agent Fleet & P2P API on agent_http_port (9115).
metrics_enabled-falseEnables Prometheus HTTP exporter on metrics_port (9110).

4.2 Central Controller Keys (hypercache-controller.toml)

Config KeyEnv OverrideDefaultDescription
controller_bind_address-"0.0.0.0"IP address to bind the Central Controller service on.
controller_port-9120TCP port for worker registrations, heartbeats, and admin directives.
controller_admin_port-9121Secondary admin port.
cluster_auth_tokenHYPERCACHE_AUTH_TOKENNoneShared secret Bearer token for Controller and Worker Agent authentication.
p2p_preload_enabled-falseEnables 1/N origin pull + peer-to-peer chunk distribution during fleet preload.