Deployments
The Datature Vi SDK exposes model serving through three related resources:
A DeploymentProject groups related serving instances; each Deployment runs under one; DeploymentEndpoint records expose them externally.
- Vi SDK installed with authentication configured
- A trained model to serve
- Familiarity with deployment concepts
To serve a model on your own machine instead, use the SDK's local inference server or an NVIDIA NIM container.
Deployments
list()
List deployments in the current workspace.
deployments = client.deployments.list()
for dep in deployments.items:
print(dep["deploymentId"], dep.get("spec", {}).get("status"))for dep in client.deployments:
print(dep.get("deploymentId"), dep.get("spec", {}).get("status"))Returns: PaginatedResponse[dict]
get()
Fetch a single deployment by ID.
deployment = client.deployments.get("dep_abc123")
print(deployment)Returns: dict
get_statistics()
Fetch live runtime statistics for a single deployment.
stats = client.deployments.get_statistics("dep_abc123")
print(stats)Returns: dict
batch_get_statistics()
Fetch statistics for many deployments in one call. Cheaper than looping over get_statistics().
stats = client.deployments.batch_get_statistics(["dep_abc123", "dep_def456"])
print(stats)ids = [d["deploymentId"] for d in client.deployments]
stats = client.deployments.batch_get_statistics(ids)Returns: dict
update()
Update a deployment in place using partial PATCH semantics.
client.deployments.update(
deployment_id="dep_abc123",
body={"metadata": {"attributes": {"owner": "platform-team"}}},
)Returns: dict
replace()
Fully replace a deployment document.
client.deployments.replace(
deployment_id="dep_abc123",
body={"spec": {"status": "Paused"}},
)Returns: dict
delete()
Delete a deployment.
client.deployments.delete("dep_abc123")Returns: DeletedResource
Deployment projects
list()
List deployment projects.
for proj in client.deployment_projects:
print(proj["deploymentProjectId"])Returns: PaginatedResponse[dict]
get()
Fetch a single deployment project.
project = client.deployment_projects.get("dep_proj_123")
print(project)Returns: dict
get_knowledge_base()
Fetch the knowledge base bundled with a deployment project, used by retrieval-style deployments.
kb = client.deployment_projects.get_knowledge_base("dp_abc")
print(kb["spec"]["sources"])Returns: dict
update() / replace() / delete()
# Partial update
client.deployment_projects.update("dp_abc", {"metadata": {"attributes": {"env": "prod"}}})
# Full replace
client.deployment_projects.replace("dp_abc", {"spec": {"name": "Production"}})
# Delete
client.deployment_projects.delete("dp_abc")Returns: dict for update() and replace(), DeletedResource for delete().
Deployment endpoints
list()
List deployment endpoints in the workspace.
for endpoint in client.deployment_endpoints:
print(endpoint["deploymentEndpointId"])Returns: PaginatedResponse[dict]
get() / update() / replace() / delete()
# Fetch
endpoint = client.deployment_endpoints.get("dep_ep_123")
# Partial update
client.deployment_endpoints.update("dep_ep_123", {"metadata": {"attributes": {"tier": "public"}}})
# Full replace
client.deployment_endpoints.replace("dep_ep_123", {"spec": {"name": "public-api"}})
# Delete
client.deployment_endpoints.delete("dep_ep_123")Returns: dict for get(), update(), and replace(), DeletedResource for delete().
Response format
All three resources return plain dictionaries mirroring the platform's documents.
Related resources
Updated 1 day ago
