Skip to main content

CLI and SDK for JarvisLabs.ai GPU cloud

Project description

jarvislabs

Python License

CLI and Python SDK for managing GPU instances on JarvisLabs.ai.

See the docs on Jarvislabs Docs

Installation

As a CLI tool (recommended)

uv tool install jarvislabs

To upgrade:

uv tool upgrade jarvislabs

As a library

pip install jarvislabs

Or with uv:

uv pip install jarvislabs

Requires Python 3.10+.

Authentication

Get your API key at jarvislabs.ai/settings/api-keys.

jl setup

Or set an environment variable:

export JL_API_KEY="your_api_key"

CLI Quick Start

# See available GPUs and pricing
jl gpus

# Create a container instance (pre-configured with PyTorch, Jupyter, IDE)
jl create --gpu A100 --name "my-instance"

# Create a VM instance (bare-metal SSH access)
jl create --gpu A100-80GB --vm --name "my-vm"

# Create an instance and expose a custom HTTP port
jl create --gpu L4 --http-ports 7860

# SSH into it
jl ssh <machine_id>

# Pause when done (stops compute billing, data persists)
jl pause <machine_id>

# Resume later — optionally with different hardware
jl resume <machine_id> --gpu H100

# Destroy when no longer needed
jl destroy <machine_id>

Managed Runs

Run scripts on GPU instances without manual setup. Code is uploaded, a virtual environment is created (with template packages like torch visible by default), and logs are tracked automatically.

For humans, the default mode stays attached to the run, streams logs, and can auto-pause or auto-destroy the instance after the run finishes. For agents, --json is meant for detached workflows and returns immediately, so use --keep and have the agent pause or destroy the instance after the run.

# Run a training script on a fresh GPU (instance auto-pauses when done)
jl run train.py --gpu L4

# Start a long-running web app on a fresh GPU and expose port 8000
jl run app.py --gpu L4 --http-ports 8000 --keep --no-follow

# Pass script arguments
jl run train.py --gpu L4 -- --epochs 50 --lr 0.001

# Sync a project directory and run a script inside it
jl run . --script train.py --gpu A100 --requirements requirements.txt

# Run on an existing instance
jl run train.py --on <machine_id>

# Check on a run
jl run logs <run_id> --follow
jl run status <run_id>
jl run stop <run_id>

More Commands

jl status                   # Account info and balance
jl templates                # Available framework templates
jl list            # List all instances
jl exec <id> -- nvidia-smi   # Run a command remotely
jl upload <id> ./data        # Upload files
jl download <id> /home/results.csv  # Download files
jl ssh-key add ~/.ssh/id_ed25519.pub --name "my-key"
jl scripts add ./setup.sh --name "install-deps"
jl filesystem create --name "datasets" --storage 200
jl get <id>                  # Shows Jupyter + exposed port URLs

Every command supports --help, --json (machine-readable output), and --yes (skip confirmations).

Python SDK

from jarvislabs import Client

with Client() as client:
    # Create a GPU instance (blocks until running)
    inst = client.instances.create(gpu_type="A100", name="my-run")
    print(f"SSH: {inst.ssh_command}")
    print(f"URL: {inst.url}")

    # When done
    client.instances.pause(inst.machine_id)
from jarvislabs import Client

with Client() as client:
    # List and filter instances
    running = [i for i in client.instances.list() if i.status == "Running"]

    # Check GPU availability and pricing
    for gpu in client.account.gpu_availability():
        print(f"{gpu.gpu_type}: {gpu.num_free_devices} free, ${gpu.price_per_hour}/hr")

    # Manage filesystems
    fs_id = client.filesystems.create(fs_name="data", storage=100)

    # Manage startup scripts
    client.scripts.add(script="#!/bin/bash\npip install wandb", name="setup")

Development

uv pip install -e ".[dev]"
uv run ruff format . && uv run ruff check --fix .
uv run pytest

License

MIT

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

jarvislabs-0.2.15.tar.gz (55.6 kB view details)

Uploaded Source

Built Distribution

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

jarvislabs-0.2.15-py3-none-any.whl (63.2 kB view details)

Uploaded Python 3

File details

Details for the file jarvislabs-0.2.15.tar.gz.

File metadata

  • Download URL: jarvislabs-0.2.15.tar.gz
  • Upload date:
  • Size: 55.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jarvislabs-0.2.15.tar.gz
Algorithm Hash digest
SHA256 c0685fa2d1caa1ea9bd3b4488139ff40c5e08e1c03a8743c98194aa53ae86338
MD5 f5cfae3ad869e5c1334c83b8d6856c42
BLAKE2b-256 62cb96585d8099e1691f543feda34b449023c6ce6fa6673f54910f2226767aea

See more details on using hashes here.

File details

Details for the file jarvislabs-0.2.15-py3-none-any.whl.

File metadata

  • Download URL: jarvislabs-0.2.15-py3-none-any.whl
  • Upload date:
  • Size: 63.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jarvislabs-0.2.15-py3-none-any.whl
Algorithm Hash digest
SHA256 5fc532cb3dec79d8d04884cc81d895e15aed53e2521485f9aaa54bf2a47521bf
MD5 a22bc1b556092e1ad84a9837daf18c32
BLAKE2b-256 fe7b6e7ded8e3fe9a66f4d4e3540fdde8ae8dad236f1e70f39364934efb4b111

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