Configuration¶
config
¶
Configuration system with Pydantic validation.
Replaces the scattered configuration across dependencies.json, repo-config.json, and hardcoded values in PowerShell scripts. Provides a single, typed, validated configuration model.
ToolConfig
¶
Bases: BaseModel
Configuration for an external tool (e.g. VS Build Tools).
ToolsConfig
¶
Bases: BaseModel
All external tools configuration.
TorchConfig
¶
Bases: BaseModel
PyTorch installation configuration.
WheelConfig
¶
Bases: BaseModel
A pre-built wheel package to install.
Supports version-aware wheels via the versions mapping:
each key is a CPython tag (e.g. "cp311", "cp312")
and the value is the download URL for that version.
Optionally, checksums maps CPython tags to expected
SHA-256 hex digests for supply-chain verification.
Legacy format (flat name + url) is still supported.
resolve(python_version, cuda_tag='')
¶
Pick the wheel matching the running Python and CUDA version.
Resolution order for versioned wheels:
1. {cuda_tag}_{cpython_tag} — exact CUDA + Python match
2. {cpython_tag} — CUDA-agnostic fallback
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_version
|
tuple[int, int]
|
(major, minor) tuple, e.g. (3, 13). |
required |
cuda_tag
|
str
|
CUDA tag, e.g. |
''
|
Returns:
| Type | Description |
|---|---|
tuple[str, str, str | None] | None
|
(name, url, sha256_or_None) tuple, or None if no match. |
Source code in src/config.py
PipPackages
¶
Bases: BaseModel
All pip package configurations.
supported_cuda_tags
property
¶
List supported CUDA tags from the torch configuration.
get_torch(cuda_tag)
¶
Get the TorchConfig for a specific CUDA tag.
Handles both legacy (single TorchConfig) and multi-CUDA (dict) formats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cuda_tag
|
str
|
CUDA tag, e.g. |
required |
Returns:
| Type | Description |
|---|---|
TorchConfig | None
|
Matching TorchConfig, or |
Source code in src/config.py
RepositoryConfig
¶
Bases: BaseModel
A git repository source.
RepositoriesConfig
¶
Bases: BaseModel
All git repositories.
FileEntry
¶
Bases: BaseModel
A file to download with its destination.
FilesConfig
¶
Bases: BaseModel
All downloadable files.
InstallOptions
¶
Bases: BaseModel
Options for uv pip install.
OptimizationPackage
¶
Bases: BaseModel
A single GPU optimization package with platform/GPU filters.
pypi_package can be a plain string (same on all platforms) or
a dict mapping platform names (windows, linux, macos)
to platform-specific package names.
requires is a list of tags the environment must satisfy for
this package to be installed. Supported tags:
nvidia, amd, linux, windows, macos.
get_package_name(platform)
¶
Resolve the pip package name for the given platform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
platform
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Package name string, or |
Source code in src/config.py
OptimizationsConfig
¶
Bases: BaseModel
GPU optimization packages configuration.
DependenciesConfig
¶
Bases: BaseModel
Complete dependencies configuration.
Typed replacement for dependencies.json.
InstallerSettings
¶
Bases: BaseModel
User-local installer settings.
Replaces repo-config.json and hardcoded values. This file should NEVER be overwritten by bootstrap/update.
load_dependencies(path)
¶
Load and validate dependencies.json.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to dependencies.json file. |
required |
Returns:
| Type | Description |
|---|---|
DependenciesConfig
|
Validated DependenciesConfig object. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the file doesn't exist. |
ValueError
|
If the JSON is invalid. |
Source code in src/config.py
load_settings(path)
¶
Load user-local settings from local-config.json.
If the file doesn't exist, returns defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to local-config.json. |
required |
Returns:
| Type | Description |
|---|---|
InstallerSettings
|
InstallerSettings with loaded or default values. |
Source code in src/config.py
save_settings(settings, path)
¶
Save settings to local-config.json.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
InstallerSettings
|
The settings to save. |
required |
path
|
Path
|
Destination file path. |
required |