Skip to main content

Official Python SDK for the Chassis GPU cloud API by OkeyMeta Ltd

Project description

chassis (Python)

Official Python client for the Chassis public API (/api/v1).

Default base URL: https://chassis.okeymeta.com.ng/api/v1

Install

pip install chassis-cloud

From this monorepo during development:

pip install -e packages/sdk-python

Requires Python 3.10+ and httpx.

from chassis import Chassis

Auth

Create an API key in the Chassis console under API Keys. Keys look like chs_… and are shown once.

from chassis import Chassis

with Chassis(api_key="chs_...") as client:
    ...

Optional local override:

Chassis(api_key="chs_...", base_url="http://localhost:3000/api/v1")

Quickstart

from chassis import Chassis

with Chassis(api_key="chs_...") as client:
    gpus = client.list_gpus()

    instance = client.spin_up(
        gpuSkuId=gpus[0]["id"],
        name="train-01",
        gpuCount=2,  # multi-GPU (1–8, SKU-capped)
        imageName="pytorch/pytorch:2.1.0-cuda11.8-cudnn8-devel",
        containerDiskGb=50,
        cloudType="SECURE",
        ports="8888/http,22/tcp",
    )

    client.restart(instance["id"])
    client.stop(instance["id"])
    client.terminate(instance["id"])

Instance options (create_instance / spin_up)

Field Required Notes
gpuSkuId yes Chassis SKU UUID from list_gpus()
name yes Instance name
gpuCount no Default 1, max 8
imageName no Container image
containerDiskGb no Default 50
volumeGb no Ephemeral volume GB
networkVolumeId no Chassis network volume UUID
registryCredentialId no Chassis registry credential UUID
cloudType no "SECURE" or "COMMUNITY"
ports no e.g. "8888/http,22/tcp"
startAfterCreate no Default True (spin_up forces True)

Methods

GPUs & instances

Method HTTP
list_gpus() GET /gpus
list_instances() GET /instances
create_instance(**kwargs) POST /instances
spin_up(**kwargs) POST /instances (startAfterCreate: true)
get_instance(id) GET /instances/:id
get_instance_logs(id, tail=None) GET /instances/:id/logs
start(id) POST /instances/:id/start
stop(id) POST /instances/:id/stop
restart(id) POST /instances/:id/restart
terminate(id) DELETE /instances/:id

Clusters (multi-node)

Method HTTP
list_clusters() GET /clusters
create_cluster(**kwargs) POST /clusters
get_cluster(id) GET /clusters/:id
start_cluster(id) POST /clusters/:id/start
stop_cluster(id) POST /clusters/:id/stop
terminate_cluster(id) DELETE /clusters/:id

Create with name, gpuSkuId, nodeCount (2–8), and optional gpusPerNode, imageName, networkVolumeId, ports. Nodes get CHASSIS_CLUSTER_ID, CHASSIS_NODE_RANK, and CHASSIS_NODE_COUNT.

Templates, volumes, registries

Method HTTP
list_templates() / create_template(**kwargs) /templates
list_volumes() / create_volume(**kwargs) /volumes
list_registries() / create_registry(**kwargs) /registries

Serverless endpoints

Method HTTP
list_endpoints() GET /endpoints
create_endpoint(**kwargs) POST /endpoints
delete_endpoint(id) DELETE /endpoints/:id
run(endpoint_id, body=None) POST /endpoints/:id/run
run_sync(endpoint_id, body=None, wait_ms=None) POST /endpoints/:id/runsync

Serverless example:

endpoints = client.list_endpoints()
result = client.run_sync(
    endpoints[0]["id"],
    body={"input": {"prompt": "hello"}},
)
health = client.get_endpoint_health(endpoints[0]["id"])

Create options also accept env, interruptible, and publicIp.

Errors raise ChassisError with .status, .body, and a short Chassis-safe message — never infrastructure or vendor details. Responses use Chassis public shapes only (data / error).

Docs

Human setup guide: https://chassis.okeymeta.com.ng/docs

License

MIT · OkeyMeta Ltd

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chassis_cloud-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chassis_cloud-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file chassis_cloud-0.1.0.tar.gz.

File metadata

  • Download URL: chassis_cloud-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for chassis_cloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88fb87129e8993235bfbc2946ebabb7c66f31850367cb886e467a2ba895b0567
MD5 4c1468336fb3643227e8a7f39f4c27d6
BLAKE2b-256 85f3031017532c60e39ffed749bc9a26fac7d11c335aa2a68827bf9f48312e42

See more details on using hashes here.

File details

Details for the file chassis_cloud-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chassis_cloud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for chassis_cloud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5aff7d681d55ae7ea8bee48f54b179ea67f2afc15c8128e37d90ca70da3d31f6
MD5 bb473b15c478bc0348c0532b8d04b758
BLAKE2b-256 664dcda002068026687aee56ccad1df553b8f7a929a0e2210454f7f2973381da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page