The Simplismart Python SDK provides programmatic access to manage model repositories, deployments, and secrets.
Installation
Install the SDK using pip:
pip install simplismart-sdk
Authentication
The SDK uses Playground (PG) token authentication. You can obtain your token from the Simplismart Playground interface.
- Open Simplismart Settings → API Key.
- Copy the Playground Token and set it as
SIMPLISMART_PG_TOKEN in your .env file or environment.
Environment Variables
Configure authentication using environment variables:
export SIMPLISMART_PG_TOKEN="your_pg_token_here"
export ORG_ID="your_org_uuid"
export SIMPLISMART_BASE_URL="https://api.app.simplismart.ai" # Optional, default: https://api.app.simplismart.ai
export SIMPLISMART_TIMEOUT="300" # Optional, default: 300 seconds
Client Initialization
Simplismart
import os
from dotenv import load_dotenv
load_dotenv()
from simplismart import Simplismart
# Token and optional settings from env: SIMPLISMART_PG_TOKEN, SIMPLISMART_BASE_URL, SIMPLISMART_TIMEOUT
client = Simplismart(
pg_token=os.getenv("SIMPLISMART_PG_TOKEN"),
base_url=os.getenv("SIMPLISMART_BASE_URL", "https://api.app.simplismart.ai"),
timeout=int(os.getenv("SIMPLISMART_TIMEOUT", "300")),
)
| Parameter | Type | Description |
|---|
pg_token | str | None | Playground token. Falls back to SIMPLISMART_PG_TOKEN env var. |
base_url | str | API base URL. Default: https://api.app.simplismart.ai |
timeout | float | Request timeout in seconds. Default: 300 |
Quickstart Example
The following end-to-end example demonstrates key MLOps operations using the Simplismart SDK, including importing a model from HuggingFace and compiling and optimizaing it, deploying it on Simplismart infrastructure, and performing clean-up. This workflow highlights how Simplismart enables seamless management of the entire MLOps lifecycle programmatically.
Set SIMPLISMART_PG_TOKEN in your .env (see Environment Variables).
import os
from dotenv import load_dotenv
from simplismart import Simplismart, ModelRepoCompileCreate, ModelRepoCompileAvatar, ModelRepoListParams, DeploymentCreate
load_dotenv()
from time import sleep
client = Simplismart()
org_id = os.getenv("ORG_ID")
MODEL_REPO_NAME = "llama-3.2-1b-instruct-SDK"
# model compile
payload = ModelRepoCompileCreate(
name=MODEL_REPO_NAME,
description="llama-model - A model deployed using Simplismart",
avatar=ModelRepoCompileAvatar(
image_url="https://ui-avatars.com/api/?background=f3f3f3&color=000000&name=llama-model"
),
source_type="huggingface",
source_url="meta-llama/Llama-3.2-1B-Instruct",
model_class="LlamaForCausalLM",
accelerator_type="nvidia-h100",
use_simplismart_infrastructure=True,
)
data = client.create_model_repo_private_compile(payload)
print(
f"Model compilation initiated: {data['name']} | "
f"uuid={data['uuid']} | status={data['status']} | source={data['source_url']}"
)
# Fetch the compiled model repo and wait until it's ready
list_params = ModelRepoListParams(org_id=org_id, offset=0, count=1, name=MODEL_REPO_NAME)
model_repo_id = None
prev_status = None
while True:
repos = client.list_model_repos(list_params)
result = repos["results"][0]
model_repo_id = result["uuid"]
status = result["status"]
if status != prev_status:
print(f"Model Repo {model_repo_id}: {status}")
prev_status = status
if status == "SUCCESS":
break
sleep(10)
# create deployment
deployment = client.create_deployment(
DeploymentCreate(
org=org_id,
model_repo=model_repo_id,
gpu_id="nvidia-h100",
name="llama-3.2-1b-instruct-SDK", # should be unique
min_pod_replicas=1,
max_pod_replicas=2,
autoscale_config={"targets": [{"metric": "gpu", "target": 80}]},
)
)
deployment_id = deployment["deployment_id"]
model_endpoint = deployment.get("model_endpoint", "")
print(
f"Deployment created: id={deployment_id} \n Name={deployment.get('name')} \n "
f"Model Endpoint=https://{model_endpoint}"
)
deployment_detail = client.get_model_deployment(
deployment_id=os.getenv("DEPLOYMENT_ID", deployment_id)
)
print(f"Status: {deployment_detail.get('status', 'unknown')}")
health = client.fetch_deployment_health(deployment_id=deployment_id)
health_status = health.get("data", "unknown")
if health.get("messages"):
msg = health["messages"][0].get("message", "")
print(f"Health: {health_status} — {msg}")
else:
print(f"Health: {health_status}")
if health_status == "Healthy":
print("Deployment is ready.")
else:
print("Deployment is still in progress.")
Expected Output
Model compilation initiated: llama-3.2-1b-instruct-SDK | uuid=e079d5f9-9fa9-4664-82ce-0218b7d1c220 | status=PENDING | source=meta-llama/Llama-3.2-1B-Instruct
Model Repo e079d5f9-9fa9-4664-82ce-0218b7d1c220: PENDING
Model Repo e079d5f9-9fa9-4664-82ce-0218b7d1c220: LAUNCHING_RAY_CLUSTER
Model Repo e079d5f9-9fa9-4664-82ce-0218b7d1c220: OPTIMISING
Model Repo e079d5f9-9fa9-4664-82ce-0218b7d1c220: SUCCESS
Deployment created: id=0ee77f95-a49a-4965-9aa9-311fa9318c47
Name=llama-3.2-1b-instruct-SDK
Model Endpoint=https://YOUR-ENDPOINT.HERE
Status: DEPLOYING
Health: Progressing — The deployment is progressing. Please wait for the application to be healthy.
Deployment is still in progress.
Model Repositories
Manage model repositories using the client.model_repos attribute or convenience methods.
list_model_repos
Lists model repositories with optional filtering. Run with SIMPLISMART_PG_TOKEN set as an environment variable (e.g. in .env).
import os
from dotenv import load_dotenv
load_dotenv()
from simplismart import ModelRepoListParams, Simplismart
client = Simplismart()
repos = client.list_model_repos(
ModelRepoListParams(
offset=0,
count=5,
status="SUCCESS",
name="vision", # optional filter
model_type="BYOM", # optional filter
created_by="user@example.com", # optional filter
)
)
print(repos)
Expected output
{
"limit": 5,
"offset": 0,
"count": 10,
"results": [
{
"uuid": "model-repo-uuid",
"name": "whisper-nemo-diarization",
"source_type": "docker_hub",
"source_url": "simplismart/MODEL-NAME:latest",
"is_byom": true,
"accelerator": null,
"runtime_gpus": 1,
"byom": {
"image": "simplismart/MODEL-NAME:latest",
"registry": "simplismart/REGISTRY-NAME",
"tag": "latest"
},
"secrets": {
"source_secret": {
"uuid": "secret-uuid",
"name": "SECRET-NAME"
}
},
"status": "SUCCESS",
"model_type": "byom",
"env": {},
"created_at": "2026-03-02T11:52:16.925151Z",
"updated_at": "2026-03-02T11:52:16.925162Z",
"org_id": "org-uuid",
"healthcheck": {
"path": "/health",
"port": 8000,
"periodSeconds": 10,
"timeoutSeconds": 5,
"initialDelaySeconds": 30
},
"ports": { "http": { "port": 8000 } },
"metrics_path": [],
"deployment_custom_configuration": { "command": [] }
}
]
}
ModelRepoListParams
| Parameter | Type | Description | Options |
|---|
offset | int | Pagination offset (default: 0) | ≥ 0 |
count | int | Page size (default: 5, max: 20) | 0-20 |
model_id | str | None | Filter by specific model repo UUID | - |
name | str | None | Filter by name (contains match) | - |
status | str | None | Filter by status | SUCCESS, FAILED, DELETED, PROGRESSING |
model_type | str | None | Filter by model type | - |
created_by | str | None | Filter by creator email | - |
get_model_repo
Gets a specific model repository by ID. Set MODEL_REPO_ID in env, or use a UUID from list_model_repos.
import os
from dotenv import load_dotenv
load_dotenv()
from simplismart import Simplismart
client = Simplismart()
repo = client.get_model_repo(
model_id=os.getenv("MODEL_REPO_ID", "model-repo-uuid"),
)
print(repo)
Expected output
{
"uuid": "f58265ce-cfc4-4d32-8b4f-848f06c5e181",
"name": "Tp-8-mdhv-llama",
"source_type": "docker_hub",
"source_url": "madhavbohra09/llama-3.2-1b:latest",
"is_byom": true,
"accelerator": null,
"runtime_gpus": 8,
"byom": {
"image": "madhavbohra09/llama-3.2-1b:latest",
"registry": "madhavbohra09/llama-3.2-1b",
"tag": "latest"
},
"secrets": {
"source_secret": {
"uuid": "0b8af8a8-d149-4262-b5b4-804ee6b98311",
"name": "docker creds"
}
},
"status": "SUCCESS",
"model_type": "byom",
"env": {},
"created_at": "2026-03-03T13:14:28.714649Z",
"updated_at": "2026-03-03T13:14:28.714660Z",
"org_id": "0bf00b43-430a-4ca3-a8b3-b13cc8dc6d4f",
"is_public": false,
"healthcheck": {
"path": "/health",
"port": 8000,
"periodSeconds": 10,
"timeoutSeconds": 5,
"initialDelaySeconds": 30
},
"ports": {
"http": {
"port": 8000
}
},
"metrics_path": [],
"deployment_custom_configuration": {
"command": []
}
}
create_model_repo
Bring your own container-based models from Docker Hub, Depot or NVIDIA NGC registry. Use enviroment vars for credentials (e.g. SOURCE_SECRET_ID); do not hardcode secrets.
import os
from dotenv import load_dotenv
load_dotenv()
from simplismart import ModelRepoCreate, Simplismart
client = Simplismart()
repo = client.create_model_repo(
ModelRepoCreate(
name="vision-container-demo",
source_type="docker_hub",
runtime_gpus=1,
source_secret=os.getenv("SOURCE_SECRET_ID"),
registry_path=os.getenv("REGISTRY_PATH", "your-docker-org/your-model"),
docker_tag=os.getenv("DOCKER_TAG", "latest"),
env={"EXAMPLE_KEY": "value"},
healthcheck={"path": "/", "port": 8000},
ports={"http": {"port": 8000}},
metrics_path=["/v1/chat/completions"],
deployment_custom_configuration={"command": ["python", "-m", "server"]},
)
)
ModelRepoCreate
| Parameter | Type | Description | Required |
|---|
name | str | Model repo name (1-255 chars) | Yes |
source_type | str | Registry source type. Options: docker_hub, depot, nvidiadockersecret | Yes |
runtime_gpus | int | Number of GPUs (≥ 0; typically 0 or 1 for BYOM) | Yes |
source_secret | str | None | Secret UUID for registry authentication | Conditional* |
registry_path | str | None | Registry path/repo name (max 255) | Conditional* |
docker_tag | str | None | Image tag (max 255) | Conditional* |
env | dict | None | Environment variables | No |
healthcheck | dict | None | Health check configuration | No |
ports | dict | None | Port mappings | No |
metrics_path | list | None | List of metrics paths | No |
deployment_custom_configuration | dict | list | None | Custom deployment configuration | No |
*Required when source_type is docker_hub, depot, or nvidiadockersecret.
Source Type Options
| Value | Description |
|---|
docker_hub | Docker Hub registry |
depot | Depot registry |
nvidiadockersecret | NVIDIA NGC registry |
Expected output
{'uuid': 'e20dd190-b0ed-4db5-a471-a580696b99bd', 'name': 'TEST-vision-container-demo', 'source_type': 'docker_hub', 'source_url': 'madhavbohra09/llama-3.2-1b:latest', 'is_byom': True, 'accelerator': None, 'runtime_gpus': 1, 'byom': {'image': 'madhavbohra09/llama-3.2-1b:latest', 'registry': 'madhavbohra09/llama-3.2-1b', 'tag': 'latest'}, 'secrets': {'source_secret': {'uuid': '0b8af8a8-d149-4262-b5b4-804ee6b98311', 'name': 'docker creds'}}, 'status': 'SUCCESS', 'model_type': 'byom', 'env': {'EXAMPLE_KEY': 'value'}, 'created_at': '2026-03-03T15:34:50.901581Z', 'updated_at': '2026-03-03T15:34:50.901592Z', 'org_id': '0bf00b43-430a-4ca3-a8b3-b13cc8dc6d4f', 'is_public': False, 'healthcheck': {'path': '/', 'port': 8000, 'initialDelaySeconds': 30, 'periodSeconds': 10, 'timeoutSeconds': 5}, 'ports': {'http': {'port': 8000}}, 'metrics_path': [], 'deployment_custom_configuration': {'command': []}}
create_model_repo_private_compile
Creates a private compile model repository: the platform compiles the model from a source (e.g. Hugging Face) using your model config, optimisation config, and pipeline config.
import json
from simplismart import (
ModelRepoCompileAvatar,
ModelRepoCompileCreate,
Simplismart,
)
client = Simplismart()
# Load configs (e.g. from examples/private-compile-sample/)
def load_json_file(path):
with open(path, "r") as f:
return json.load(f)
repo = client.create_model_repo_private_compile(
ModelRepoCompileCreate(
name="my-llama-repo",
description="Llama model - private compile",
avatar=ModelRepoCompileAvatar(
image_url="https://ui-avatars.com/api/?name=llama"
),
source_type="huggingface",
source_url="meta-llama/Llama-3.2-1B-Instruct",
model_class="LlamaForCausalLM",
accelerator_type="nvidia-h100",
accelerator_count=0,
cloud_account="your-cloud-account-uuid",
model_config_data=load_json_file("model_config.json"),
optimisation_config=load_json_file("optimisation_config.json"),
pipeline_config=load_json_file("pipeline_config.json"),
)
)
ModelRepoCompileCreate
| Parameter | Type | Description | Required |
|---|
name | str | Model repo name | Yes |
avatar | ModelRepoCompileAvatar | Avatar (image URL and optional colors); see below | Yes |
source_type | str | Source type, e.g. huggingface | Yes |
source_url | str | Source path/URL (e.g. HF repo id) | Yes |
mode | str | Compilation mode (default: public_hf). e.g. public_hf, private_hf, aws, gcp, public_url, simplismart | Yes |
model_class | str | Model class (e.g. LlamaForCausalLM) | Yes |
accelerator_type | str | Accelerator type (e.g. nvidia-h100) | Yes |
org_id | str | None | Organization UUID (alias: org); optional if inferred from token | No |
accelerator_count | int | None | Accelerator count (default: 0) | No |
cloud_account | str | None | Cloud account UUID | No |
source_secret | str | None | Secret UUID for source access | No |
lora_secret | str | None | LoRA secret UUID | No |
model_config_data | dict | None | Model config JSON (alias: model_config); see below | No |
optimisation_config | dict | None | Optimisation config JSON (see below) | No |
pipeline_config | dict | None | Pipeline config JSON (see below) | No |
env | dict | None | Environment variables | No |
output_metadata | dict | None | Output metadata | No |
additional_details | dict | None | Additional details | No |
tags | dict | None | Tags object | No |
tasks | list | None | List of tasks | No |
model_family | str | None | Model family | No |
description | str | None | Description | No |
short_description | str | None | Short description | No |
dropdown_description | str | None | Dropdown description | No |
processing_mode | str | None | One of: SYNC, ASYNC, REALTIME_ASYNC | No |
machine_type | str | None | Machine type | No |
region | str | None | Region | No |
resource_group | str | None | Resource group | No |
use_simplismart_infrastructure | bool | None | Use Simplismart infrastructure | No |
ModelRepoCompileAvatar
| Parameter | Type | Description | Required |
|---|
image_url | str | Avatar image URL | Yes |
font_color | str | None | Avatar font color | No |
background_color | str | None | Avatar background color | No |
To understand what each of these parameters mean, check out this guide on model optimisation
Config files (private compile)
Example configs are in the SDK repo under examples/private-compile-sample/:
model_config.json — Model architecture and tokenizer options (e.g. architectures, hidden_size, max_position_embeddings, torch_dtype). Must match the model you are compiling.
Example (Llama-style):
{
"architectures": ["LlamaForCausalLM"],
"hidden_size": 2048,
"intermediate_size": 8192,
"max_position_embeddings": 131072,
"model_type": "llama",
"num_attention_heads": 32,
"num_hidden_layers": 16,
"num_key_value_heads": 8,
"torch_dtype": "bfloat16",
"vocab_size": 128256
}
optimisation_config.json — Backend, warmups, and optimisations (e.g. quantization, tensor_parallel_size, optimisations.dit_optimisation, backend).
Example
{
"model_type": "llm",
"quantization": "float16",
"tensor_parallel_size": 1,
"warmups": { "enabled": true, "iterations": 5, "sample_input_data": [] },
"backend": { "name": "auto", "version": "latest" },
"optimisations": {
"dit_optimisation": {
"enabled": true,
"attention_backend": { "type": "auto" },
"compilation": { "enabled": false, "mode": "auto", "fullgraph": true, "dynamic": true }
}
}
}
pipeline_config.json — Pipeline type and options (e.g. type, loras, quantized_model_path, enable_model_caching, mode).
{
"type": "llm",
"loras": [],
"lora_repo": { "type": "", "path": "", "ownership": "", "secret": { "type": "" } },
"quantized_model_path": { "type": "", "path": "", "ownership": "", "secret": { "type": "" } },
"extra_params": {},
"enable_model_caching": true,
"mode": "chat"
}
delete_model_repo
Deletes a model repository.
result = client.delete_model_repo(model_id=os.getenv("MODEL_REPO_ID", "model-repo-uuid"))
# Returns: True on success
Deployments
Manage deployments using the client.deployments attribute or convenience methods.
create_deployment
Creates a deployment for a model repo.
Use env for model repo UUID and organization ID (e.g. ORG_ID); do not hardcode secrets.
import os
from dotenv import load_dotenv
load_dotenv()
from simplismart import DeploymentCreate, Simplismart
client = Simplismart()
deployment = client.create_deployment(
DeploymentCreate(
model_repo=os.getenv("MODEL_REPO_ID", "model-repo-uuid"),
org=os.getenv("ORG_ID"),
gpu_id="nvidia-h100",
name="vision-private-deploy",
min_pod_replicas=1,
max_pod_replicas=2,
autoscale_config={"targets": [{"metric": "gpu", "target": 80}]},
env_variables={"KEY": "value"},
healthcheck={"path": "/", "port": 8000},
ports={"http": {"port": 8000}},
metrics_path=["/v1/chat/completions"],
fast_scaleup=True,
deployment_tag="v1.0",
)
)
DeploymentCreate
| Parameter | Type | Description | Required |
|---|
model_repo | str | Model repository UUID | Yes |
org | str | Organization UUID (org_id) | Yes |
gpu_id | str | GPU type identifier. Examples: nvidia-h100, nvidia-a10, nvidia-l4 | Yes |
name | str | Deployment name (3-60 chars) | Yes |
min_pod_replicas | int | Minimum pod replicas (≥ 1) | Yes |
max_pod_replicas | int | Maximum pod replicas (≥ 1) | Yes |
autoscale_config | AutoscaleConfig | Autoscaling configuration | Yes |
env_variables | dict | None | Environment variables | No |
deployment_custom_configuration | dict | None | Custom deployment config | No |
healthcheck | dict | None | Health check configuration | No |
ports | dict | None | Port mappings | No |
metrics_path | list | None | Metrics paths | No |
persistent_volume_claims | dict | list | None | PVC configurations | No |
fast_scaleup | bool | None | Enable fast scale up | No |
deployment_tag | str | None | Deployment tag label | No |
AutoscaleConfig
autoscale_config = {
"targets": [
{
"metric": "gpu", # Required
"target": 80, # Required (number)
"percentile": 95 # Optional, only for latency metric
}
]
}
| Metric Option | Description |
|---|
concurrency | Number of concurrent requests |
cpu | CPU utilization percentage |
gpu | GPU utilization percentage |
gram | GPU memory utilization |
latency | Request latency (supports percentiles 50, 75, 90, 95) |
ram | RAM utilization |
throughput | Requests per second |
The percentile field is only supported when metric is set to latency.
list_deployments
Lists deployments with optional filtering.
import os
from dotenv import load_dotenv
load_dotenv()
from simplismart import Simplismart
client = Simplismart()
deployments = client.list_deployments(
model_repo_id=os.getenv("MODEL_REPO_ID"), # Optional
status="DEPLOYED",
offset=0,
count=20,
)
print(deployments)
Expected output — list of deployment summary objects:
[
{
"deployment_id": "deployment-uuid",
"deployment_name": "speechbrain-v3",
"model_repo_id": "model-repo-uuid",
"model_repo_name": "speechbrain",
"model_type": "unknown",
"accelerator_type": ["nvidia-l40s"],
"accelerator_count": 1,
"status": "DEPLOYED"
}
]
Deployment Status Options
| Value | Description |
|---|
DEPLOYED | Deployment is running |
PENDING | Deployment is being created |
FAILED | Deployment failed |
STOPPED | Deployment is stopped |
DELETED | Deployment has been deleted |
list_model_deployments
Lists all model deployments for an organization.
deployments = client.list_model_deployments(org_id="org-uuid")
get_model_deployment
Gets deployment details by ID. Set DEPLOYMENT_ID in env or use an id from list_deployments.
deployment = client.get_model_deployment(deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"))
print(deployment)
Expected output — deployment object with uuid, name, status, model_repo, org, autoscale_config, healthcheck, ports, min_pod_replicas, max_pod_replicas, etc.
get_deployment
Get deployment details by ID.
deployment = client.get_deployment(deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"))
update_deployment
Updates deployment configuration.
updated = client.update_deployment(
deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"),
payload={
"min_pod_replicas": 1,
"max_pod_replicas": 2,
"autoscale_config": {"targets": [{"metric": "gpu", "target": 80}]},
},
)
stop_deployment
Stops a running deployment.
result = client.stop_deployment(deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"))
start_deployment
Starts a stopped deployment.
result = client.start_deployment(deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"))
restart_deployment
Restarts a deployment.
result = client.restart_deployment(
deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"),
)
fetch_deployment_health
Gets deployment health status.
health = client.fetch_deployment_health(deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"))
print(health)
Expected output
{
"data": "Healthy",
"messages": [
{
"message": "Ready to use, the model is running and available for inference.",
"severity": "info"
}
],
"pods": { "ready": 1, "not_ready": 0 }
}
update_deployment_autoscaling
Updates deployment autoscaling configuration.
result = client.update_deployment_autoscaling(
deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"),
min_replicas=1,
max_replicas=3,
)
delete_deployment
Deletes a deployment.
result = client.delete_deployment(
deployment_id=os.getenv("DEPLOYMENT_ID", "deployment-uuid"),
)
Secrets
Manage Docker registry credentials and other secrets.
create_secret
Creates a secret for an organization. The data payload depends on secret_type:
secret_type | data payload |
|---|
| docker_hub | {"username": "...", "token": "..."} |
| depot | {"username": "...", "token": "..."} |
| NVIDIA NIM | {"server": "nvcr.io", "username": "$oauthtoken", "password": "..."} |
Use environment variables for credentials; do not hardcode secrets.
import os
from dotenv import load_dotenv
load_dotenv()
from simplismart import SecretCreate, Simplismart
client = Simplismart()
# Docker Hub
secret = client.create_secret(
SecretCreate(
name="registry-secret",
secret_type="docker_hub",
data={
"username": os.getenv("SECRET_DOCKERHUB_USERNAME", "your-username"),
"token": os.getenv("SECRET_DOCKERHUB_TOKEN", "your-token"),
},
)
)
# Depot (same data shape as Docker Hub)
# secret = client.create_secret(
# SecretCreate(name="depot-registry-secret", secret_type="depot", data={...})
# )
# NVIDIA NIM
# secret = client.create_secret(
# SecretCreate(
# name="nvidia-secret",
# secret_type="nvidia_nim",
# data={"server": "nvcr.io", "username": "$oauthtoken", "password": os.getenv("NVIDIA_OAUTH_TOKEN")},
# )
# )
SecretCreate
| Parameter | Type | Description | Required |
|---|
name | str | Secret name (1-255 chars) | Yes |
secret_type | str | Secret type. Options: docker_hub, depot, nvidia_nim | Yes |
data | dict | Secret data; shape depends on secret_type (see table above) | Yes |
list_secrets
Lists secrets for an organization.
secrets = client.list_secrets(org_id="org-uuid")
Expected output — object with data array of secret summaries (no credential values):
{
"data": [
{
"uuid": "secret-uuid",
"name": "registry-secret",
"secret_type": "docker_hub",
"created_at": "2024-09-12T13:01:55.465292Z",
"updated_at": "2024-09-12T13:01:55.465316Z",
"org": "org-uuid"
}
]
}
get_secret
Gets a specific secret by ID. Note: The API may return secret data (e.g. credentials); do not log or expose it.
secret = client.get_secret(secret_id=os.getenv("SECRET_ID", "secret-uuid"))
print(secret)
Expected output — structure only; actual data payload is sensitive and must not be committed or logged:
{
"data": {
"uuid": "secret-uuid",
"name": "registry-secret",
"secret_type": "docker_hub",
"org_id": "org-uuid",
"data": "<redacted — do not log or expose>"
}
}
Error Handling
The SDK raises SimplismartError for all API errors.
from simplismart import Simplismart, SimplismartError
client = Simplismart()
try:
deployment = client.get_deployment(deployment_id="00000000-0000-0000-0000-000000000000")
except SimplismartError as e:
print("Status:", e.status_code)
print("Message:", e)
print("Payload:", e.payload)
Expected output (for invalid or missing deployment):
Caught SimplismartError:
status_code: 404
message: No ModelDeployment matches the given query. (status=404)
payload: {'detail': 'No ModelDeployment matches the given query.'}
SimplismartError Attributes
| Attribute | Type | Description |
|---|
status_code | int | HTTP status code |
payload | dict | Full error response payload |
message | str | Error message from backend |