API Reference
The API reference is generated from the public Python modules.
Core
Fovux configuration loader.
Reads config.toml from FOVUX_HOME, applies environment variable overrides, and exposes a typed FovuxConfig object.
FovuxConfig
Bases: BaseModel
Root Fovux configuration.
Source code in src/fovux/config.py
fovux_paths
property
Return a FovuxPaths resolved from the current config.
telemetry_enabled
property
Return effective telemetry setting, respecting FOVUX_NO_TELEMETRY.
InferenceConfig
PathsConfig
TelemetryConfig
TrainingConfig
UIConfig
ValidationConfig
clear_config_cache()
load_config(config_path=None)
Load Fovux configuration from config.toml.
Priority: env vars > config.toml > defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
Path | None
|
Override path to config.toml. Defaults to FOVUX_HOME/config.toml. |
None
|
Returns:
| Type | Description |
|---|---|
FovuxConfig
|
Validated FovuxConfig instance. |
Source code in src/fovux/config.py
write_default_config(config_path)
Write a default config.toml to the given path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
Path
|
Destination path for config.toml. |
required |
Source code in src/fovux/config.py
Fovux exception hierarchy.
All exceptions raised by Fovux tools are subclasses of FovuxError. External library exceptions (ultralytics, cv2, onnx) must never bubble up raw.
FovuxCheckpointNotFoundError
Bases: FovuxEvalError
Checkpoint file does not exist.
Source code in src/fovux/core/errors.py
__init__(path)
Initialize with the missing checkpoint path.
FovuxConfigError
FovuxDatasetEmptyError
Bases: FovuxDatasetError
Dataset contains zero images.
Source code in src/fovux/core/errors.py
__init__(path, message=None)
Initialize with the empty dataset path.
Source code in src/fovux/core/errors.py
FovuxDatasetError
FovuxDatasetFormatError
Bases: FovuxDatasetError
Dataset format cannot be detected or is malformed.
Source code in src/fovux/core/errors.py
FovuxDatasetNotFoundError
Bases: FovuxDatasetError
Dataset path does not exist.
Source code in src/fovux/core/errors.py
FovuxError
Bases: Exception
Base exception for all Fovux errors.
Attributes:
| Name | Type | Description |
|---|---|---|
code |
str
|
Stable error code string (e.g. FOVUX_DATASET_001). |
message |
Human-readable description. |
|
hint |
Optional remediation hint for the user. |
Source code in src/fovux/core/errors.py
__init__(message, hint=None)
Initialize FovuxError.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Human-readable error description. |
required |
hint
|
str | None
|
Optional remediation hint. |
None
|
Source code in src/fovux/core/errors.py
FovuxEvalError
FovuxExportError
FovuxExportParityError
Bases: FovuxExportError
Roundtrip parity check failed after export.
Source code in src/fovux/core/errors.py
FovuxInferenceError
FovuxPathValidationError
Bases: FovuxConfigError
Raised when a filesystem path violates local safety checks.
Source code in src/fovux/core/errors.py
__init__(path, reason, hint=None)
Initialize the path validation error.
Source code in src/fovux/core/errors.py
FovuxRtspConnectionError
Bases: FovuxInferenceError
RTSP stream could not be opened.
Source code in src/fovux/core/errors.py
__init__(url)
Initialize with the failing RTSP URL.
FovuxTrainingAlreadyRunningError
Bases: FovuxTrainingError
Attempt to start training on an already-running run.
Source code in src/fovux/core/errors.py
FovuxTrainingError
FovuxTrainingRunNotFoundError
Bases: FovuxTrainingError
Run ID does not exist in the registry.
Source code in src/fovux/core/errors.py
FovuxTrainingSubprocessError
Bases: FovuxTrainingError
Training subprocess exited with non-zero code.
Source code in src/fovux/core/errors.py
Fovux home directory resolution and path helpers.
FovuxPaths
Typed container for all Fovux filesystem paths.
Attributes:
| Name | Type | Description |
|---|---|---|
home |
Root Fovux data directory. |
|
runs |
Training run directories. |
|
models |
Pretrained / imported checkpoints. |
|
cache |
Perceptual hashes, thumbnails, dataset cache. |
|
exports |
Exported ONNX / TFLite / TensorRT artifacts. |
|
datasets |
Indexed dataset metadata (not raw images). |
|
runs_db |
SQLite runs index. |
|
config_file |
User-level config.toml. |
Source code in src/fovux/core/paths.py
__init__(home, path_overrides=None, *, load_config_file=True)
Initialize with a home directory.
Source code in src/fovux/core/paths.py
__repr__()
run_dir(run_id)
Return the directory for a specific run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_id
|
str
|
The run identifier string. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the run directory. |
ensure_fovux_dirs(home=None)
Create all required Fovux subdirectories and return a FovuxPaths instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
home
|
Path | None
|
Override the home directory (defaults to get_fovux_home()). |
None
|
Returns:
| Type | Description |
|---|---|
FovuxPaths
|
FovuxPaths with all directories created. |
Source code in src/fovux/core/paths.py
get_fovux_home()
Resolve the Fovux home directory.
Priority order: 1. FOVUX_HOME environment variable 2. ~/.fovux
Returns:
| Type | Description |
|---|---|
Path
|
Absolute Path to the Fovux home directory. |
Source code in src/fovux/core/paths.py
Stable compatibility facade for the SQLite-backed run registry.
ArtifactRecord
Bases: Base
ORM model for artifacts (e.g. checkpoints, exports, datasets).
Source code in src/fovux/core/run_registry/models.py
AuditEventRecord
Bases: Base
ORM model for security/system audit events.
Source code in src/fovux/core/run_registry/models.py
Base
DatasetRecord
Bases: Base
ORM model for datasets.
Source code in src/fovux/core/run_registry/models.py
ExportRecord
Bases: Base
ORM model for model exports.
Source code in src/fovux/core/run_registry/models.py
MetricRecord
Bases: Base
ORM model for step or epoch-level metrics.
Source code in src/fovux/core/run_registry/models.py
ModelRecord
Bases: Base
ORM model for registered or downloaded models.
Source code in src/fovux/core/run_registry/models.py
OperationEventRecord
Bases: Base
ORM model for operation lifecycle events (for SSE resume).
Source code in src/fovux/core/run_registry/models.py
OperationRecord
Bases: Base
ORM model for a background operation.
Source code in src/fovux/core/run_registry/models.py
ReviewQueueEntry
Bases: Base
ORM model for active learning review queue entries.
Source code in src/fovux/core/run_registry/models.py
RunEventRecord
Bases: Base
ORM model for run lifecycle events (status transition, artifact creation, etc.).
Source code in src/fovux/core/run_registry/models.py
RunRecord
Bases: Base
ORM model for a training run row.
Source code in src/fovux/core/run_registry/models.py
RunRegistry
CRUD compatibility facade for the SQLite runs registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
Path
|
Path to the SQLite database file. |
required |
Source code in src/fovux/core/run_registry/facade.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | |
__init__(db_path)
Compose focused repositories over one SQLite database boundary.
Source code in src/fovux/core/run_registry/facade.py
add_artifact(artifact_id, run_id, artifact_type, path, sha256=None, size=None, extra=None)
Register or merge an artifact record.
Source code in src/fovux/core/run_registry/facade.py
add_metric(run_id, epoch, key, value)
Record an epoch-level training metric.
add_review_queue_entry(entry_id, image_path, dataset_path, score, reason, predictions)
Add or update an active-learning review queue entry.
Source code in src/fovux/core/run_registry/facade.py
close()
create_operation(op_id, tool, arguments, idempotency_key=None)
Insert a new operation record.
Source code in src/fovux/core/run_registry/facade.py
create_operation_event(op_id, event_type, data)
Create a durable lifecycle event for an operation.
Source code in src/fovux/core/run_registry/facade.py
create_run(run_id, run_path, model, dataset_path, task, epochs, tags=None, extra=None, dataset_fingerprint=None, config_hash=None, code_version=None, env_summary=None, parent_run_id=None)
Insert a new run record.
Source code in src/fovux/core/run_registry/facade.py
delete_run(run_id)
get_dataset(fingerprint)
get_operation(op_id)
get_operation_by_idempotency_key(idempotency_key)
Fetch an operation by idempotency key.
get_review_queue_entry(entry_id)
get_run(run_id)
list_artifacts(run_id=None, limit=1000)
list_audit_events(limit=100, offset=0)
List audit events ordered by creation time descending.
list_datasets(limit=100)
list_exports(run_id=None, limit=100)
list_metrics(run_id, limit=1000)
list_operation_events(last_event_id=None, limit=1000)
List operation events newer than an optional event ID.
Source code in src/fovux/core/run_registry/facade.py
list_operations(limit=100)
list_review_queue_entries(dataset_path=None, status='pending', limit=100)
List active-learning review queue entries.
Source code in src/fovux/core/run_registry/facade.py
list_run_events(run_id=None, limit=1000)
List run lifecycle and audit events.
list_runs(status=None, limit=100, offset=0)
List runs, optionally filtered by status.
log_audit_event(actor, action, entity_type, entity_id, details)
Log an audit event to the database.
Source code in src/fovux/core/run_registry/facade.py
record_export(export_id, run_id, source_checkpoint, artifact_path, format, duration_s=None, validation_result=None)
Record a model export and its associated artifact.
Source code in src/fovux/core/run_registry/facade.py
reserve_run_slot(run_id, run_path, model, dataset_path, task, epochs, max_concurrent_runs, tags=None, extra=None, dataset_fingerprint=None, config_hash=None, code_version=None, env_summary=None, parent_run_id=None)
Reserve a run slot atomically.
Source code in src/fovux/core/run_registry/facade.py
update_extra(run_id, extra)
update_operation_progress(op_id, progress)
update_operation_status(op_id, status, error_type=None, error=None, result=None, run_id=None)
Update operation lifecycle fields.
Source code in src/fovux/core/run_registry/facade.py
update_review_queue_status(entry_id, status, corrected_labels=None)
Update review queue entry status and corrections.
Source code in src/fovux/core/run_registry/facade.py
update_status(run_id, status, pid=None)
Update run status and optional process ID.
SchemaMigrationRecord
TagRecord
UtcDateTime
Bases: TypeDecorator[datetime]
Store datetimes as ISO-8601 text to avoid sqlite3 default adapters.
Source code in src/fovux/core/run_registry/models.py
process_bind_param(value, _dialect)
Serialize a Python datetime before binding it to SQLite.
process_result_value(value, _dialect)
Deserialize a stored SQLite value into a Python datetime.
Source code in src/fovux/core/run_registry/models.py
close_registry(db_path=None)
Dispose cached registry engines for one database or all databases.
Source code in src/fovux/core/runs.py
get_registry(db_path)
Return a process-local singleton registry for a database path.
Source code in src/fovux/core/runs.py
Structured logger backed by structlog for production-grade observability.
Respects
FOVUX_LOG_LEVEL — DEBUG | INFO | WARNING | ERROR (default: INFO) FOVUX_LOG_FORMAT — json | pretty (default: pretty) NO_COLOR — disable ANSI colours when set to any non-empty value
configure_logging(level=None, fmt=None)
Configure structured logging for the Fovux process.
Safe to call multiple times — subsequent calls reconfigure in-place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str | None
|
Override for FOVUX_LOG_LEVEL. |
None
|
fmt
|
str | None
|
Override for FOVUX_LOG_FORMAT ( |
None
|
Source code in src/fovux/core/logging.py
get_logger(name)
Return a structured logger for the given module name.
Uses structlog when available, falls back to stdlib logging.Logger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Typically |
required |
Returns:
| Type | Description |
|---|---|
_Logger
|
A logger compatible with |
Source code in src/fovux/core/logging.py
Domain router aggregation and compatibility exports for the local HTTP API.
build_http_router()
Assemble every domain router exactly once.
Source code in src/fovux/http/routes/__init__.py
get_logger(name)
Return a structured logger for the given module name.
Uses structlog when available, falls back to stdlib logging.Logger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Typically |
required |
Returns:
| Type | Description |
|---|---|
_Logger
|
A logger compatible with |
Source code in src/fovux/core/logging.py
sse_events_route(request)
async
Server-Sent Events (SSE) stream of all operations events with resume support.
Source code in src/fovux/http/routes/operations.py
Schemas
Pydantic schemas for dataset tools.
AutoFixItem
ClassStat
DatasetAugmentInput
Bases: BaseModel
Input for dataset_augment.
Source code in src/fovux/schemas/dataset.py
DatasetAugmentOutput
Bases: BaseModel
Output from dataset_augment.
Source code in src/fovux/schemas/dataset.py
DatasetConvertInput
Bases: BaseModel
Input for dataset_convert tool.
Source code in src/fovux/schemas/dataset.py
DatasetConvertOutput
Bases: BaseModel
Output from dataset_convert tool.
Source code in src/fovux/schemas/dataset.py
DatasetFindDuplicatesInput
Bases: BaseModel
Input for dataset_find_duplicates tool.
Source code in src/fovux/schemas/dataset.py
DatasetFindDuplicatesOutput
Bases: BaseModel
Output from dataset_find_duplicates tool.
Source code in src/fovux/schemas/dataset.py
DatasetInspectInput
Bases: BaseModel
Input for dataset_inspect tool.
Source code in src/fovux/schemas/dataset.py
DatasetInspectOutput
Bases: BaseModel
Output from dataset_inspect tool.
Source code in src/fovux/schemas/dataset.py
DatasetSplitInput
Bases: BaseModel
Input for dataset_split tool.
Source code in src/fovux/schemas/dataset.py
DatasetSplitOutput
Bases: BaseModel
Output from dataset_split tool.
Source code in src/fovux/schemas/dataset.py
DatasetValidateInput
Bases: BaseModel
Input for dataset_validate tool.
Source code in src/fovux/schemas/dataset.py
DatasetValidateOutput
Bases: BaseModel
Output from dataset_validate tool.
Source code in src/fovux/schemas/dataset.py
DuplicateGroup
Histogram
LabelAnomalySummary
LeakageIssue
SizeHistogram
ValidationIssue
Pydantic schemas for training tools.
TrainPreflightInput
Bases: BaseModel
Input for train_preflight tool (shares validation with TrainStartInput).
Source code in src/fovux/schemas/training.py
merge_extra_args(data)
classmethod
Merge extra_args field values into options.
Source code in src/fovux/schemas/training.py
validate_device(v)
classmethod
validate_device_policy()
Validate device policy via TrainStartInput rules.
Source code in src/fovux/schemas/training.py
TrainPreflightOutput
Bases: BaseModel
Output for train_preflight tool.
Source code in src/fovux/schemas/training.py
TrainResumeInput
TrainResumeOutput
TrainStartInput
Bases: BaseModel
Input for train_start tool.
Source code in src/fovux/schemas/training.py
merge_extra_args(data)
classmethod
Merge extra_args field values into options.
Source code in src/fovux/schemas/training.py
validate_device(v)
classmethod
Validate device is cpu, cuda, or specific GPU index.
Source code in src/fovux/schemas/training.py
validate_device_policy()
Check compatibility between device and device_policy.
Source code in src/fovux/schemas/training.py
validate_model(v)
classmethod
Validate model source file extension format.
Source code in src/fovux/schemas/training.py
TrainStartOutput
TrainStatusInput
TrainStatusOutput
Bases: BaseModel
Output from train_status tool.
Source code in src/fovux/schemas/training.py
TrainStopInput
TrainStopOutput
TrainingOptions
Bases: BaseModel
Supported training options for YOLO.
Source code in src/fovux/schemas/training.py
Pydantic schemas for evaluation tools.
CheckpointComparison
Bases: BaseModel
Comparison row for one checkpoint.
Source code in src/fovux/schemas/eval.py
ConfusionEntry
ErrorSample
EvalCompareInput
Bases: BaseModel
Input for eval_compare tool.
Source code in src/fovux/schemas/eval.py
EvalCompareOutput
EvalErrorAnalysisInput
Bases: BaseModel
Input for eval_error_analysis tool.
Source code in src/fovux/schemas/eval.py
EvalErrorAnalysisOutput
Bases: BaseModel
Output from eval_error_analysis tool.
Source code in src/fovux/schemas/eval.py
EvalPerClassInput
Bases: BaseModel
Input for eval_per_class tool.
Source code in src/fovux/schemas/eval.py
EvalPerClassOutput
EvalRunInput
Bases: BaseModel
Input for eval_run tool.
Source code in src/fovux/schemas/eval.py
EvalRunOutput
Bases: BaseModel
Output from eval_run tool.
Source code in src/fovux/schemas/eval.py
PerClassStat
Bases: BaseModel
Per-class evaluation statistics.
Source code in src/fovux/schemas/eval.py
Pydantic schemas for export and quantization tools.
ExportOnnxInput
Bases: BaseModel
Input for export_onnx tool.
Source code in src/fovux/schemas/export.py
ExportOnnxOutput
Bases: BaseModel
Output from export_onnx tool.
Source code in src/fovux/schemas/export.py
ExportTfliteInput
Bases: BaseModel
Input for export_tflite tool.
Source code in src/fovux/schemas/export.py
ExportTfliteOutput
Bases: BaseModel
Output from export_tflite tool.
Source code in src/fovux/schemas/export.py
QuantizeInt8Input
QuantizeInt8Output
Bases: BaseModel
Output from quantize_int8 tool.
Source code in src/fovux/schemas/export.py
QuantizeReportInput
Bases: BaseModel
Input for quantize_report tool.
Source code in src/fovux/schemas/export.py
QuantizeReportOutput
Bases: BaseModel
Output from quantize_report tool.
Source code in src/fovux/schemas/export.py
Pydantic schemas for inference and latency benchmark tools.
ActiveLearningQueueItem
Bases: BaseModel
A single review queue entry.
Source code in src/fovux/schemas/inference.py
ActiveLearningQueueListInput
Bases: BaseModel
Input for active_learning_queue_list.
Source code in src/fovux/schemas/inference.py
ActiveLearningQueueListOutput
ActiveLearningQueueRankInput
Bases: BaseModel
Input for active_learning_queue_rank.
Source code in src/fovux/schemas/inference.py
ActiveLearningQueueRankOutput
Bases: BaseModel
Output for active_learning_queue_rank.
Source code in src/fovux/schemas/inference.py
ActiveLearningQueueSubmitInput
Bases: BaseModel
Input for active_learning_queue_submit.
Source code in src/fovux/schemas/inference.py
ActiveLearningQueueSubmitOutput
Bases: BaseModel
Output for active_learning_queue_submit.
Source code in src/fovux/schemas/inference.py
ActiveLearningSelectInput
Bases: BaseModel
Input for active_learning_select.
Source code in src/fovux/schemas/inference.py
ActiveLearningSelectOutput
Bases: BaseModel
Output from active_learning_select.
Source code in src/fovux/schemas/inference.py
BatchDetectionSummary
Bases: BaseModel
Per-image summary returned by infer_batch.
Source code in src/fovux/schemas/inference.py
BenchmarkLatencyInput
Bases: BaseModel
Input for benchmark_latency.
Source code in src/fovux/schemas/inference.py
BenchmarkLatencyOutput
Bases: BaseModel
Output for benchmark_latency.
Source code in src/fovux/schemas/inference.py
Detection
DistillModelInput
Bases: BaseModel
Input for distill_model.
Source code in src/fovux/schemas/inference.py
DistillModelOutput
InferBatchInput
Bases: BaseModel
Input for infer_batch.
Source code in src/fovux/schemas/inference.py
InferBatchOutput
Bases: BaseModel
Output for infer_batch.
Source code in src/fovux/schemas/inference.py
InferEnsembleInput
Bases: BaseModel
Input for infer_ensemble.
Source code in src/fovux/schemas/inference.py
InferEnsembleOutput
Bases: BaseModel
Output from infer_ensemble.
Source code in src/fovux/schemas/inference.py
InferImageInput
Bases: BaseModel
Input for infer_image.
Source code in src/fovux/schemas/inference.py
InferImageOutput
Bases: BaseModel
Output for infer_image.
Source code in src/fovux/schemas/inference.py
InferRtspInput
Bases: BaseModel
Input for infer_rtsp.
Source code in src/fovux/schemas/inference.py
InferRtspOutput
Bases: BaseModel
Output for infer_rtsp.
Source code in src/fovux/schemas/inference.py
ModelCompareVisualInput
Bases: BaseModel
Input for model_compare_visual.
Source code in src/fovux/schemas/inference.py
ModelCompareVisualOutput
Bases: BaseModel
Output from model_compare_visual.
Source code in src/fovux/schemas/inference.py
SyncToMlflowOutput
TrainAdjustInput
Pydantic schemas for model and run management tools.
DemoInitInput
DemoInitOutput
DeploymentAdviseInput
Bases: BaseModel
Input for deployment_advise.
Source code in src/fovux/schemas/management.py
DeploymentAdviseOutput
Bases: BaseModel
Output for deployment_advise.
Source code in src/fovux/schemas/management.py
ModelArtifact
Bases: BaseModel
Metadata for a tracked model artifact.
Source code in src/fovux/schemas/management.py
ModelListInput
ModelListOutput
RunArchiveInput
RunArchiveOutput
RunCompareInput
RunCompareOutput
Bases: BaseModel
Output for run_compare.
Source code in src/fovux/schemas/management.py
RunDeleteInput
RunDeleteOutput
Bases: BaseModel
Output for run_delete.
Source code in src/fovux/schemas/management.py
RunMetricSummary
Bases: BaseModel
Comparable run summary with experiment intelligence metrics.