Configuration
Environment variables and MultiRunConfig.
Configuration
Environment variables
| Variable | Description | Default |
|---|---|---|
MULTIRUN_ENDPOINT | Runtime service URL | http://localhost:8989 |
MULTIRUN_API_KEY | API key for authentication | None |
MULTIRUN_TIMEOUT | Request timeout in seconds | 30.0 |
MULTIRUN_SERIALIZER | State serializer (cloudpickle, pickle, json) | cloudpickle |
MULTIRUN_REQUEST_RETRIES | Max retries for transient failures (429, 5xx) | 3 |
MULTIRUN_DEBUG | Enable debug logging (1, true, yes) | false |
MultiRunConfig
Programmatic configuration. Constructed automatically by multirun.init() / MultiRunClient.connect(), or built manually.
from multirun import MultiRunConfig
config = MultiRunConfig(
endpoint="http://localhost:8989",
api_key="your-key",
timeout=60.0,
serializer="cloudpickle",
request_retries=3,
)Fields
| Field | Type | Default | Description |
|---|---|---|---|
endpoint | str | http://localhost:8989 | Runtime service URL |
api_key | str | None | None | API key for auth |
timeout | float | 30.0 | Request timeout (seconds) |
serializer | str | cloudpickle | Serializer for state/checkpoints |
default_budget | Budget | None | None | Default budget applied to all runs |
default_policy | Policy | None | None | Default policy applied to all runs |
connect_retries | int | 3 | Retries when establishing connection |
connect_retry_delay | float | 1.0 | Delay between connection retries (seconds) |
request_retries | int | 3 | Retries for transient request failures |
request_retry_base_delay | float | 0.5 | Base delay for request retry backoff |
request_retry_max_delay | float | 30.0 | Max delay ceiling for request retry backoff |
debug | bool | False | Enable debug logging on init |
from_env()
config = MultiRunConfig.from_env()Reads all supported MULTIRUN_* environment variables and returns a configured instance.
Debug logging
from multirun import enable_debug_logging
enable_debug_logging()Sets up a console handler on the multirun logger with DEBUG level. Call at script start to see SDK internals.
Serializers
The SDK uses serializers for step inputs/outputs and checkpoint state. Three built-in options:
| Serializer | Pros | Cons |
|---|---|---|
cloudpickle (default) | Handles lambdas, closures, complex types | Not portable across Python versions |
pickle | Fast, standard library | Not portable, security risk with untrusted data |
json | Portable, human-readable | Only supports JSON-serializable types |
Set via MULTIRUN_SERIALIZER env var or MultiRunConfig(serializer=...).