Training Projects

Access training projects through client.training_projects in the Datature Vi SDK.

Training projects organize related flows and runs into logical groups for tracking training experiments. Each training project has a type (phrase grounding, VQA, or freeform) that determines the annotation format and model architecture options available.

Before You Start

Get started with the Vi SDK →


Methods

list()

List all training projects in your organization.

projects = client.training_projects.list()

for project in projects.items:
    print(f"{project.spec.name}: {project.training_project_id}")
from vi.api.types import PaginationParams

projects = client.training_projects.list(
    pagination=PaginationParams(page_size=50)
)

for page in projects:
    for project in page.items:
        print(f"{project.spec.name}: {project.spec.type}")
all_projects = list(client.training_projects.list().all_items())
print(f"Total projects: {len(all_projects)}")

Parameters

Name
Type
Description
Required
Default
pagination
object
Pagination settings. See PaginationParams.
Optional
None

Returns: PaginatedResponse[TrainingProject]


get()

Get a specific training project by ID.

project = client.training_projects.get(
    training_project_id="project_abc123"
)

print(f"Name: {project.spec.name}")
print(f"Type: {project.spec.type}")
project = client.training_projects.get(
    training_project_id="project_abc123"
)
project.info()  # Prints formatted project summary
project = client.training_projects.get(
    training_project_id="project_abc123"
)

print(f"Runs: {len(project.status.runs)}")
print(f"Flows: {len(project.status.flows)}")

Parameters

Name
Type
Description
Required
Default
training_project_id
string
Training project identifier.
Required

Returns: TrainingProject


create()

Create a new training project.

project = client.training_projects.create(
    spec={"name": "My Project", "type": "vqa"}
)

print(f"Created: {project.training_project_id}")
project = client.training_projects.create(
    spec={"name": "My Project", "type": "phrase-grounding"},
    training_project_id="my-custom-id"
)
project = client.training_projects.create(
    spec={"name": "My Project", "type": "freeform"},
    metadata={"environment": "production"}
)

Parameters

Name
Type
Description
Required
Default
spec
object
Training project specification including name and type. Accepts TrainingProjectSpec or dict.
Required
training_project_id
string
Custom project ID. Auto-generated if not provided.
Optional
None
metadata
object
Optional metadata attributes as key-value pairs.
Optional
None

Returns: TrainingProject


update()

Update an existing training project. Uses PATCH semantics: only provided fields are modified. The project type cannot be changed after creation.

project = client.training_projects.update(
    training_project_id="project_abc123",
    spec={"name": "Updated Name"}
)
project = client.training_projects.update(
    training_project_id="project_abc123",
    spec={"description": "New description"}
)
project = client.training_projects.update(
    training_project_id="project_abc123",
    metadata={"environment": "staging"}
)

Parameters

Name
Type
Description
Required
Default
training_project_id
string
Training project identifier.
Required
spec
object
Partial spec with fields to update. Supports name and description.
Optional
None
metadata
object
Optional metadata attributes to update.
Optional
None

Returns: TrainingProject


delete()

Delete a training project permanently.

deleted = client.training_projects.delete(
    training_project_id="project_abc123"
)
print(f"Deleted: {deleted.id}")
project = client.training_projects.get(
    training_project_id="project_abc123"
)
print(f"About to delete: {project.spec.name}")
print(f"  Runs: {len(project.status.runs)}")

confirm = input("Delete? (yes/no): ")
if confirm.lower() == "yes":
    client.training_projects.delete(
        training_project_id="project_abc123"
    )
    print("Deleted.")

Parameters

Name
Type
Description
Required
Default
training_project_id
string
Training project identifier.
Required

Returns: DeletedResource


get_aggregation_insights()

Get aggregation insights for a training project, including hyperparameters and metrics across all runs.

insights = client.training_projects.get_aggregation_insights(
    training_project_id="project_abc123"
)

if insights.payload:
    for run_id, data in insights.payload.results.items():
        print(f"Run {run_id}: {data}")

Parameters

Name
Type
Description
Required
Default
training_project_id
string
Training project identifier.
Required

Returns: AggregationInsightsResult


generate_aggregation_insights()

Trigger generation of aggregation insights for a training project. This is an asynchronous operation. Use get_aggregation_insights() to check the status and retrieve results.

client.training_projects.generate_aggregation_insights(
    training_project_id="project_abc123"
)

# Check status later
insights = client.training_projects.get_aggregation_insights(
    training_project_id="project_abc123"
)

if insights.pending_operation:
    print(f"Status: {insights.pending_operation.status}")

Parameters

Name
Type
Description
Required
Default
training_project_id
string
Training project identifier.
Required

Returns: None


dry_run_create()

Validate whether a training project can be created with the given ID and name without actually creating it.

result = client.training_projects.dry_run_create(
    training_project_id="my-project",
    name="My Project"
)

if result.errors:
    for error in result.errors:
        print(f"Conflict: {error.kind}")
else:
    print("No conflicts, safe to create")

Parameters

Name
Type
Description
Required
Default
training_project_id
string
Desired project ID to validate.
Required
name
string
Desired project name to validate.
Required

Returns: DryRunResponse


Response types

TrainingProject

from vi.api.resources.training_projects.responses import TrainingProject

Properties

Name
Type
Description
Required
Default
organization_id
string
Organization ID
Optional
training_project_id
string
Unique identifier
Optional
spec
object
Project specification (TrainingProjectSpec)
Optional
status
object
Project status (TrainingProjectStatus)
Optional
metadata
object
Metadata
Optional
self_link
string
API link
Optional
etag
string
Entity tag
Optional

Methods: info() → prints a formatted project summary.


TrainingProjectSpec

from vi.api.resources.training_projects.responses import TrainingProjectSpec

Properties

Name
Type
Description
Required
Default
name
string
Display name
Optional
description
string
Optional description
Optional
type
string
Project type (phrase-grounding, vqa, freeform)
Optional

TrainingProjectStatus

from vi.api.resources.training_projects.responses import TrainingProjectStatus

Properties

Name
Type
Description
Required
Default
runs
array
List of associated run IDs
Optional
flows
array
List of associated flow IDs
Optional
run_outputs
array
List of run output IDs
Optional
tasks
array
List of tasks
Optional

AggregationInsightsResult

from vi.api.resources.training_projects.responses import AggregationInsightsResult

Properties

Name
Type
Description
Required
Default
payload
object
Aggregation data (AggregationInsightsPayload)
Optional
pending_operation
object
Pending operation status (PendingOperation)
Optional

AggregationInsightsPayload

from vi.api.resources.training_projects.responses import AggregationInsightsPayload

Properties

Name
Type
Description
Required
Default
results
object
Aggregation results keyed by run ID
Optional
time_updated
integer
Last update timestamp
Optional

PendingOperation

from vi.api.resources.training_projects.responses import PendingOperation

Properties

Name
Type
Description
Required
Default
status
string
Operation status
Optional
time_initiated
integer
Initiation timestamp
Optional

DryRunResponse

from vi.api.resources.training_projects.responses import DryRunResponse

Properties

Name
Type
Description
Required
Default
errors
array
List of validation errors (DryRunError)
Optional

DryRunError

from vi.api.resources.training_projects.responses import DryRunError

Properties

Name
Type
Description
Required
Default
kind
string
Error kind (IdConflict, NameConflict)
Optional

Related resources

Flows API

Create and manage training workflows within a project.

Runs API

Create, monitor, and manage training runs.

Models API

Download and inspect model checkpoints from completed runs.

Create A Training Project

UI guide for creating training projects in Datature Vi.