DynexConfig
Handles all SDK configuration: credentials, compute backend, gRPC endpoint, timeouts, and output formatting.Constructor
Parameters
SDK authentication key. If not provided, loaded from
DYNEX_SDK_KEY environment variable or .env file.gRPC server endpoint. Defaults to
"127.0.0.1:9090". Set via DYNEX_GRPC_ENDPOINT env var or provide directly.Production: "quantum-router-engine-grpc.hz.dynex.co:3000"Compute backend to use. Accepts enum value or string:
| Value | String | Description |
|---|---|---|
ComputeBackend.GPU | "gpu" | Dynex neuromorphic GPU chips — primary backend |
ComputeBackend.QPU | "qpu" | Specific QPU hardware model |
ComputeBackend.CPU | "cpu" | CPU workers on the network |
ComputeBackend.LOCAL | "local" | Local binary, no network required |
Required when
compute_backend=QPU. Available models:| Value | String |
|---|---|
QPUModel.APOLLO_RC1 | "apollo_rc1" |
QPUModel.APOLLO_10000 | "apollo_10000" |
Enable Jupyter-friendly output formatting (progress bars, tables).
Job timeout in seconds. Applies to network backends.
Default job description shown in the Dynex job dashboard.
Number of retries for transient network failures.
If
True, keep solution files on disk after sampling completes.If
True, automatically delete local solution files after reading.Custom path to
.env file. If not provided, searches current directory and up to 3 parent directories.Custom path to directory containing
dynexcore binary (LOCAL mode only).Configuration priority
Parameters are resolved in this order (highest to lowest priority):- Constructor arguments
- Environment variables (
DYNEX_SDK_KEY,DYNEX_GRPC_ENDPOINT, etc.) .envfile values (ifpython-dotenvis installed)- Default values
Examples
as_dict() method
Returns all configuration parameters as a dictionary:
Errors
| Exception | Cause |
|---|---|
ValueError | Invalid compute_backend or qpu_model string; missing qpu_model for QPU backend |
FileNotFoundError | dynexcore binary not found in LOCAL mode |
PermissionError | Cannot create tmp/ directory |