client.models¶
Bases: SyncResource
Sync trained-model registry namespace (client.models).
list ¶
list(*, project_id: UUID | str | None = None, limit: int | None = None, cursor: str | None = None) -> Page[TrainedModel]
List trained models in the tenant registry, newest first (cursor-paginated; iterate the page to walk all models).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
UUID | str | None
|
narrow to one project's lineage (only models trained from that project's versions). |
None
|
Raises:
| Type | Description |
|---|---|
BadRequestError
|
malformed pagination cursor (INVALID_CURSOR). |
get ¶
Fetch one trained model (full scorecard + lineage).
Raises:
| Type | Description |
|---|---|
NotFoundError
|
no such model in this tenant (UNCATEGORIZED). |
update ¶
update(model_id: UUID | str, *, name: str | None = None, description: str | None = None) -> TrainedModel
Edit a trained model's name and/or description (partial — send only what
changes). At least one of name/description must be provided.
Model names are unique per tenant (case-insensitive).
Raises:
| Type | Description |
|---|---|
NotFoundError
|
no such model in this tenant (UNCATEGORIZED). |
ConflictError
|
another model already has that name (NAME_TAKEN). |
UnprocessableError
|
empty body or a blank name (VALIDATION_ERROR). |
delete ¶
Delete a trained model (204). Hard delete: drops the row and enqueues async S3 cleanup of the model's weights; cascades to any deployments of it.
Raises:
| Type | Description |
|---|---|
NotFoundError
|
no such model in this tenant (UNCATEGORIZED). |
Response models¶
Models returned by client.models methods (fields, types, and what each means).
Trained-model registry domain models (the tenant model registry, ADR-0064/0072).
A TrainedModel is the reusable product of a successful training run — weights
+ scorecard + class map — owned by the tenant (lineage back to the producing
project/version/run). This module types the read shape returned by the models
resource, including the metrics_summary scorecard blob (mirrors the server's
TrainingMetricsSummary, ADR-0064) rather than leaving it an untyped dict.
OverallMetrics ¶
Bases: BaseModel
Overall detection/segmentation metrics at the F1-optimal confidence.
PerClassMetrics ¶
Bases: BaseModel
One class's precision/recall/F1 + GT support at the chosen threshold.
The wire key is class (a Python reserved word), aliased to class_.
ConfusionMatrix ¶
Bases: BaseModel
K classes + a trailing 'background' bucket for false-positives / misses.
TrainingMetricsSummary ¶
Bases: BaseModel
The scorecard echoed on TrainedModel.metrics_summary (ADR-0064). Lenient
reader: every field defaults, so a legacy/empty blob never fails to parse.
TrainedModel ¶
Bases: BaseModel
A trained model in the tenant registry: the reusable artifact produced by a successful training run, with lineage back to its project/version/run.