gpu4agents 0.8.0__tar.gz → 0.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.claude-plugin/plugin.json +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.cursor-plugin/plugin.json +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.env.example +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.github/ISSUE_TEMPLATE/bug_report.yml +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/CHANGELOG.md +18 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/INSTALL.md +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/JOBS.md +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/PKG-INFO +19 -6
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/PROVIDERS.md +3 -3
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/README.md +18 -5
- gpu4agents-0.9.1/SERVING.md +114 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/ACCEPTANCE.md +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/ADDING_A_PROVIDER.md +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/AGENTS.md +3 -3
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/CHOOSING_A_MODEL.md +8 -8
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/CONFIG.md +16 -11
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/INTEGRATION.md +6 -6
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/LIFECYCLE.md +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/USAGE.md +9 -9
- gpu4agents-0.8.0/examples/jambu.yaml → gpu4agents-0.9.1/examples/gpu.yaml +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/mastra-agent/README.md +4 -4
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/typescript-client/README.md +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/typescript-client/src/gpu.ts +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/typescript-client/src/index.ts +1 -1
- gpu4agents-0.8.0/jambu.example.yaml → gpu4agents-0.9.1/gpu.example.yaml +3 -3
- gpu4agents-0.8.0/jambu.models.yaml → gpu4agents-0.9.1/gpu.models.yaml +4 -4
- gpu4agents-0.8.0/jambu.yaml → gpu4agents-0.9.1/gpu.yaml +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/__init__.py +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/agent/mcp.py +53 -18
- {gpu4agents-0.8.0/skills/gpu4agents → gpu4agents-0.9.1/gpu4agents/agent/skill}/SKILL.md +17 -7
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/account.py +6 -6
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/inspect.py +9 -9
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/main.py +3 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/providers.py +4 -4
- gpu4agents-0.9.1/gpu4agents/cli/setup.py +361 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/validate.py +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/config.py +157 -19
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/credentials.py +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/engine.py +152 -14
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/errors.py +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/model_inspect.py +3 -3
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/state.py +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/registry.py +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/scaffold.py +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/vast/config.py +1 -1
- gpu4agents-0.9.1/gpu4agents/runtime/__init__.py +17 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/runtime/base.py +7 -0
- gpu4agents-0.9.1/gpu4agents/runtime/service.py +197 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/runtime/vllm.py +5 -0
- gpu4agents-0.9.1/gpu4agents/serve/__init__.py +56 -0
- gpu4agents-0.9.1/gpu4agents/serve/hf/__init__.py +0 -0
- gpu4agents-0.9.1/gpu4agents/serve/hf/install.sh +34 -0
- gpu4agents-0.9.1/gpu4agents/serve/hf/server.py +981 -0
- gpu4agents-0.9.1/gpu4agents/serve/template/__init__.py +0 -0
- gpu4agents-0.9.1/gpu4agents/serve/template/gpujob.yaml +5 -0
- gpu4agents-0.9.1/gpu4agents/serve/template/server.py +136 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/watchdog/jobs_ext.py +48 -13
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/install.sh +2 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/pyproject.toml +1 -1
- {gpu4agents-0.8.0/gpu4agents/agent/skill → gpu4agents-0.9.1/skills/gpu4agents}/SKILL.md +17 -7
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/conftest.py +4 -2
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_agent.py +2 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_cli.py +31 -12
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_config.py +46 -28
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_integration.py +112 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_jobs.py +1 -1
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_model_inspect.py +1 -1
- gpu4agents-0.9.1/tests/test_serve.py +565 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_sweep.py +6 -6
- gpu4agents-0.8.0/gpu4agents/cli/setup.py +0 -205
- gpu4agents-0.8.0/gpu4agents/runtime/__init__.py +0 -6
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.claude-plugin/marketplace.json +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.github/dependabot.yml +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.github/pull_request_template.md +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.github/workflows/ci.yml +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.github/workflows/release.yml +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/.gitignore +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/CODE_OF_CONDUCT.md +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/CONTRIBUTING.md +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/LICENSE +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/SECURITY.md +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/assets/banner.png +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/docs/assets/jambu-logo.jpg +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/experiment.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/mastra-agent/package-lock.json +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/mastra-agent/package.json +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/mastra-agent/src/agent.ts +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/mastra-agent/src/index.ts +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/mastra-agent/src/tools/weather-tool.ts +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/mastra-agent/tsconfig.json +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/typescript-client/package-lock.json +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/typescript-client/package.json +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/examples/typescript-client/tsconfig.json +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/__main__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/agent/__init__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/agent/install.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/agent/jobs.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/__init__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/_common.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/agent.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/job.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/lifecycle.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/run.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/status.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/cli/timer.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/__init__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/beacon.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/durations.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/events.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/execution.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/health.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/hosts.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/job.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/models.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/paths.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/policy.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/sweep.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/core/tool_parsers.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/__init__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/base.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/vast/__init__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/vast/client.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/vast/mapper.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/providers/vast/provider.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/watchdog/__init__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/watchdog/agent_body.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/gpu4agents/watchdog/builder.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/jambu_gpu/__init__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/jambu_gpu/__main__.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/skills/gpu4agents/agents/openai.yaml +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/fakes.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_engine.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_engine_sessions.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_paths.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_policy.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_runtime_vllm.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_state.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_vast_mapper.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_vast_provider.py +0 -0
- {gpu4agents-0.8.0 → gpu4agents-0.9.1}/tests/test_watchdog.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gpu4agents",
|
|
3
3
|
"description": "Your agent rents the GPU it needs, serves a model on it and runs the experiment. You pay only while it works.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "João Gabriel Lima",
|
|
7
7
|
"url": "https://www.linkedin.com/in/joaogabriellima"
|
|
@@ -16,7 +16,7 @@ body:
|
|
|
16
16
|
id: repro
|
|
17
17
|
attributes:
|
|
18
18
|
label: How to reproduce
|
|
19
|
-
description: The command or MCP tool call, and the relevant part of `
|
|
19
|
+
description: The command or MCP tool call, and the relevant part of `gpu.yaml`.
|
|
20
20
|
render: shell
|
|
21
21
|
- type: textarea
|
|
22
22
|
id: output
|
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [0.9.1] - 2026-11-04
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- The config file is `gpu.yaml`, and the model catalog is `gpu.models.yaml`. `gpu init` writes `gpu.yaml`, and the docs, the skill and the website use the new names.
|
|
9
|
+
|
|
10
|
+
### Upgrading
|
|
11
|
+
- A project with a `jambu.yaml` or `jambu.models.yaml` keeps working: both names are still read, after the new ones. Renaming the file is enough to move over. In a directory that has a `jambu.yaml`, `gpu init` stops and asks you to rename it, or writes a `gpu.yaml` beside it with `--force`.
|
|
12
|
+
|
|
13
|
+
## [0.9.0] - 2026-11-04
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **Serve any Hugging Face model.** `gpu init --model <repo>` reads the Hugging Face model card and picks the server: chat and vision-language models stay on vLLM; every other task runs on gpu's own OpenAI-compatible server (`runtime.engine: hf`): `/v1/embeddings`, `/v1/images/generations`, `/v1/audio/transcriptions` and `/translations`, `/v1/audio/speech`, and `/v1/pipeline` for any other transformers pipeline. `model.task` records which; `--engine` and `--task` override the card, and `runtime.packages` adds pip packages a model needs.
|
|
17
|
+
- `runtime.engine: custom`: a model server the agent writes. `gpu init --engine custom` scaffolds `server/server.py` and `server/gpujob.yaml`; gpu uploads and runs it like the built-in one. [`SERVING.md`](SERVING.md), served at `gpu4agents.jambu.ai/serving.md`, is the contract.
|
|
18
|
+
- Both run as *service jobs* on the job runner: deployed after boot, so changing the model or the server's code and running `gpu setup` swaps the server on the same machine instead of renting a new one. `gpu redeploy` restarts it.
|
|
19
|
+
- Requests to these servers count as activity through their `/metrics`, so a machine in use stays up and an unused one stops after `idle_timeout`. A server that dies while loading ends `gpu setup` with its log, and `gpu logs` shows it.
|
|
20
|
+
- `gpu env --format json`, `gpu setup --json` and the MCP connection now include `engine`, `task` and `routes`. `gpu_init` takes `engine` and `task` and reports what it chose.
|
|
21
|
+
- `GPU_NO_MODEL_CARD=1` makes `gpu init` skip reading the model card (offline).
|
|
22
|
+
|
|
5
23
|
## [0.8.0] - 2026-11-04
|
|
6
24
|
|
|
7
25
|
### Added
|
|
@@ -20,7 +20,7 @@ curl -fsSL https://raw.githubusercontent.com/jambuai/gpu4agents/main/install.sh
|
|
|
20
20
|
|
|
21
21
|
The script needs only `curl` (Linux or macOS; on Windows, run it inside WSL). It installs [uv](https://docs.astral.sh/uv/) if missing, uses it to install the `gpu4agents` package with a Python it downloads by itself, and then installs the skill and registers the `gpu` MCP server for your runtime. It does not ask for or read any key.
|
|
22
22
|
|
|
23
|
-
Check: `~/.local/bin/gpu --version` prints 0.
|
|
23
|
+
Check: `~/.local/bin/gpu --version` prints 0.9.1 or later. Use `~/.local/bin/gpu` for the rest of this session if plain `gpu` is not found.
|
|
24
24
|
|
|
25
25
|
## 2. Connect a GPU provider account
|
|
26
26
|
|
|
@@ -4,7 +4,7 @@ You are a coding agent and the work needs a GPU: training or fine-tuning, an ima
|
|
|
4
4
|
|
|
5
5
|
## 1. The machine
|
|
6
6
|
|
|
7
|
-
The job runs on the project's machine, described by `
|
|
7
|
+
The job runs on the project's machine, described by `gpu.yaml`. For a machine that only runs jobs:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
gpu init --jobs --min-vram-gb 24 # runtime.engine: none, image pytorch/pytorch:2.8.0-cuda12.8-cudnn9-runtime
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gpu4agents
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.1
|
|
4
4
|
Summary: GPU for Agents: your coding agent rents the GPU it needs, on its own. You pay only while it works.
|
|
5
5
|
Project-URL: Homepage, https://gpu4agents.jambu.ai
|
|
6
6
|
Project-URL: Documentation, https://github.com/jambuai/gpu4agents/tree/main/docs
|
|
@@ -127,7 +127,7 @@ gpu login --provider runpod # a provider you added an adapter for
|
|
|
127
127
|
gpu login --check # which account gpu finds, and its balance
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
`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 `
|
|
130
|
+
`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`.
|
|
131
131
|
|
|
132
132
|
Restart the agent and ask for an experiment. See [Letting a coding agent rent GPUs](docs/AGENTS.md).
|
|
133
133
|
|
|
@@ -149,6 +149,19 @@ Write this as a GPU for Agents job and run it. Fetch https://gpu4agents.jambu.ai
|
|
|
149
149
|
|
|
150
150
|
[JOBS.md](JOBS.md) has the contract: the directory, `gpujob.yaml`, the environment a job gets, and the rules its code follows.
|
|
151
151
|
|
|
152
|
+
## Serve any model
|
|
153
|
+
|
|
154
|
+
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.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
gpu init --model stabilityai/sd-turbo # text-to-image -> /v1/images/generations
|
|
158
|
+
gpu init --model openai/whisper-large-v3 # speech recognition -> /v1/audio/transcriptions
|
|
159
|
+
gpu init --model BAAI/bge-m3 # embeddings -> /v1/embeddings
|
|
160
|
+
gpu setup && eval "$(gpu env)" # OPENAI_BASE_URL, OPENAI_API_KEY, JAMBU_MODEL_ID
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
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](SERVING.md) has the contract, the routes and the limits.
|
|
164
|
+
|
|
152
165
|
## Use any GPU provider
|
|
153
166
|
|
|
154
167
|
`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:
|
|
@@ -157,7 +170,7 @@ Write this as a GPU for Agents job and run it. Fetch https://gpu4agents.jambu.ai
|
|
|
157
170
|
Add <provider> to GPU for Agents. Fetch https://gpu4agents.jambu.ai/providers.md with curl and follow its steps.
|
|
158
171
|
```
|
|
159
172
|
|
|
160
|
-
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 `
|
|
173
|
+
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`:
|
|
161
174
|
|
|
162
175
|
```yaml
|
|
163
176
|
gpu_runtime:
|
|
@@ -184,7 +197,7 @@ From an application in any language, `gpu --json setup` prints the endpoint as J
|
|
|
184
197
|
## Declare the limits
|
|
185
198
|
|
|
186
199
|
```yaml
|
|
187
|
-
#
|
|
200
|
+
# gpu.yaml (only the gpu_runtime key is read, so other Jambu tools can share the file)
|
|
188
201
|
gpu_runtime:
|
|
189
202
|
provider: {name: vast}
|
|
190
203
|
model_profile: qwythos-9b
|
|
@@ -198,7 +211,7 @@ gpu_runtime:
|
|
|
198
211
|
pull_stall_timeout: 10m # a host whose image pull stalls is replaced
|
|
199
212
|
```
|
|
200
213
|
|
|
201
|
-
A full example is [`
|
|
214
|
+
A full example is [`gpu.example.yaml`](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/USAGE.md#keeping-the-account-clean).
|
|
202
215
|
|
|
203
216
|
## Docs
|
|
204
217
|
|
|
@@ -213,7 +226,7 @@ A full example is [`jambu.example.yaml`](jambu.example.yaml). `gpu ls` shows eve
|
|
|
213
226
|
|
|
214
227
|
## Coming from `jambu-gpu`
|
|
215
228
|
|
|
216
|
-
The package was called `jambu-gpu` until 0.4.1. The code, the `gpu` command, `jambu.yaml` and the machines are the same:
|
|
229
|
+
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:
|
|
217
230
|
|
|
218
231
|
```bash
|
|
219
232
|
pipx uninstall jambu-gpu && pipx install gpu4agents
|
|
@@ -12,10 +12,10 @@ Follow these steps in the user's project directory. Do not rent anything until s
|
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
gpu providers new <name> --display-name "<Provider name>"
|
|
15
|
-
gpu init --provider <name> --model <org/model> # skip if
|
|
15
|
+
gpu init --provider <name> --model <org/model> # skip if gpu.yaml exists
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
The first command writes `gpu_providers/<name>.py`. The second writes a `
|
|
18
|
+
The first command writes `gpu_providers/<name>.py`. The second writes a `gpu.yaml` that selects it:
|
|
19
19
|
|
|
20
20
|
```yaml
|
|
21
21
|
gpu_runtime:
|
|
@@ -24,7 +24,7 @@ gpu_runtime:
|
|
|
24
24
|
plugin: ./gpu_providers/<name>.py:<Name>Provider
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
In an existing `
|
|
27
|
+
In an existing `gpu.yaml`, add those two lines under `gpu_runtime.provider` yourself.
|
|
28
28
|
|
|
29
29
|
## 3. Read the provider's API docs, then fill in the file
|
|
30
30
|
|
|
@@ -86,7 +86,7 @@ gpu login --provider runpod # a provider you added an adapter for
|
|
|
86
86
|
gpu login --check # which account gpu finds, and its balance
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
`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 `
|
|
89
|
+
`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`.
|
|
90
90
|
|
|
91
91
|
Restart the agent and ask for an experiment. See [Letting a coding agent rent GPUs](docs/AGENTS.md).
|
|
92
92
|
|
|
@@ -108,6 +108,19 @@ Write this as a GPU for Agents job and run it. Fetch https://gpu4agents.jambu.ai
|
|
|
108
108
|
|
|
109
109
|
[JOBS.md](JOBS.md) has the contract: the directory, `gpujob.yaml`, the environment a job gets, and the rules its code follows.
|
|
110
110
|
|
|
111
|
+
## Serve any model
|
|
112
|
+
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
gpu init --model stabilityai/sd-turbo # text-to-image -> /v1/images/generations
|
|
117
|
+
gpu init --model openai/whisper-large-v3 # speech recognition -> /v1/audio/transcriptions
|
|
118
|
+
gpu init --model BAAI/bge-m3 # embeddings -> /v1/embeddings
|
|
119
|
+
gpu setup && eval "$(gpu env)" # OPENAI_BASE_URL, OPENAI_API_KEY, JAMBU_MODEL_ID
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
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](SERVING.md) has the contract, the routes and the limits.
|
|
123
|
+
|
|
111
124
|
## Use any GPU provider
|
|
112
125
|
|
|
113
126
|
`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:
|
|
@@ -116,7 +129,7 @@ Write this as a GPU for Agents job and run it. Fetch https://gpu4agents.jambu.ai
|
|
|
116
129
|
Add <provider> to GPU for Agents. Fetch https://gpu4agents.jambu.ai/providers.md with curl and follow its steps.
|
|
117
130
|
```
|
|
118
131
|
|
|
119
|
-
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 `
|
|
132
|
+
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`:
|
|
120
133
|
|
|
121
134
|
```yaml
|
|
122
135
|
gpu_runtime:
|
|
@@ -143,7 +156,7 @@ From an application in any language, `gpu --json setup` prints the endpoint as J
|
|
|
143
156
|
## Declare the limits
|
|
144
157
|
|
|
145
158
|
```yaml
|
|
146
|
-
#
|
|
159
|
+
# gpu.yaml (only the gpu_runtime key is read, so other Jambu tools can share the file)
|
|
147
160
|
gpu_runtime:
|
|
148
161
|
provider: {name: vast}
|
|
149
162
|
model_profile: qwythos-9b
|
|
@@ -157,7 +170,7 @@ gpu_runtime:
|
|
|
157
170
|
pull_stall_timeout: 10m # a host whose image pull stalls is replaced
|
|
158
171
|
```
|
|
159
172
|
|
|
160
|
-
A full example is [`
|
|
173
|
+
A full example is [`gpu.example.yaml`](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/USAGE.md#keeping-the-account-clean).
|
|
161
174
|
|
|
162
175
|
## Docs
|
|
163
176
|
|
|
@@ -172,7 +185,7 @@ A full example is [`jambu.example.yaml`](jambu.example.yaml). `gpu ls` shows eve
|
|
|
172
185
|
|
|
173
186
|
## Coming from `jambu-gpu`
|
|
174
187
|
|
|
175
|
-
The package was called `jambu-gpu` until 0.4.1. The code, the `gpu` command, `jambu.yaml` and the machines are the same:
|
|
188
|
+
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:
|
|
176
189
|
|
|
177
190
|
```bash
|
|
178
191
|
pipx uninstall jambu-gpu && pipx install gpu4agents
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Serve any model behind an OpenAI-compatible API (instructions for the agent)
|
|
2
|
+
|
|
3
|
+
You are a coding agent and the work needs a model that is not a chat model, or a chat model on your own terms: an image generator, a voice, a transcriber, an embedding model, a detector, an open model with its own policy. GPU for Agents (`gpu`) rents the GPU, serves the model there behind the OpenAI API shapes, and stops the machine once nobody calls it. This page is the contract. Follow it exactly.
|
|
4
|
+
|
|
5
|
+
## 1. Choosing the model and its server
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gpu init --model stabilityai/sd-turbo # reads the model card, writes gpu.yaml
|
|
9
|
+
gpu offers # prices; ask the user before renting
|
|
10
|
+
gpu setup # rents, deploys, waits until the model answers
|
|
11
|
+
eval "$(gpu env)" # OPENAI_BASE_URL, OPENAI_API_KEY, JAMBU_MODEL_ID
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`gpu init` reads the model's Hugging Face card (`pipeline_tag`, `library_name`) and writes one of three engines:
|
|
15
|
+
|
|
16
|
+
| The model | `runtime.engine` | `model.task` | Routes |
|
|
17
|
+
|---|---|---|---|
|
|
18
|
+
| chat, vision-language (`text-generation`, `image-text-to-text`) | `vllm` | chat | `/v1/chat/completions`, `/v1/completions`, `/v1/responses` |
|
|
19
|
+
| embeddings (`feature-extraction`, `sentence-similarity`) | `hf` | `embeddings` | `/v1/embeddings` |
|
|
20
|
+
| images (`text-to-image`, diffusers) | `hf` | `image` | `/v1/images/generations` |
|
|
21
|
+
| transcription (`automatic-speech-recognition`) | `hf` | `transcription` | `/v1/audio/transcriptions`, `/v1/audio/translations` |
|
|
22
|
+
| voice (`text-to-speech`, `text-to-audio`) | `hf` | `speech` | `/v1/audio/speech` |
|
|
23
|
+
| any other pipeline (detection, classification, translation, depth, ...) | `hf` | `pipeline` | `/v1/pipeline` |
|
|
24
|
+
| a model the above cannot load | `custom` | (yours) | (yours, section 4) |
|
|
25
|
+
|
|
26
|
+
Flags win over the card: `--engine hf --task speech`, `--min-vram-gb 24`. A chat model vLLM cannot run can go on `hf` with `--task chat`. `GET /v1/models` on the endpoint lists the model, its task and its routes.
|
|
27
|
+
|
|
28
|
+
`engine: hf` runs gpu's own server (`gpu4agents/serve/hf/server.py`) on `pytorch/pytorch:2.8.0-cuda12.8-cudnn9-runtime`. It installs `transformers`, `diffusers`, `sentence-transformers` or `soundfile` as the task needs, then loads the model. When the model card asks for more packages, list them, pinned:
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
gpu_runtime:
|
|
32
|
+
model:
|
|
33
|
+
id: org/model
|
|
34
|
+
task: speech
|
|
35
|
+
runtime:
|
|
36
|
+
engine: hf
|
|
37
|
+
packages: ["phonemizer==3.3.0"]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 2. Call it with any OpenAI client
|
|
41
|
+
|
|
42
|
+
The base URL and key come from `gpu env` (or `gpu_connection` over MCP). The key is per machine.
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
import base64
|
|
46
|
+
from openai import OpenAI
|
|
47
|
+
client = OpenAI() # reads OPENAI_BASE_URL and OPENAI_API_KEY
|
|
48
|
+
model = "stabilityai/sd-turbo" # JAMBU_MODEL_ID
|
|
49
|
+
|
|
50
|
+
# image
|
|
51
|
+
img = client.images.generate(model=model, prompt="a red fox, watercolor", size="512x512",
|
|
52
|
+
extra_body={"num_inference_steps": 2, "guidance_scale": 0.0, "seed": 7})
|
|
53
|
+
open("fox.png", "wb").write(base64.b64decode(img.data[0].b64_json))
|
|
54
|
+
|
|
55
|
+
# voice (WAV; mp3, flac and opus when the machine's libsndfile can write them)
|
|
56
|
+
client.audio.speech.create(model=model, voice="default", input="Hello.", response_format="wav").write_to_file("hi.wav")
|
|
57
|
+
|
|
58
|
+
# transcription (wav, flac, ogg, mp3); response_format json, text, srt, vtt, verbose_json
|
|
59
|
+
text = client.audio.transcriptions.create(model=model, file=open("hi.wav", "rb")).text
|
|
60
|
+
|
|
61
|
+
# embeddings (float or base64; the SDK asks for base64 by default)
|
|
62
|
+
vectors = client.embeddings.create(model=model, input=["first", "second"]).data
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Any other pipeline task takes JSON, with images and audio as base64 data URLs, and returns the pipeline's output as JSON (images inside it come back as base64 PNG):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
curl -s "$OPENAI_BASE_URL/pipeline" -H "Authorization: Bearer $OPENAI_API_KEY" \
|
|
69
|
+
-d '{"inputs": "data:image/jpeg;base64,...", "parameters": {"threshold": 0.9}}'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Image extras go in the body (`extra_body` in the SDK): `num_inference_steps`, `guidance_scale`, `negative_prompt`, `seed`, `output_format` (png, jpeg, webp). `response_format: "url"` returns a data URL, since nothing is hosted.
|
|
73
|
+
|
|
74
|
+
## 3. Lifecycle
|
|
75
|
+
|
|
76
|
+
- Requests are activity. The server counts them on `/metrics` and the watchdog reads that, so the machine stays up while clients call it and stops by itself after `lifecycle.idle_timeout` (15 min) once they stop. `max_lifetime` and the session budget still apply.
|
|
77
|
+
- Changing the model keeps the machine. Edit `model.id` or `model.task` (or your server's code) and run `gpu setup`: it stops the running server and starts the new one on the same GPU. `gpu redeploy` restarts it with nothing changed. A bigger `min_vram_gb` does need a new machine (`gpu setup --recreate`).
|
|
78
|
+
- A machine serves one model, and the GPU takes one request at a time; the rest queue. For concurrent chat traffic, use vLLM.
|
|
79
|
+
- `gpu logs` shows the server's log (installs, download, load, tracebacks). A server that dies while loading ends `gpu setup` with its last lines.
|
|
80
|
+
- A stopped machine keeps its disk, weights included: `gpu setup` restarts it and redeploys in about a minute.
|
|
81
|
+
|
|
82
|
+
## 4. Your own server (`runtime.engine: custom`)
|
|
83
|
+
|
|
84
|
+
When no built-in server loads the model (a library of its own, a pipeline of several models, video, a custom API), write the server. gpu runs it on the GPU and treats it exactly like the built-in one.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
gpu init --engine custom --min-vram-gb 24 # writes gpu.yaml and server/ (server.py, gpujob.yaml)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`server/gpujob.yaml` says how to start it:
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
run: python3 server.py
|
|
94
|
+
setup: pip install -r requirements.txt # pinned; torch already comes with the image
|
|
95
|
+
env: {}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The server must:
|
|
99
|
+
|
|
100
|
+
1. Listen on `0.0.0.0:$PORT`.
|
|
101
|
+
2. Answer `GET /health` with 503 until the model is loaded, then 200. `gpu setup` waits for the 200.
|
|
102
|
+
3. Require `Authorization: Bearer $JAMBU_API_KEY` on every route except `/health` and `/metrics`.
|
|
103
|
+
4. Serve `GET /metrics` in Prometheus text with `jambu_requests_running` (a gauge) and `jambu_requests_total` (a counter). Without them, requests do not count as activity and the machine stops after `idle_timeout` even while in use.
|
|
104
|
+
5. Use the OpenAI request and response shapes where one exists, so OpenAI clients work unchanged. Invent a route only for what OpenAI has no shape for.
|
|
105
|
+
6. Exit non-zero when loading fails, after printing why. Never print secrets.
|
|
106
|
+
|
|
107
|
+
The template in `server/server.py` already does 1 to 4; write `load()` and the handlers. It also gets `JAMBU_MODEL_ID` (the config's `model.id`, if any), `HF_HOME` (a cache on the machine's disk) and `HF_TOKEN` when the project has one. The same exclusions as jobs apply to the upload (`.git`, virtualenvs, `.env` files, ...), and the 2 GB limit: download weights in `load()`, do not ship them.
|
|
108
|
+
|
|
109
|
+
## 5. Rules
|
|
110
|
+
|
|
111
|
+
1. Renting costs money: show `gpu offers` and get the user's yes before `gpu setup`.
|
|
112
|
+
2. Size `--min-vram-gb` from the weights: bf16 needs about 2 GB per billion parameters, plus room for activations (a 12B image model wants 32 GB or more; `gpu init` sizes it from the card when it can).
|
|
113
|
+
3. Use models for what their licenses and the user's purpose allow. Open models with other policies are for legitimate work the user owns: research, evaluation, red-teaming their own systems, creative work.
|
|
114
|
+
4. When the work is done, tell the user what ran, the endpoint, the cost (`gpu status`), and offer `gpu stop` or `gpu destroy`.
|
|
@@ -6,7 +6,7 @@ Eighteen guarantees, mapped to the code and the test that holds each one.
|
|
|
6
6
|
| --- | --- | --- | --- |
|
|
7
7
|
| 1 | Repeated `setup` does not duplicate infrastructure | `core/engine.py::Engine.setup` reconciles first, compares `config.fingerprint()`, and holds an exclusive `.gpu/runtime.lock` | `test_engine.py::test_setup_twice_does_not_create_two_instances`, `::test_setup_refuses_to_reuse_an_incompatible_instance` |
|
|
8
8
|
| 2 | Provider APIs do not leak into core orchestration | `providers/base.py` contract; all Vast wire format confined to `providers/vast/{client,mapper}.py` | `test_engine.py::test_the_core_never_branches_on_a_provider_name` (greps `core/`) |
|
|
9
|
-
| 3 | Missing credentials fail before provisioning | `VastProvider.validate` returns before any API call; `CredentialResolver` never reads
|
|
9
|
+
| 3 | Missing credentials fail before provisioning | `VastProvider.validate` returns before any API call; `CredentialResolver` never reads gpu.yaml | `test_vast_provider.py::test_validate_fails_before_provisioning_without_a_key` (asserts zero HTTP calls) |
|
|
10
10
|
| 4 | Failed provisioning cleans up | `Engine.setup` persists state *before* the long wait, then destroys on failure when `cleanup_on_setup_failure` | `test_engine.py::test_failed_setup_cleans_up_partially_created_resources` |
|
|
11
11
|
| 5 | Active workloads are never stopped by the idle guard | `core/policy.py::evaluate` returns `workload_active` before any idle check | `test_policy.py::test_active_workload_is_never_stopped_by_the_idle_guard`, `test_watchdog.py::test_a_heartbeating_workload_is_never_stopped` |
|
|
12
12
|
| 6 | An idle unlocked instance stops within `idle_timeout + watchdog_interval` | remote watchdog loop, `watchdog/agent_body.py::guard_loop` | `test_watchdog.py::test_idle_instance_is_stopped_with_a_recorded_reason` (real subprocess) |
|
|
@@ -77,7 +77,7 @@ The first attempt found problems the unit tests had missed. Each is fixed and te
|
|
|
77
77
|
|
|
78
78
|
## The MVP command surface
|
|
79
79
|
|
|
80
|
-
`
|
|
80
|
+
`gpu.yaml` schema, CLI, provider contract, provider registry, Vast.ai adapter,
|
|
81
81
|
vLLM runtime, `setup`, `run`, `status`, `stop`, `destroy`, `lock`/`unlock`, idle
|
|
82
82
|
timeout, max lifetime, remote watchdog and structured logs are all present. On top
|
|
83
83
|
of that, `ls` and `sweep` handle orphan control across the account.
|
|
@@ -8,13 +8,13 @@ An adapter reaches `gpu` in one of three ways:
|
|
|
8
8
|
|
|
9
9
|
| Where it lives | How `gpu` finds it | Use it for |
|
|
10
10
|
| --- | --- | --- |
|
|
11
|
-
| A file in the project | `provider.plugin: ./gpu_providers/acme.py:AcmeProvider` in
|
|
11
|
+
| A file in the project | `provider.plugin: ./gpu_providers/acme.py:AcmeProvider` in gpu.yaml | one project, or an agent writing an adapter on the spot |
|
|
12
12
|
| An installed package | an entry point in the `gpu4agents.providers` group | sharing an adapter across projects or publishing it |
|
|
13
13
|
| This repository | `providers/<name>/` plus a line in `providers/registry.py` | a provider that ships with gpu4agents |
|
|
14
14
|
|
|
15
15
|
`gpu providers new acme` writes the skeleton for the first route, with every
|
|
16
16
|
method that needs the provider's API marked. `gpu init --provider acme` writes a
|
|
17
|
-
|
|
17
|
+
gpu.yaml that selects it. Agents can follow [PROVIDERS.md](../PROVIDERS.md),
|
|
18
18
|
which walks through the same steps.
|
|
19
19
|
|
|
20
20
|
An installed package declares its adapter like this:
|
|
@@ -40,7 +40,7 @@ gpu login --check # exit 0, the provider and where the key was found
|
|
|
40
40
|
echo "$KEY" | gpu login --stdin
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
The provider is the one `--provider` names, else the project's `
|
|
43
|
+
The provider is the one `--provider` names, else the project's `gpu.yaml`, else `GPU_PROVIDER`, else Vast.ai. `gpu login --provider NAME` also saves `GPU_PROVIDER=NAME`, so `gpu ls` and `gpu sweep` outside a project use that provider. The key goes to `~/.gpu/credentials` (mode 600, directory 700); other lines in the file are kept. A key in the environment or a project `.env` still works and wins over the file. The skill tells the agent never to ask for the key in chat, read those files, or print it.
|
|
44
44
|
|
|
45
45
|
## Install by hand
|
|
46
46
|
|
|
@@ -69,7 +69,7 @@ Another agent that reads `SKILL.md` files: `gpu agent skill > path/to/skills/gpu
|
|
|
69
69
|
|
|
70
70
|
| Tool | Does | Costs money |
|
|
71
71
|
| --- | --- | --- |
|
|
72
|
-
| `gpu_init` | write `
|
|
72
|
+
| `gpu_init` | write `gpu.yaml` for a model, with an optional price cap and VRAM | no |
|
|
73
73
|
| `gpu_validate` | check the config and credentials | no |
|
|
74
74
|
| `gpu_offers` | cheapest matching machines and their price | no |
|
|
75
75
|
| `gpu_setup` | rent / restart and wait for the model; returns `base_url`, `api_key`, `model` | yes |
|
|
@@ -90,5 +90,5 @@ Each tool runs the `gpu` CLI with `--json` in the project directory, so errors c
|
|
|
90
90
|
|
|
91
91
|
- The skill tells the agent to show the price and ask before renting, wait out a slow setup instead of starting over, never touch the provider key, and offer stop or destroy (and check `gpu_ls`) when done.
|
|
92
92
|
- The server's tool annotations mark `gpu_destroy` destructive and the read-only tools read-only, so a client can let `gpu_status` run freely and ask for every `gpu_setup` and `gpu_destroy`. In Claude Code that is the `permissions` list in `.claude/settings.json`, e.g. `"allow": ["mcp__gpu__gpu_status", "mcp__gpu__gpu_offers", "mcp__gpu__gpu_ls"]`.
|
|
93
|
-
- `
|
|
93
|
+
- `gpu.yaml` holds the hard limits the agent cannot exceed without editing the file: `budget.max_hourly_cost_usd`, `budget.max_session_cost_usd`, `lifecycle.max_lifetime`.
|
|
94
94
|
- The watchdog stops the machine after `idle_timeout` whatever the agent does, and `gpu sweep --install-timer` catches anything left behind.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Where
|
|
1
|
+
# Where gpu.yaml's model-specific values come from
|
|
2
2
|
|
|
3
3
|
Every value in `model:`/`compute.gpu:`/`runtime:` that depends on the model
|
|
4
4
|
you deploy (VRAM, dtype, context length, tool-call parser, `trust_remote_code`)
|
|
@@ -38,7 +38,7 @@ gpu_runtime:
|
|
|
38
38
|
tool_calling: auto # resolves to hermes automatically
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Paste the snippet under `gpu_runtime:` in your `
|
|
41
|
+
Paste the snippet under `gpu_runtime:` in your `gpu.yaml` and adjust
|
|
42
42
|
`lifecycle`/`health`/`budget` to get a starting config. Add `--json` for
|
|
43
43
|
machine-readable output, `--revision` for a non-`main` branch/tag, and
|
|
44
44
|
`--hf-token-env` if the repo is gated and your token lives under a different
|
|
@@ -110,7 +110,7 @@ Consequences:
|
|
|
110
110
|
`gpu4agents/core/tool_parsers.py` (a one-line PR) so `tool_calling: auto`
|
|
111
111
|
picks it up for everyone next time, the same way the Qwen3.5+ finding did.
|
|
112
112
|
|
|
113
|
-
## Don't write a new
|
|
113
|
+
## Don't write a new gpu.yaml per model - use the catalog
|
|
114
114
|
|
|
115
115
|
For each new model it is tempting to copy the whole file, since the provider,
|
|
116
116
|
lifecycle and budget stay the same and only `model:`/`compute.gpu:` differ.
|
|
@@ -119,11 +119,11 @@ After a few models a repo has `jambu.qwythos.yaml`, `jambu.model-b.yaml`,
|
|
|
119
119
|
wants one. Changing a lifecycle default then means editing all of them.
|
|
120
120
|
|
|
121
121
|
Instead, keep what varies by model in the catalog and what varies by project
|
|
122
|
-
in the active `
|
|
122
|
+
in the active `gpu.yaml`, and reference the catalog entry by name.
|
|
123
123
|
|
|
124
124
|
```yaml
|
|
125
|
-
#
|
|
126
|
-
# repo (found by walking up from a project's
|
|
125
|
+
# gpu.models.yaml - one entry per model, shared by every project in the
|
|
126
|
+
# repo (found by walking up from a project's gpu.yaml, same as gpu.yaml
|
|
127
127
|
# itself is found - one catalog can sit at the repo root and serve every
|
|
128
128
|
# sub-project under it).
|
|
129
129
|
qwythos-9b:
|
|
@@ -137,7 +137,7 @@ qwen3.8-27b-uncensored:
|
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
```yaml
|
|
140
|
-
#
|
|
140
|
+
# gpu.yaml - just this project's policy + which model
|
|
141
141
|
gpu_runtime:
|
|
142
142
|
version: 1
|
|
143
143
|
model_profile: qwythos-9b # the only thing that changes to switch models
|
|
@@ -163,7 +163,7 @@ repo's catalog. Trying a new model is usually a catalog case.
|
|
|
163
163
|
|
|
164
164
|
## Dynamic / un-modeled vLLM flags
|
|
165
165
|
|
|
166
|
-
`
|
|
166
|
+
`gpu.yaml`'s schema models the fields that affect lifecycle, cost, and
|
|
167
167
|
provider portability. It does not try to cover every vLLM flag, since vLLM adds
|
|
168
168
|
flags faster than a fixed contract could track. For everything else, `runtime:`
|
|
169
169
|
has two escape hatches, applied in this order. The later one wins on conflict,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# gpu.yaml reference
|
|
2
2
|
|
|
3
|
-
`
|
|
3
|
+
`gpu.yaml` is the source of truth for the desired state. It describes what should
|
|
4
4
|
run and how long it may live. It must never contain credentials, and it never contains
|
|
5
5
|
provider API details.
|
|
6
6
|
|
|
7
|
-
`
|
|
7
|
+
`gpu.yaml` is a manifest shared across Jambu.ai Lab sub-projects. `gpu` reads only
|
|
8
8
|
its own `gpu_runtime:` top-level key and ignores every other key in the document, so
|
|
9
9
|
other Jambu tools can keep their own config in the same file:
|
|
10
10
|
|
|
11
11
|
```yaml
|
|
12
|
-
#
|
|
12
|
+
# gpu.yaml
|
|
13
13
|
gpu_runtime:
|
|
14
14
|
version: 1
|
|
15
15
|
model: {id: ...}
|
|
@@ -22,11 +22,13 @@ some_other_jambu_tool:
|
|
|
22
22
|
If the file does not need to be shared, `gpu init --flat` writes a `config.yml` where
|
|
23
23
|
the whole document is the gpu-runtime config, with no `gpu_runtime:` wrapper. This
|
|
24
24
|
format is still supported. A bare document with no `gpu_runtime:` key is also accepted
|
|
25
|
-
under the `
|
|
25
|
+
under the `gpu.yaml` filename, for a solo project that prefers that name.
|
|
26
26
|
|
|
27
27
|
Resolution order (first match wins, searched from the working directory upward):
|
|
28
|
-
`--config PATH`, else `
|
|
29
|
-
|
|
28
|
+
`--config PATH`, else `gpu.yaml`, `gpu.yml`, `jambu.yaml`, `jambu.yml`, `config.yml`,
|
|
29
|
+
`config.yaml` in that order. `jambu.yaml` is the name used before 0.9.1; projects that
|
|
30
|
+
still have one keep working, and renaming it to `gpu.yaml` changes nothing else. The same
|
|
31
|
+
goes for `jambu.models.yaml`, now `gpu.models.yaml`. When a directory has both shapes, the shared, namespaced one is preferred over
|
|
30
32
|
the legacy flat one.
|
|
31
33
|
|
|
32
34
|
`${VAR}` references in string values are expanded from the environment.
|
|
@@ -38,8 +40,8 @@ check keys that other tools own elsewhere in the document.
|
|
|
38
40
|
### `model_profile`: share model config across files
|
|
39
41
|
|
|
40
42
|
Set `model_profile: <name>` instead of declaring `model:`/`compute:`/`runtime:`
|
|
41
|
-
directly, and gpu merges in that named entry from `
|
|
42
|
-
searched the same way as `
|
|
43
|
+
directly, and gpu merges in that named entry from `gpu.models.yaml`. The catalog is
|
|
44
|
+
searched the same way as `gpu.yaml` (this directory, then parents), so one catalog
|
|
43
45
|
serves every sub-project in a repo. Fields you declare locally still win over the
|
|
44
46
|
profile's. See
|
|
45
47
|
[`docs/CHOOSING_A_MODEL.md`](CHOOSING_A_MODEL.md#dont-write-a-new-jambuyaml-per-model---use-the-catalog)
|
|
@@ -92,11 +94,12 @@ which source each number comes from.
|
|
|
92
94
|
|
|
93
95
|
| Field | Default | Meaning |
|
|
94
96
|
| --- | --- | --- |
|
|
95
|
-
| `id` | *required* | HuggingFace repo id. |
|
|
97
|
+
| `id` | *required* | HuggingFace repo id. Optional with `runtime.engine: none` or `custom`. |
|
|
96
98
|
| `revision` | – | Pin a commit/branch/tag. |
|
|
97
99
|
| `hf_token_env` | `HF_TOKEN` | Env var holding the HF token for gated models. |
|
|
98
100
|
| `trust_remote_code` | `false` | Pass `--trust-remote-code` to the runtime. |
|
|
99
101
|
| `served_name` | – | Name the model is served under (`--served-model-name`). |
|
|
102
|
+
| `task` | `auto` | With `runtime.engine: hf`: `chat`, `embeddings`, `image`, `transcription`, `speech` or `pipeline`, which picks the OpenAI routes ([SERVING.md](../SERVING.md)). `auto` reads the model card's `pipeline_tag` when the server starts; `gpu init` writes the card's answer. |
|
|
100
103
|
|
|
101
104
|
## `runtime`
|
|
102
105
|
|
|
@@ -104,7 +107,7 @@ How the model runs. Independent from where it runs.
|
|
|
104
107
|
|
|
105
108
|
| Field | Default | Meaning |
|
|
106
109
|
| --- | --- | --- |
|
|
107
|
-
| `engine` | `vllm` | `vllm` or `none` (bare compute, start nothing). |
|
|
110
|
+
| `engine` | `vllm` | `vllm` (chat models), `hf` (any other Hugging Face model, gpu's own OpenAI-compatible server), `custom` (a server you write, in `service_dir`) or `none` (bare compute for jobs, start nothing). `hf` and `custom` are deployed after boot: changing the model or the server code redeploys on the same machine at the next `gpu setup`. See [SERVING.md](../SERVING.md). |
|
|
108
111
|
| `port` | `8000` | Container port the server listens on; published publicly. |
|
|
109
112
|
| `context_length` | `16384` | `--max-model-len`. |
|
|
110
113
|
| `dtype` | `auto` | vLLM dtype. |
|
|
@@ -116,6 +119,8 @@ How the model runs. Independent from where it runs.
|
|
|
116
119
|
| `tool_calling` | `auto` | `auto` guesses `--tool-call-parser` from `model.id` and turns tool calling on if recognized; `on` requires a resolvable parser (fails `validate` otherwise); `off` never passes tool-calling flags. |
|
|
117
120
|
| `tool_call_parser` | – | Explicit vLLM parser name, overrides the guess. See [vLLM's tool calling docs](https://docs.vllm.ai/en/latest/features/tool_calling/) for the current list (`hermes`, `llama3_json`, `llama4_pythonic`, `mistral`, `granite`, `qwen3_xml`, `deepseek_v3`, ...). |
|
|
118
121
|
| `tool_server` | – | MCP server URL (or `demo`). vLLM routes `/v1/responses` tool calls to it and runs them server-side. Leave unset to let the calling agent framework execute tools itself. |
|
|
122
|
+
| `packages` | `[]` | `hf`: extra pip packages the model needs, installed before it loads. Pin them. |
|
|
123
|
+
| `service_dir` | `server` | `custom`: the directory holding your server and its `gpujob.yaml`, relative to the project. |
|
|
119
124
|
|
|
120
125
|
`gpu inspect-model <repo>` also suggests `dtype`, `context_length` and
|
|
121
126
|
`tool_calling` for a given model. See
|
|
@@ -23,11 +23,11 @@ gpu sweep --install-timer # optional safety net, see USAGE.md
|
|
|
23
23
|
Requirements:
|
|
24
24
|
|
|
25
25
|
- `gpu4agents` (or `jambu-gpu` 0.3.0 or later), on Python 3.10+. The app can be in any language.
|
|
26
|
-
- The directory holding `
|
|
26
|
+
- The directory holding `gpu.yaml` must be persistent. `gpu` keeps what it rented in `.gpu/state.json` next to it. In a container, mount it as a volume: a container that loses `.gpu/` forgets its instance, rents a second one, and leaves the first to the watchdog and the sweep.
|
|
27
27
|
- Before 0.3.0 these directories were `.jambu/` and `~/.jambu`. The first command after an upgrade renames them, so an instance already rented is kept and is not rented again.
|
|
28
28
|
- `.gpu/state.json` holds the endpoint key and the watchdog token. It is written `0600`. Add `.gpu/` and `.env` to `.gitignore` and keep them out of images.
|
|
29
29
|
|
|
30
|
-
Tune the lifecycle in `
|
|
30
|
+
Tune the lifecycle in `gpu.yaml` for the app. For a service with bursty traffic, a longer idle timeout avoids paying a restart on every burst:
|
|
31
31
|
|
|
32
32
|
```yaml
|
|
33
33
|
gpu_runtime:
|
|
@@ -45,7 +45,7 @@ All fields are in [CONFIG.md](CONFIG.md).
|
|
|
45
45
|
|
|
46
46
|
### Commands an app calls
|
|
47
47
|
|
|
48
|
-
Always pass `--json` (before the command name). Run them from the project directory, or pass `--config /path/to/
|
|
48
|
+
Always pass `--json` (before the command name). Run them from the project directory, or pass `--config /path/to/gpu.yaml`.
|
|
49
49
|
|
|
50
50
|
| Command | Use it to | Blocks | Starts billing |
|
|
51
51
|
| --- | --- | --- | --- |
|
|
@@ -101,7 +101,7 @@ gpu env --format dotenv > .env.gpu
|
|
|
101
101
|
| --- | --- | --- |
|
|
102
102
|
| 0 | success | |
|
|
103
103
|
| 1 | unexpected error | log stderr, retry later |
|
|
104
|
-
| 2 | config error (`
|
|
104
|
+
| 2 | config error (`gpu.yaml` invalid, or changed since setup) | fix the config; `setup --recreate` replaces a machine built from the old one |
|
|
105
105
|
| 3 | no instance / no endpoint (from `env`, `endpoint`) | call `setup` |
|
|
106
106
|
| 4 | provider API error | retry with backoff |
|
|
107
107
|
| 5 | provider authentication failed | fix `VAST_API_KEY` |
|
|
@@ -161,7 +161,7 @@ The TypeScript helper below does this.
|
|
|
161
161
|
import OpenAI from "openai";
|
|
162
162
|
import { Gpu } from "./gpu.ts";
|
|
163
163
|
|
|
164
|
-
const gpu = new Gpu({ cwd: "/srv/my-app" }); // where
|
|
164
|
+
const gpu = new Gpu({ cwd: "/srv/my-app" }); // where gpu.yaml lives
|
|
165
165
|
|
|
166
166
|
const reply = await gpu.call((c) =>
|
|
167
167
|
new OpenAI({ baseURL: c.baseURL, apiKey: c.apiKey, maxRetries: 0, timeout: 120_000 })
|
|
@@ -220,7 +220,7 @@ Run `gpu --json setup` as a subprocess, parse the JSON, and point the language's
|
|
|
220
220
|
- The endpoint requires a key. Unless `runtime.api_key` is set, `setup` generates one per machine (43 random URL-safe characters) and starts vLLM with it. Requests without it get `401`. `/health` and `/metrics` stay open: they reveal no data and the watchdog reads `/metrics`. Instances provisioned before this existed run without a key until they are recreated.
|
|
221
221
|
- The endpoint is plain HTTP on a public IP and port. The key and the prompts travel unencrypted. For sensitive data, put the app and the GPU on a private network or a tunnel, or front the endpoint with a TLS proxy.
|
|
222
222
|
- The watchdog holds the provider key on the instance so it can stop its own machine. A restricted key is the safer choice; see [LIFECYCLE.md](LIFECYCLE.md).
|
|
223
|
-
- `
|
|
223
|
+
- `gpu.yaml` never holds credentials. `.env` and `.gpu/` do not belong in version control.
|
|
224
224
|
|
|
225
225
|
## 6. Troubleshooting
|
|
226
226
|
|