Website · 1-minute video · Agents guide · Wiki · Changelog
GPU for Agents
Your agent rents the GPU it needs, on its own. You pay only while it works: we watch every machine and shut down the idle ones.
Ask Claude Code, Codex, Gemini CLI or Cursor to "compare Qwen 7B and Llama 8B on these 50 prompts". The agent finds a GPU under your budget, serves the model with vLLM behind an OpenAI-compatible API, and runs the experiment. A watchdog on the machine shuts it down after idle_timeout (15 minutes by default) with nothing using it, even if the agent forgot, the chat closed or your laptop is asleep.
The agent installs it from one pasted line. A skill and local MCP tools (gpu_offers, gpu_setup, gpu_run, gpu_status, gpu_destroy, ...) cover the whole lifecycle, and the skill tells the agent to show you the price and ask before renting. Budgets, a maximum lifetime and an account-wide sweep catch anything left behind. Apps in any language get the endpoint from gpu --json setup.
Vast.ai is built in. Any other GPU provider takes one adapter file, and your agent can write it: see Use any GPU provider.
Installation
The quickest way works in every agent. Paste this, naming the agent you use:
Set up GPU for Agents for me. I'm using Claude Code. Fetch https://gpu4agents.jambu.ai/install.md with curl and follow its steps.
The agent installs the gpu command (with uv, which brings its own Python), the gpu4agents skill and the gpu MCP tools. It rents nothing.
You can also install the skill the way your agent installs other skills. The skill installs the gpu command the first time it runs.
Claude Code
/plugin marketplace add jambuai/gpu4agents
/plugin install gpu4agents@gpu4agents
On Claude Code 2.1.275 or newer, one line does both: /plugin install gpu4agents --marketplace jambuai/gpu4agents.
Codex
npx skills add jambuai/gpu4agents --global --agent codex
Gemini CLI, Cursor and other agents
npx skills add jambuai/gpu4agents --global --agent '*'
This installs the skill for every agent the Skills CLI supports. Leave off --global to install it only in the current project.
Claude.ai and Claude Desktop
Download gpu4agents-skill.zip and upload it under Settings > Capabilities > Skills.
From a terminal
curl -fsSL https://gpu4agents.jambu.ai/install.sh | sh # uv, Python and gpu, then every agent it finds
uv tool install gpu4agents && gpu agent install -t auto --global # the same, by hand
Connect a GPU provider
Run this in your own terminal, so the agent never sees the key:
gpu login # Vast.ai: paste a key from https://cloud.vast.ai/manage-keys/
gpu login --provider runpod # a provider you added an adapter for
gpu login --check # which account gpu finds, and its balance
gpu login checks the key with the provider, then saves it in ~/.gpu/credentials (mode 600). Keys in the environment or a project .env work too. They never go in gpu.yaml.
Restart the agent and ask for an experiment. See Letting a coding agent rent GPUs.
Run your own code on the GPU
Serving a model is one use. A job is any program: training a LoRA, generating images or audio with an open model, a batch over a dataset, a CUDA benchmark. The agent writes the code in a directory, and gpu uploads it, runs it on the rented machine, streams the log and brings back whatever it wrote to $JAMBU_OUTPUT_DIR. The machine stays up while the job runs and stops by itself after it ends.
gpu init --jobs --min-vram-gb 24 # a machine that runs jobs, no model server
gpu job run -- python train.py --epochs 3 # upload, run, follow, download to gpu-outputs/<job id>/
gpu job status # state, exit code, time, cost
To have the agent write one, paste:
Write this as a GPU for Agents job and run it. Fetch https://gpu4agents.jambu.ai/jobs.md with curl and follow its contract.
JOBS.md has the contract: the directory, gpujob.yaml, the environment a job gets, and the rules its code follows.
Serve any model
Give gpu a Hugging Face model id and it serves it behind the OpenAI API shapes, whatever the model does. It reads the model card: chat and vision-language models run on vLLM; image, voice, transcription, embedding and other pipeline models run on gpu's own server. Any OpenAI client then works unchanged.
gpu init --model stabilityai/sd-turbo # text-to-image -> /v1/images/generations
gpu init --model openai/whisper-large-v3 # speech recognition -> /v1/audio/transcriptions
gpu init --model BAAI/bge-m3 # embeddings -> /v1/embeddings
gpu setup && eval "$(gpu env)" # OPENAI_BASE_URL, OPENAI_API_KEY, JAMBU_MODEL_ID
Requests count as activity, so the machine stays up while clients call it and stops by itself once they stop. Pointing model.id at another model and running gpu setup again swaps the model on the same GPU, with no new rental. When no built-in server can load a model, gpu init --engine custom writes a small server for the agent to fill in, and gpu runs it the same way. SERVING.md has the contract, the routes and the limits.
Use any GPU provider
gpu talks to providers through a small contract: find offers, rent, report status, stop, destroy, and two calls the watchdog makes from the machine to shut itself down. Vast.ai ships with it. For anything else, such as RunPod, Lambda or your company's cluster, paste this into your agent:
Add <provider> to GPU for Agents. Fetch https://gpu4agents.jambu.ai/providers.md with curl and follow its steps.
The agent runs gpu providers new <name>, fills in the adapter from the provider's API docs, checks it with gpu validate and gpu offers, and asks you before a test rental. The adapter is one file in your project, selected in gpu.yaml:
gpu_runtime:
provider:
name: runpod
plugin: ./gpu_providers/runpod.py:RunpodProvider
To reuse an adapter across projects, publish it as a package with a gpu4agents.providers entry point. The watchdog, budgets, CLI and MCP tools work the same with every provider. See PROVIDERS.md and Adding a provider.
Quickstart: from a shell or an app
gpu init --model Qwen/Qwen2.5-7B-Instruct
gpu validate
gpu offers # see prices, rent nothing
gpu setup # rent, boot vLLM, wait until the model answers
gpu run python experiment.py # OPENAI_BASE_URL / OPENAI_API_KEY are set for the job
gpu destroy # or walk away: the idle timeout does it
From an application in any language, gpu --json setup prints the endpoint as JSON. See Integrating into an application, with a ready TypeScript client.
Declare the limits
# gpu.yaml (only the gpu_runtime key is read, so other Jambu tools can share the file)
gpu_runtime:
provider: {name: vast}
model_profile: qwythos-9b
lifecycle:
idle_timeout: 15m # the watchdog on the machine stops it
max_lifetime: 6h # a hard ceiling, busy or not
budget:
max_hourly_cost_usd: 0.60 # offers above this are never rented
max_session_cost_usd: 5.00
health:
pull_stall_timeout: 10m # a host whose image pull stalls is replaced
A full example is gpu.example.yaml. gpu ls shows every machine billing in the account, and gpu sweep --install-timer guards every project on the machine and cleans up orphans. See Keeping the account clean.
Docs
- Letting a coding agent rent GPUs (Claude Code, Codex, Gemini CLI, Cursor, Claude Desktop)
- Integrating into an application (any language)
- Running your own code as a job
- Commands, workloads, and agents
- Every config field
- Choosing a model
- How shutdown works
- Adding a provider, and the steps for an agent
Coming from jambu-gpu
The package was called jambu-gpu until 0.4.1. The code, the gpu command, the config file (jambu.yaml then, gpu.yaml now; both load) and the machines are the same:
pipx uninstall jambu-gpu && pipx install gpu4agents
Sweep timers installed by jambu-gpu keep working; gpu sweep --install-timer rewrites them for the new module.
Contributing
Issues and pull requests are welcome. Read CONTRIBUTING.md and the Code of Conduct. Report security issues privately, as described in SECURITY.md.
Author
Created by João Gabriel Lima at Jambu.ai.
License
MIT.
Metadata
Release files for gpu4agents 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gpu4agents-0.9.1.tar.gz | 698.7 kB | Without provenance | Details for gpu4agents-0.9.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gpu4agents-0.9.1-py3-none-any.whl | Python 3 | none | any | Details for gpu4agents-0.9.1-py3-none-any.whl |
Total release size: 895.4 kB
Release files / gpu4agents-0.9.1.tar.gz
| Download URL | gpu4agents-0.9.1.tar.gz |
|---|---|
| Size | 698.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13a1cbdce770c599e77a51dffb0f7d486733086e6e651583030439cb0dccdad5
|
|
BLAKE2b-256 checksum How to use checksums |
c6f1e6879accd1f60076928a82e65408f51d98855b3a394aff1bb77a2ce2c4b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / gpu4agents-0.9.1-py3-none-any.whl
| Download URL | gpu4agents-0.9.1-py3-none-any.whl |
|---|---|
| Size | 196.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03c1833fdcfe3d4b68354fc148cf8a265f4bf6773fee58ddbd757804d405faf0
|
|
BLAKE2b-256 checksum How to use checksums |
18ce6cba552867bd5e0ce50837a1bddd4aa47294700a97690947369c232786b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for gpu4agents 0.9.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.