5 · Install the SDK & run your first job¶
Python 3.12 required — your functions are shipped to the workers with cloudpickle, which won't unpickle across versions.
Install¶
python3.12 -m venv .venv && source .venv/bin/activate
pip install gridweave-sdk jupyterlab
# The onboarding notebooks:
curl -sL https://pub-c48a651bbb2f42988602aa11bb9d9267.r2.dev/tarball/gridweave-sdk.tar.gz | tar xz
jupyter lab gridweave-sdk/onboarding.ipynb
# Colab / an existing 3.12 env, and upgrades:
pip install -U gridweave-sdk
Authenticate and run¶
Get an access token, and your platform URL (https://platform.… after
HTTPS, else http://<MASTER_IP>:8100):
- Onboarded by an admin? Use the token returned at
onboarding — the Create Token form (and the
/v1/auth/onboardcall) hand it back once. - Signed up yourself? Signup gives a browser session, not an SDK token —
mint one under Settings → Access Tokens (a long-lived
gw_…token) and use that.
import gridweave
gridweave.auth("YOUR_TOKEN", platform_url="https://platform.example.com")
gridweave.resources() # nodes, vendors, and free VRAM
@gridweave.remote(vram="4GB") # no vram → CPU; vram → a GPU with ≥4 GB free
def matmul():
import torch
x = torch.randn(4096, 4096, device="cuda")
return (x @ x).mean().item()
matmul.run()
Going further¶
- Full SDK reference — client_sdk/README.md: fractional/multi-GPU,
train(),serve()(vLLM + custom images),gather(), storage. onboarding.ipynb(in the tarball) — walks every capability end to end.- LLM-ready docs — your deployment serves its own docs at
https://app.…/docs, with a downloadablellms.txt: paste it into an LLM and ask it to build a notebook for your workload.
Next: 6 · Update the cluster — ship new versions without losing state.