Skip to main content

CLI and SDK for JarvisLabs.ai GPU cloud

Project description

jarvislabs

PyPI Python License

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

Beta release. The v0.2 rewrite is in pre-release. Install with --pre to get it.

Installation

As a CLI tool (recommended)

uv tool install --pre jarvislabs

To upgrade:

uv tool upgrade --pre jarvislabs

As a library

pip install --pre jarvislabs

Or with uv:

uv pip install --pre jarvislabs

Requires Python 3.11+.

Authentication

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

jl login

Or set an environment variable:

export JL_API_KEY="your_api_key"

CLI Quick Start

# See available GPUs and pricing
jl gpus

# Create an instance
jl instance create --gpu A100 --name "my-instance"

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

# SSH into it
jl instance ssh <machine_id>

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

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

# Destroy when no longer needed
jl instance destroy <machine_id>

Managed Runs

Run scripts on GPU instances without manual setup. Code is uploaded, a virtual environment is created, and logs are tracked automatically.

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

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

# Pass script arguments
jl run train.py --gpu RTX5000 -- --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 instance list            # List all instances
jl instance exec <id> -- nvidia-smi   # Run a command remotely
jl instance upload <id> ./data        # Upload files
jl instance 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 instance 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.0b7.tar.gz (34.2 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.0b7-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file jarvislabs-0.2.0b7.tar.gz.

File metadata

  • Download URL: jarvislabs-0.2.0b7.tar.gz
  • Upload date:
  • Size: 34.2 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.0b7.tar.gz
Algorithm Hash digest
SHA256 77eca86e56b2cd34cdb86276b306f4a7feaf51b7d301a7a4f17e2c4e7a41bd12
MD5 0511f99a63322061539253d6ee74b5be
BLAKE2b-256 33f0bb7057b0b815cc06240a0b842e0a2ee6ac936932bb03bcfc7ad1d2d813c7

See more details on using hashes here.

File details

Details for the file jarvislabs-0.2.0b7-py3-none-any.whl.

File metadata

  • Download URL: jarvislabs-0.2.0b7-py3-none-any.whl
  • Upload date:
  • Size: 40.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.0b7-py3-none-any.whl
Algorithm Hash digest
SHA256 3fa9595e324c9d6f8f84236e924909ec86ea6f50d992373d883b360ba9f2ee22
MD5 1988a7994d280a6cedca052a93b90043
BLAKE2b-256 40ed6c8a77ddf510dd12eeb582a7b409912d9d32dab1e4a125112969b4147f5e

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