Configuration¶
RexConfig controls the package runtime.
Storage¶
from rex.api.config import RexConfig
from rex.core.types import StorageBackendType
config = RexConfig()
config.storage.base_url = "http://localhost:8080"
config.storage.backend_type = StorageBackendType.HTTP_RANGE
config.storage.max_concurrent_fetches = 4
config.storage.adaptive_concurrency = True
config.storage.retry_max_attempts = 3
config.storage.request_timeout_seconds = 30.0
Constructor overrides¶
You can also select the WebSocket backend at construction time:
from rex.api.config import RexConfig
from rex.core.types import StorageBackendType
config = RexConfig(
storage__backend_type=StorageBackendType.STREAMING_WS,
storage__base_url="wss://my-server.example.com/chunks",
)
If a manifest already includes storage_backend: streaming_ws, Rex can use
that as the default live-streaming hint and still respects explicit config
overrides.
Cache and scheduler¶
config.cache.max_memory_cache_bytes = 512 * 1024 * 1024
config.cache.max_local_fraction_of_model = 0.4
config.scheduler.enable_prefetch = True
config.scheduler.prefetch_window = 4
config.scheduler.scheduler_mode = "graph"
Observability¶
config.observability.log_level = "INFO"
config.observability.log_format = "console"
config.observability.enable_tracing = True
Environment variables¶
REX_STORAGE_BACKENDREX_STORAGE_URLREX_AUTH_TOKENREX_CACHE_SIZE_MBREX_CACHE_POLICYREX_PREFETCH_WINDOWREX_LOG_LEVELREX_MAX_LOCAL_FRACREX_DEBUGREX_ENABLE_STREAMING
Storage backend modes¶
HTTP_RANGE: default path for normal chunk-host loads.STREAMING_WS: explicit WebSocket streaming mode forrex-serve.storage_backend: streaming_wsin the manifest is treated as a streaming hint.GOOGLE_DRIVE,ONEDRIVE,ICLOUD: alternate backend types where supported.