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()

print(gridweave.endpoint_logs("qwen"))            # or ep.logs() — current tail of the pod's output
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.7

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.7
File Size Uploaded
gridweave_sdk-0.5.7.tar.gz 28.2 kB Details

Built distribution (wheel)

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

Total release size: 59.1 kB

Release files / gridweave_sdk-0.5.7.tar.gz

Download URL gridweave_sdk-0.5.7.tar.gz
Size 28.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8e97a2f8722b6b1b986436695e45e302e8a77fb3c2683284d92837bbfb14fd0b
BLAKE2b-256 checksum
How to use checksums
2b018aa9dd7cb7d7b45937a584a047dd7ada665698fd9930a3e4374b02c69ff0
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 26, 2026.

Transparency log

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

Download URL gridweave_sdk-0.5.7-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e4fcac7089bb24f13a8c298243afd7525de3f85e8085bf0efe8d427c322577d
BLAKE2b-256 checksum
How to use checksums
0de68ee5bdc24c45ea785b82abd004da4589122976de154f2a7a054115739bc8
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 26, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.8

2 release files

This release

0.5.7 This release

2 release files

0.5.6

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