Skip to main content

gridweave-sdk

One Python API for a heterogeneous GPU cluster — mix NVIDIA and AMD, size GPUs by the gigabyte, run fractional or multi-GPU, and deploy models you can charge others to call. Works from a script, a notebook, or the REPL.

Install

pip install gridweave-sdk          # Python 3.12
pip install -U gridweave-sdk       # upgrade

Python 3.12 required — functions are shipped to the workers with cloudpickle, which won't unpickle across versions.

import gridweave
gridweave.auth("YOUR_TOKEN", platform_url="https://platform.gridweave.io")
gridweave.resources()     # nodes, vendors, and free VRAM

Run anything, on exactly the hardware you want

Decorate a function, run() it — it executes on a worker, streams its stdout back, and returns what it returned. vram is how you ask for GPUs:

@gridweave.remote()                # no vram → CPU
def hello(name):
    return f"hi {name}"

@gridweave.remote(vram="4GB")      # a GPU with ≥4 GB free
def matmul():
    import torch
    x = torch.randn(4096, 4096, device="cuda")
    return (x @ x).mean().item()

gridweave.run(matmul)

The cluster is a single pool of mixed hardware, and the same knobs pin any of it:

Arg Effect
vram="24GB" a GPU with ≥24 GB free — omit for CPU; ask for more than one GPU has → multi-GPU (auto CUDA_VISIBLE_DEVICES); two small jobs → share a GPU
vendor="amd" / "nvidia" pin the GPU brand (default: auto)
node="hostname" pin one machine (from resources())
paid=True run on provider hardware (paid credits) vs. the free org pool
@gridweave.remote(vram="16GB", vendor="amd")     # a 16 GB AMD GPU
def on_amd(): ...

@gridweave.remote(vram="100GB")                  # spans several GPUs automatically
def big(): ...

Serve a model — and get paid for it

Deploy a model behind an endpoint. vLLM models get an OpenAI-style chat interface; any HTTP container works via spec=:

ep = gridweave.serve(model="Qwen/Qwen2.5-0.5B", vram="4GB", name="qwen")
ep.chat("Explain quantum computing in one sentence.")

ep = gridweave.serve(spec={"image": "kennethreitz/httpbin", "port": 80,
                           "actions": {"echo": {"method": "POST", "path": "/post"}}},
                     name="httpbin")
ep.call("echo", data={"hello": "cluster"}).json()

gridweave.endpoints(); gridweave.stop("qwen"); gridweave.start("qwen"); gridweave.delete("qwen")

Make it public and paid and you run a tiny inference business: callers pay your price (minus a small platform fee), you pay the GPU rental while it's up, and you keep the spread — on your own hardware you keep both sides.

gridweave.serve(model="Qwen/Qwen2.5-0.5B", vram="4GB", name="qwen-paid",
                paid=True, public=True, price_per_call=0.01)   # or price_per_1m_input/output

Every vLLM endpoint is also on the OpenAI-compatible API (model id {username}/{name}), so Open WebUI, curl, or the OpenAI SDK work with no gridweave install:

curl -H "Authorization: Bearer $TOKEN" \
  -d '{"model":"you/qwen","messages":[{"role":"user","content":"hi"}]}' \
  https://platform.gridweave.io/v1/chat/completions

Distributed training

@gridweave.train(gpus=N) runs your function once per rank with PyTorch Distributed (NCCL/RCCL) already wired up — use Trainer/DDP as normal:

@gridweave.train(gpus=2)
def finetune():
    ...                          # build model + Trainer, then trainer.train()
    import os; return {"rank": int(os.environ.get("RANK", 0))}

gridweave.run(finetune)

Async, parallel, files, audit trail

h = gridweave.submit(matmul)                 # non-blocking
gridweave.status(h); gridweave.get(h)        # poll / block-for-result
gridweave.gather([gridweave.submit(matmul) for _ in range(10)])   # 10 at once

uri = gridweave.upload("data.csv"); gridweave.download(uri, "data.csv")   # cluster S3
gridweave.chain(limit=10)                    # your on-chain audit events
gridweave.chain_rpc("status")                # or verify the ledger yourself — any read-only query

Learn by doing

onboarding.ipynb runs all of it against a live cluster — CPU / GPU / fractional / multi-GPU jobs, GPT-2 fine-tuning, vLLM + gated + S3 + custom-image serving, the OpenAI API, Open WebUI, paid endpoints, and the audit chain. Each cell is independently re-runnable. Get the notebooks: curl -sL https://pub-c48a651bbb2f42988602aa11bb9d9267.r2.dev/tarball/gridweave-sdk.tar.gz | tar xz.

The SDK sends its version on every call; on a major mismatch the call is rejected with an "SDK UPDATE REQUIRED" message and the exact pip install to run.

Metadata

Release files for gridweave-sdk 0.5.6

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

Source distribution (sdist)

Source distribution for gridweave-sdk 0.5.6
File Size Uploaded
gridweave_sdk-0.5.6.tar.gz 25.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gridweave-sdk 0.5.6
File Interpreter ABI Platform
gridweave_sdk-0.5.6-py3-none-any.whl Python 3 none any Details

Total release size: 53.4 kB

Release files / gridweave_sdk-0.5.6.tar.gz

Download URL gridweave_sdk-0.5.6.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d061e6b70b98c81cb2745a3b2f49420cd231560b051f810222458b13013a9adf
BLAKE2b-256 checksum
How to use checksums
fb635be3e9ed1ac498ef9794e3a5b472f91e11234f949df0e25d4ee8e4eb2403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / gridweave_sdk-0.5.6-py3-none-any.whl

Download URL gridweave_sdk-0.5.6-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68f5c099522082cac39869a75fbccd3d8f7a1166cb45788b29795f491b4b8bac
BLAKE2b-256 checksum
How to use checksums
c560e7d3224d150e4aeb644ce22c8e31c9df7cfbce77c8e4acfe963909db0b07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.8

2 release files

0.5.7

2 release files

This release

0.5.6 This release

2 release files

0.5.5

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