Skip to main content

GPU for Agents: your agent rents the GPU it needs, on its own. You pay only while it works.

PyPI Python versions CI MIT license

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 jambu.yaml.

Restart the agent and ask for an experiment. See Letting a coding agent rent GPUs.

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 jambu.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

# jambu.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 jambu.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

Coming from jambu-gpu

The package was called jambu-gpu until 0.4.1. The code, the gpu command, jambu.yaml 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.

Jambu.ai, Applied Intelligence Lab

Metadata

Release files for gpu4agents 0.7.0

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

Source distribution (sdist)

Source distribution for gpu4agents 0.7.0
File Size Uploaded Provenance Actions
gpu4agents-0.7.0.tar.gz 642.3 kB Without provenance Details for gpu4agents-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpu4agents 0.7.0
File Interpreter ABI Platform Actions
gpu4agents-0.7.0-py3-none-any.whl Python 3 none any Details for gpu4agents-0.7.0-py3-none-any.whl

Total release size: 795.0 kB

Release files / gpu4agents-0.7.0.tar.gz

Download URL gpu4agents-0.7.0.tar.gz
Size 642.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f7433d89b9ec98830f72b71c802b5ec8fa2b66181e6aba70d57d1f59469468d4
BLAKE2b-256 checksum
How to use checksums
ddafae8564d2b3bf968d962b8e7afd4e8506308940459aaada963fbd32bef97f
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.7.0-py3-none-any.whl

Download URL gpu4agents-0.7.0-py3-none-any.whl
Size 152.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
378ad274c859d5bd11c8e4574bf8433277d47d35f6de5597a7e0efbcfd307c57
BLAKE2b-256 checksum
How to use checksums
5a528915c17c34f54fa267c982e5c0034c5d400d84244b755f595695aa4630cb
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.7.0

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.

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