Skip to main content
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.
  1. Open Simplismart SettingsAPI Key.
  2. 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")),
)
ParameterTypeDescription
pg_tokenstr | NonePlayground token. Falls back to SIMPLISMART_PG_TOKEN env var.
base_urlstrAPI base URL. Default: https://api.app.simplismart.ai
timeoutfloatRequest 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

ParameterTypeDescriptionOptions
offsetintPagination offset (default: 0)≥ 0
countintPage size (default: 5, max: 20)0-20
model_idstr | NoneFilter by specific model repo UUID-
namestr | NoneFilter by name (contains match)-
statusstr | NoneFilter by statusSUCCESS, FAILED, DELETED, PROGRESSING
model_typestr | NoneFilter by model type-
created_bystr | NoneFilter 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

ParameterTypeDescriptionRequired
namestrModel repo name (1-255 chars)Yes
source_typestrRegistry source type. Options: docker_hub, depot, nvidiadockersecretYes
runtime_gpusintNumber of GPUs (≥ 0; typically 0 or 1 for BYOM)Yes
source_secretstr | NoneSecret UUID for registry authenticationConditional*
registry_pathstr | NoneRegistry path/repo name (max 255)Conditional*
docker_tagstr | NoneImage tag (max 255)Conditional*
envdict | NoneEnvironment variablesNo
healthcheckdict | NoneHealth check configurationNo
portsdict | NonePort mappingsNo
metrics_pathlist | NoneList of metrics pathsNo
deployment_custom_configurationdict | list | NoneCustom deployment configurationNo
*Required when source_type is docker_hub, depot, or nvidiadockersecret.

Source Type Options

ValueDescription
docker_hubDocker Hub registry
depotDepot registry
nvidiadockersecretNVIDIA 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

ParameterTypeDescriptionRequired
namestrModel repo nameYes
avatarModelRepoCompileAvatarAvatar (image URL and optional colors); see belowYes
source_typestrSource type, e.g. huggingfaceYes
source_urlstrSource path/URL (e.g. HF repo id)Yes
modestrCompilation mode (default: public_hf). e.g. public_hf, private_hf, aws, gcp, public_url, simplismartYes
model_classstrModel class (e.g. LlamaForCausalLM)Yes
accelerator_typestrAccelerator type (e.g. nvidia-h100)Yes
org_idstr | NoneOrganization UUID (alias: org); optional if inferred from tokenNo
accelerator_countint | NoneAccelerator count (default: 0)No
cloud_accountstr | NoneCloud account UUIDNo
source_secretstr | NoneSecret UUID for source accessNo
lora_secretstr | NoneLoRA secret UUIDNo
model_config_datadict | NoneModel config JSON (alias: model_config); see belowNo
optimisation_configdict | NoneOptimisation config JSON (see below)No
pipeline_configdict | NonePipeline config JSON (see below)No
envdict | NoneEnvironment variablesNo
output_metadatadict | NoneOutput metadataNo
additional_detailsdict | NoneAdditional detailsNo
tagsdict | NoneTags objectNo
taskslist | NoneList of tasksNo
model_familystr | NoneModel familyNo
descriptionstr | NoneDescriptionNo
short_descriptionstr | NoneShort descriptionNo
dropdown_descriptionstr | NoneDropdown descriptionNo
processing_modestr | NoneOne of: SYNC, ASYNC, REALTIME_ASYNCNo
machine_typestr | NoneMachine typeNo
regionstr | NoneRegionNo
resource_groupstr | NoneResource groupNo
use_simplismart_infrastructurebool | NoneUse Simplismart infrastructureNo

ModelRepoCompileAvatar

ParameterTypeDescriptionRequired
image_urlstrAvatar image URLYes
font_colorstr | NoneAvatar font colorNo
background_colorstr | NoneAvatar background colorNo
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"
}
For a datailed example, checkout this code snippet in Python: Full example: simplismart-python/examples/private-compile-sample/.

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

ParameterTypeDescriptionRequired
model_repostrModel repository UUIDYes
orgstrOrganization UUID (org_id)Yes
gpu_idstrGPU type identifier. Examples: nvidia-h100, nvidia-a10, nvidia-l4Yes
namestrDeployment name (3-60 chars)Yes
min_pod_replicasintMinimum pod replicas (≥ 1)Yes
max_pod_replicasintMaximum pod replicas (≥ 1)Yes
autoscale_configAutoscaleConfigAutoscaling configurationYes
env_variablesdict | NoneEnvironment variablesNo
deployment_custom_configurationdict | NoneCustom deployment configNo
healthcheckdict | NoneHealth check configurationNo
portsdict | NonePort mappingsNo
metrics_pathlist | NoneMetrics pathsNo
persistent_volume_claimsdict | list | NonePVC configurationsNo
fast_scaleupbool | NoneEnable fast scale upNo
deployment_tagstr | NoneDeployment tag labelNo

AutoscaleConfig

autoscale_config = {
    "targets": [
        {
            "metric": "gpu",      # Required
            "target": 80,          # Required (number)
            "percentile": 95      # Optional, only for latency metric
        }
    ]
}
Metric OptionDescription
concurrencyNumber of concurrent requests
cpuCPU utilization percentage
gpuGPU utilization percentage
gramGPU memory utilization
latencyRequest latency (supports percentiles 50, 75, 90, 95)
ramRAM utilization
throughputRequests 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

ValueDescription
DEPLOYEDDeployment is running
PENDINGDeployment is being created
FAILEDDeployment failed
STOPPEDDeployment is stopped
DELETEDDeployment 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_typedata 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

ParameterTypeDescriptionRequired
namestrSecret name (1-255 chars)Yes
secret_typestrSecret type. Options: docker_hub, depot, nvidia_nimYes
datadictSecret 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

AttributeTypeDescription
status_codeintHTTP status code
payloaddictFull error response payload
messagestrError message from backend