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, Cursor or any MCP client to "compare Qwen 7B and Llama 8B on these 50 prompts". The agent finds a GPU under your budget, serves the model behind an OpenAI-compatible API with vLLM, and runs the experiment. A watchdog runs on the machine itself, so when nothing uses it for idle_timeout (15 minutes by default) it shuts down, even if the agent forgot, the chat closed or your laptop is asleep.

  • Self-service GPUs for agents. Claude Code, Codex, Gemini CLI and Cursor install it themselves from one pasted line. A skill and local MCP tools (gpu_offers, gpu_setup, gpu_run, gpu_status, gpu_destroy, ...) give the agent the whole lifecycle. The skill tells it to show you the price and ask before renting.
  • Billing that ends when the work does. Idle timeout, maximum lifetime, hourly and session budgets, and a sweep that cleans up anything left behind.
  • Any app, any language. gpu --json setup returns base_url, api_key and model for any OpenAI SDK.

Vast.ai is the first provider; another provider is a new adapter, and the lifecycle rule stays the same.

Quickstart: let your agent install it

Paste this into Claude Code, Codex, Gemini CLI or Cursor (say which one 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. Then you connect your GPU account in your own terminal, so the agent never sees the key:

gpu login        # paste your Vast.ai key (https://cloud.vast.ai/manage-keys/) into the hidden prompt

Restart the agent and ask for an experiment. It shows the price and asks before renting anything. See Letting a coding agent rent GPUs.

Prefer a terminal? These do the same:

curl -fsSL https://gpu4agents.jambu.ai/install.sh | sh          # uv + Python + gpu, then every agent it finds
npx skills add jambuai/gpu4agents                              # just the skill; it installs gpu on first use
uv tool install gpu4agents && gpu agent install -t codex --global   # by hand: claude | codex | gemini | cursor | auto

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. As a last line of defense, 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.

gpu login saves the API key in ~/.gpu/credentials (mode 600) after checking it; the environment and a project .env work too. It never goes in the manifest, and the agent never sees it.

Docs

Coming from jambu-gpu

The package was called jambu-gpu until 0.4.1. Same code, same gpu command, same jambu.yaml, same machines:

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.6.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.6.0
File Size Uploaded Provenance Actions
gpu4agents-0.6.0.tar.gz 629.9 kB Without provenance Details for gpu4agents-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 774.1 kB

Release files / gpu4agents-0.6.0.tar.gz

Download URL gpu4agents-0.6.0.tar.gz
Size 629.9 kB
Tags Source
SHA-256 checksum
How to use checksums
31575ae4d41f99798e44ad320ad4d73f6e55aa2c399e60760a94330eea6ff82c
BLAKE2b-256 checksum
How to use checksums
df820ec90749f0bbddf770184fef540654aed83b2095f5023c60aa627020c359
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.6.0-py3-none-any.whl

Download URL gpu4agents-0.6.0-py3-none-any.whl
Size 144.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f8875a392177b3aae820fdf360352eaedc55e3662e01e2b00461dd407606599
BLAKE2b-256 checksum
How to use checksums
22921949fc50d3e74bb54534e98f1cb3722afa9df1762bd3904afd34b288b9c4
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.6.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.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files No provenance

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