Skip to main content

Nodus Python SDK

One interface for running AI workloads on GPUs.

Python 3.10+ License: Apache 2.0

Documentation · Parameter reference · Examples · Issues

Provide a container image, a command, and a budget. Nodus finds GPU capacity and runs your workload. Use the same Python client for training, fine-tuning, or a batch of experiments.

1. Install and sign in

git clone https://github.com/nodus-compute/Nodus-sdk-python.git
cd Nodus-sdk-python
python -m pip install -e .
nodus login --base-url https://YOUR_NODUS_API_HOST

This checkout contains version 0.1.2. Until it appears on PyPI, install from source as shown above. After publication, install with python -m pip install --upgrade "nodus_compute>=0.1.2".

Obtain your account access and API address from your Nodus onboarding contact. Replace the placeholder URL with that address. Approve the displayed code in your browser. The CLI saves credentials for subsequent commands and Python clients. Device login requires a deployment with device authorization enabled. API keys also work directly.

Where you run Authentication
Laptop nodus login --base-url https://YOUR_NODUS_API_HOST
Headless server Add --no-browser. Open the displayed URL on another device
CI / production Set both NODUS_API_KEY and NODUS_BASE_URL using your secret manager
Explicit configuration nodus.Client(api_key=key, base_url=url)

Settings resolve individually: explicit arguments → environment → saved login. See authentication for setup and logout.

2. Run your first workload

This GPU smoke test prints the available GPU name. No local script is uploaded. It submits paid compute with a $5 workload budget. Available capacity and account limits still determine admission.

nodus run --compute-class accelerator \
  --image pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime \
  --model GPU-smoke-test --budget 5 --wait \
  -- python -c 'print(__import__("torch").cuda.get_device_name(0))'

Or use Python (nodus_compute is the package name. nodus is the import):

import nodus

with nodus.Client() as client:
    workload = client.run(
        image="pytorch/pytorch:2.6.0-cuda12.4-cudnn9-runtime",
        command=["python", "-c", "import torch\nassert torch.cuda.is_available()\nprint(torch.cuda.get_device_name(0))"],
        compute_class="accelerator",
        model="GPU-smoke-test",
        budget=5,
    )
    print("Workload:", workload.id)
    done = workload.wait()
    print(done.status, done.cost_now_usd)
    if not done.succeeded:
        raise RuntimeError(f"Workload {done.id} ended: {done.status}")

run() returns after acceptance. wait() returns for completed, failed, or cancelled work. Check succeeded. The Python example requests cancellation on Ctrl+C. The CLI does the same while waiting. Resource cleanup happens remotely after the cancellation request. Closing a client alone does not cancel work.

3. Inspect and manage the run

Use the workload ID printed above:

nodus get WORKLOAD_ID
nodus events WORKLOAD_ID --follow
nodus logs WORKLOAD_ID
nodus artifacts WORKLOAD_ID
nodus explain WORKLOAD_ID
nodus ledger WORKLOAD_ID
nodus cancel WORKLOAD_ID

Events show lifecycle progress. Logs are committed artifacts, so they may be unavailable before the first commit. Monitoring and outputs explains how to retrieve results.

Run your own workloads

Goal Guide
Package and run a Python script Containers and scripts
Run a GPU training or fine-tuning command GPU workloads
Submit concurrent experiments Async sweeps
Connect stages and declared outputs Multi-stage workloads
Retry safely in automation CI and idempotency
Look up advanced submission options All parameters

Your script, dependencies, and accessible data must be available inside the image or fetched by your program. The SDK does not upload your working directory. Container images need curl, wget, or python3 for runner bootstrap.

Before submitting

Set a budget, use an image containing your code and dependencies, and keep the returned workload ID. Reuse an idempotency_key when retrying the same submission. Nodus currently supports GPU workloads. CPU-only VM provisioning is not offered.

The first example prints a GPU name in its logs. For downloadable files, declare stage outputs as shown in multi-stage workloads. See troubleshooting if submission or execution fails.

Development

python -m pip install -e '.[dev]'
python -m pytest

See RELEASING.md for release steps. Licensed under Apache-2.0.

Release files for nodus-compute 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nodus-compute 0.1.2
File Size Uploaded
nodus_compute-0.1.2.tar.gz 100.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nodus-compute 0.1.2
File Interpreter ABI Platform
nodus_compute-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 157.6 kB

Release files / nodus_compute-0.1.2.tar.gz

Download URL nodus_compute-0.1.2.tar.gz
Size 100.5 kB
Tags Source
SHA-256 checksum
How to use checksums
58569cc7a2c4bd3d44cd847846d3b87bdfe863303108120cc95a49608ee8e35f
BLAKE2b-256 checksum
How to use checksums
b9a6fd560b582a8a29c3ababea7cf5ca007bd35c79dc385a0b028a84e15b5363
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / nodus_compute-0.1.2-py3-none-any.whl

Download URL nodus_compute-0.1.2-py3-none-any.whl
Size 57.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6fdffc033068b665094a9f5f66150d2f271a5e2693c99515c340f8f0ef2bdcef
BLAKE2b-256 checksum
How to use checksums
2fc7fded46eab27fc14b806a1fe707c3310f0d630e2e4e10f13684c22280f5ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page