JarvisLabs Python SDK
This is the new jarvislabs package, replacing the deprecated jlclient. It includes a modern Python SDK, a full CLI (jl), and built-in support for AI coding agents. If you're still using jlclient, see the migration note.
Python SDK for managing GPU instances on JarvisLabs.ai. Create, pause, resume, and destroy GPU instances programmatically.
Package: jarvislabs | Version: 0.2.x | Python: 3.10+
Linux and macOS are fully supported. Windows is experimental and not fully tested — if you run into issues on Windows, please report them.
Jump to the Examples section to see common SDK workflows like creating instances, attaching filesystems, and checking GPU availability.
Installation
Install with pip or uv:
pip install jarvislabs
Or with uv:
uv pip install jarvislabs
After installation, from jarvislabs import Client is available in Python.
jl setupRun jl setup once after installing from your terminal. It walks you through:
- Saves your API token locally so both the CLI and SDK can use it automatically
- Shows your account status — balance and active instances
- Installs agent skill files — sets up a universal skill at
~/.agents/skills/jarvislabs/SKILL.md(read by Codex, Cursor, OpenCode, Amp, Cline, Gemini CLI, GitHub Copilot, Kimi Code CLI, and Warp) plus an optional Claude Code path at~/.claude/skills/jarvislabs/SKILL.md, so your agent knows how to usejlout of the box
After running jl setup, Client() picks up your token automatically — no need to pass it in code.
Quick Start
Here's the fastest way to get a GPU instance up and running with the SDK — create an instance, grab its connection details, and pause it when you're done:
from jarvislabs import Client
with Client() as client:
# Create a GPU instance (blocks until running)
inst = client.instances.create(gpu_type="A100", name="my-instance")
print(f"SSH: {inst.ssh_command}")
print(f"Notebook: {inst.url}")
# Pause to stop billing (data persists)
client.instances.pause(inst.machine_id)
create() blocks until the instance is fully running, so by the time it returns you can SSH in or open the notebook URL right away. Pausing stops compute billing while keeping your data intact.
Authentication
Get your API token from jarvislabs.ai/settings/api-keys.
The SDK resolves your API token in this order:
| Priority | Method | Description |
|---|---|---|
| 1 | api_key argument | Pass directly to Client(api_key="...") |
| 2 | JL_API_KEY env var | Set in your environment |
| 3 | Config file | Saved by jl setup (~/.config/jl/config.toml on Linux, ~/Library/Application Support/jl/config.toml on macOS) |
If no token is found through any method, Client() raises AuthError.
from jarvislabs import Client
# Option 1: Pass directly
client = Client(api_key="YOUR_TOKEN")
# Option 2: Set JL_API_KEY env var, then:
client = Client()
# Option 3: Run `jl setup` once in the terminal, then:
client = Client()
The easiest setup is to run jl setup once in your terminal. After that, Client() picks up your token automatically — no need to pass it every time.