gpu4agents 0.9.1__tar.gz → 0.9.2__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.9.1 → gpu4agents-0.9.2}/.claude-plugin/plugin.json +1 -1
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.cursor-plugin/plugin.json +1 -1
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/CHANGELOG.md +12 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/INSTALL.md +11 -8
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/PKG-INFO +2 -2
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/README.md +1 -1
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/AGENTS.md +8 -2
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/__init__.py +1 -1
- {gpu4agents-0.9.1/skills/gpu4agents → gpu4agents-0.9.2/gpu4agents/agent/skill}/SKILL.md +6 -4
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/account.py +78 -8
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/base.py +6 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/vast/config.py +7 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/vast/provider.py +18 -1
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/install.sh +63 -9
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/pyproject.toml +3 -1
- {gpu4agents-0.9.1/gpu4agents/agent/skill → gpu4agents-0.9.2/skills/gpu4agents}/SKILL.md +6 -4
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_cli.py +33 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.claude-plugin/marketplace.json +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.env.example +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.github/dependabot.yml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.github/pull_request_template.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.github/workflows/ci.yml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.github/workflows/release.yml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/.gitignore +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/CODE_OF_CONDUCT.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/CONTRIBUTING.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/JOBS.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/LICENSE +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/PROVIDERS.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/SECURITY.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/SERVING.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/ACCEPTANCE.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/ADDING_A_PROVIDER.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/CHOOSING_A_MODEL.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/CONFIG.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/INTEGRATION.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/LIFECYCLE.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/USAGE.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/assets/banner.png +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/docs/assets/jambu-logo.jpg +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/experiment.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/gpu.yaml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/mastra-agent/README.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/mastra-agent/package-lock.json +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/mastra-agent/package.json +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/mastra-agent/src/agent.ts +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/mastra-agent/src/index.ts +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/mastra-agent/src/tools/weather-tool.ts +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/mastra-agent/tsconfig.json +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/typescript-client/README.md +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/typescript-client/package-lock.json +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/typescript-client/package.json +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/typescript-client/src/gpu.ts +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/typescript-client/src/index.ts +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/examples/typescript-client/tsconfig.json +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu.example.yaml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu.models.yaml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu.yaml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/__main__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/agent/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/agent/install.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/agent/jobs.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/agent/mcp.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/_common.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/agent.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/inspect.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/job.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/lifecycle.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/main.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/providers.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/run.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/setup.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/status.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/timer.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/cli/validate.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/beacon.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/config.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/credentials.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/durations.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/engine.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/errors.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/events.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/execution.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/health.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/hosts.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/job.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/model_inspect.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/models.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/paths.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/policy.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/state.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/sweep.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/core/tool_parsers.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/registry.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/scaffold.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/vast/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/vast/client.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/providers/vast/mapper.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/runtime/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/runtime/base.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/runtime/service.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/runtime/vllm.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/serve/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/serve/hf/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/serve/hf/install.sh +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/serve/hf/server.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/serve/template/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/serve/template/gpujob.yaml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/serve/template/server.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/watchdog/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/watchdog/agent_body.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/watchdog/builder.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/gpu4agents/watchdog/jobs_ext.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/jambu_gpu/__init__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/jambu_gpu/__main__.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/skills/gpu4agents/agents/openai.yaml +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/conftest.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/fakes.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_agent.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_config.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_engine.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_engine_sessions.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_integration.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_jobs.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_model_inspect.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_paths.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_policy.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_runtime_vllm.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_serve.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_state.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_sweep.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_vast_mapper.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/tests/test_vast_provider.py +0 -0
- {gpu4agents-0.9.1 → gpu4agents-0.9.2}/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.9.
|
|
4
|
+
"version": "0.9.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "João Gabriel Lima",
|
|
7
7
|
"url": "https://www.linkedin.com/in/joaogabriellima"
|
|
@@ -2,6 +2,18 @@
|
|
|
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.2] - 2026-11-06
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- `gpu login` starts by showing the providers you can use: Vast.ai, ready out of the box, or "another provider I already use", which hands the job to your agent (it writes the adapter). For Vast.ai it then lists the steps in plain words, from creating the account and adding credit to copying the key, before the hidden prompt. `--provider`, `--stdin` and a project's `gpu.yaml` skip the menu, as before.
|
|
9
|
+
- The messages a user sees when no account is connected, from `gpu login --check`, the installer, the skill and `install.md`, no longer assume a technical reader.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- Oh My Zsh's git plugin, on by default, defines `gpu` as an alias for `git push upstream`, and an alias wins over the command, in a terminal and in an agent's shell. The installer now detects a `gpu` alias in zsh and bash and removes it for new shells, in a marked block at the end of `~/.zshrc` or `~/.bashrc` (`--keep-gpu-alias` leaves it). The command is also installed as `gpu4agents`, which no alias takes, and the skill tells the agent to check `type gpu` first and use `command gpu` when it is an alias.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Provider adapters can describe their own first-time walk-through for `gpu login`: `tagline`, `signup_url` and `setup_steps`.
|
|
16
|
+
|
|
5
17
|
## [0.9.1] - 2026-11-04
|
|
6
18
|
|
|
7
19
|
### Changed
|
|
@@ -20,21 +20,24 @@ 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.9.
|
|
23
|
+
Check: `~/.local/bin/gpu --version` prints 0.9.2 or later.
|
|
24
|
+
|
|
25
|
+
For the rest of this session, call the command by its full path, `~/.local/bin/gpu`. Your shell may define `gpu` as an alias: Oh My Zsh's git plugin, on by default, makes `gpu` mean `git push upstream`, and an alias wins over the command, so plain `gpu setup` could run git instead. The installer removes that alias for new shells and says so; tell the user if it did. The same command is also installed as `gpu4agents`.
|
|
24
26
|
|
|
25
27
|
## 2. Connect a GPU provider account
|
|
26
28
|
|
|
27
|
-
Run
|
|
29
|
+
Run `~/.local/bin/gpu login --check`.
|
|
28
30
|
|
|
29
31
|
- Exit code 0: an account is connected. Go to step 3.
|
|
30
|
-
- Exit code 5: no
|
|
31
|
-
|
|
32
|
+
- Exit code 5: no account is connected yet. Tell the user, in plain words and without technical terms, something close to this:
|
|
33
|
+
|
|
34
|
+
> One last step, about two minutes: connect the account that pays for the GPUs. Open your terminal app (not this chat) and type `gpu login`. It shows the providers you can use and walks you through it: Vast.ai works right away, and if you already use another one (RunPod, Lambda, your company's servers), pick "Another provider" and I'll add it. Your key stays on your computer; I never see it.
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
If the installer said it kept a `gpu` alias, tell them to type `gpu4agents login` instead.
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
If the user picks another provider, write its adapter after this installation by following https://gpu4agents.jambu.ai/providers.md. The user then runs `gpu login --provider <name>`.
|
|
36
39
|
|
|
37
|
-
Wait until the user says it is done, then run
|
|
40
|
+
Wait until the user says it is done, then run `~/.local/bin/gpu login --check` again. If the user wants to connect later, go on to step 3.
|
|
38
41
|
|
|
39
42
|
Never ask the user to paste a key into this conversation, never read `~/.gpu/credentials` or `.env` files, and never print a key.
|
|
40
43
|
|
|
@@ -49,7 +52,7 @@ The MCP tools (`gpu_setup`, `gpu_status`, ...) appear after the user restarts th
|
|
|
49
52
|
Summarize in a few lines:
|
|
50
53
|
|
|
51
54
|
- what was installed (the `gpu` command, the skill, the MCP server for this runtime);
|
|
52
|
-
- whether a provider account is connected, or what they still need to do (`gpu login
|
|
55
|
+
- whether a provider account is connected, or what they still need to do (`gpu login` in their terminal, or an adapter for their provider), in plain words;
|
|
53
56
|
- that they should restart the agent to get the tools;
|
|
54
57
|
- an example request: "Compare Qwen 7B and Llama 8B on 50 prompts", and that you will show the price and ask before renting anything.
|
|
55
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gpu4agents
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
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
|
|
@@ -122,7 +122,7 @@ uv tool install gpu4agents && gpu agent install -t auto --global # the same,
|
|
|
122
122
|
Run this in your own terminal, so the agent never sees the key:
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
gpu login # Vast.ai
|
|
125
|
+
gpu login # pick a provider; for Vast.ai it walks you through the account and the key
|
|
126
126
|
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
|
```
|
|
@@ -81,7 +81,7 @@ uv tool install gpu4agents && gpu agent install -t auto --global # the same,
|
|
|
81
81
|
Run this in your own terminal, so the agent never sees the key:
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
-
gpu login # Vast.ai
|
|
84
|
+
gpu login # pick a provider; for Vast.ai it walks you through the account and the key
|
|
85
85
|
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
|
```
|
|
@@ -34,13 +34,19 @@ The repository is a Claude Code plugin marketplace (`.claude-plugin/`) and a Cur
|
|
|
34
34
|
The user, in their own terminal:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
gpu login #
|
|
37
|
+
gpu login # the first time: pick a provider, follow the steps, paste the key (hidden)
|
|
38
38
|
gpu login --provider runpod # a provider added with an adapter
|
|
39
39
|
gpu login --check # exit 0, the provider and where the key was found; or exit 5
|
|
40
40
|
echo "$KEY" | gpu login --stdin
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Run with no project and no saved provider, `gpu login` first lists the providers it can use: Vast.ai, ready out of the box, and "another provider I already use", which tells the user to ask their agent to add it ([`PROVIDERS.md`](../PROVIDERS.md)). For Vast.ai it then shows the steps in plain words (create the account, add some credit, copy the key) before the hidden prompt. An adapter supplies its own steps with `tagline`, `signup_url` and `setup_steps`.
|
|
44
|
+
|
|
45
|
+
Otherwise 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.
|
|
46
|
+
|
|
47
|
+
## When `gpu` is a shell alias
|
|
48
|
+
|
|
49
|
+
Oh My Zsh's git plugin, on by default, defines `gpu` as `git push upstream`. An alias wins over the command, in a terminal and in the agent's shell, so `gpu login` runs git instead (and in a repository with an `upstream` remote, it pushes). The installer looks for a `gpu` alias in zsh and bash and adds a marked block at the end of `~/.zshrc` or `~/.bashrc` that removes it for new shells; `--keep-gpu-alias` leaves it. The same command is always installed as `gpu4agents` too, and the skill tells the agent to run `type gpu` first and use `command gpu` when it is an alias. The MCP server is unaffected: clients start it without a shell.
|
|
44
50
|
|
|
45
51
|
## Install by hand
|
|
46
52
|
|
|
@@ -17,7 +17,7 @@ Do these in order. Skip a step whose check already passes.
|
|
|
17
17
|
|
|
18
18
|
### 1. Install the `gpu` command
|
|
19
19
|
|
|
20
|
-
Check: `gpu --version` prints 0.9.
|
|
20
|
+
Check: `gpu --version` prints 0.9.2 or later. First run `type gpu`: if it says `gpu` is an alias or a function (Oh My Zsh's git plugin makes it `git push upstream`), plain `gpu` runs that instead, so use `command gpu`, `~/.local/bin/gpu` or `gpu4agents` for every command in this session. In a git repository the alias would really push. If the command is missing or older, install it (Linux and macOS; on Windows, use WSL):
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
curl -fsSL https://gpu4agents.jambu.ai/install.sh | sh -s -- --agent <runtime>
|
|
@@ -31,10 +31,11 @@ To install by hand: `uv tool install --python 3.12 gpu4agents`, or `pipx install
|
|
|
31
31
|
|
|
32
32
|
Check: `gpu login --check` exits 0. It prints the provider, where the key was found, and the balance when the provider reports one.
|
|
33
33
|
|
|
34
|
-
If it exits 5,
|
|
34
|
+
If it exits 5, no account is connected yet. The user may not be technical, so skip jargon like "API key" and tell them, in these words or close:
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
> One step left, about two minutes: connect the account that pays for the GPUs. Open your terminal app (not this chat) and type `gpu login`. It shows the providers you can use and walks you through it: Vast.ai works right away, and if you already use another one (RunPod, Lambda, your company's servers), pick "Another provider" and I'll add it. Your key stays on your computer; I never see it.
|
|
37
|
+
|
|
38
|
+
If they pick another provider, write its adapter ("Another provider" below), then ask them to run `gpu login --provider <name>` in their terminal.
|
|
38
39
|
|
|
39
40
|
Wait for them to say it is done, then run `gpu login --check` again.
|
|
40
41
|
|
|
@@ -150,6 +151,7 @@ Exit codes are the same for the CLI and the MCP tools (`exit_code` in the error)
|
|
|
150
151
|
| 12 | another gpu command (a setup) holds the project | follow it with `gpu_setup`; `gpu_stop` / `gpu_destroy` cancel it |
|
|
151
152
|
|
|
152
153
|
- `gpu: command not found` right after installing: use `~/.local/bin/gpu`, or open a new shell.
|
|
154
|
+
- `gpu` prints a git error (`fatal: not a git repository`, or it pushed): `gpu` is a shell alias (Oh My Zsh). Use `command gpu` or `gpu4agents`, and tell the user the installer can remove the alias for new terminals.
|
|
153
155
|
- Requests fail with connection refused or a timeout: the machine was stopped for being idle. Call `gpu_setup` again (about a minute), take the new `base_url` from its output, and retry once.
|
|
154
156
|
- `401`: a new machine was rented and the key changed; take it from `gpu_connection`.
|
|
155
157
|
- A long job with quiet stretches longer than `idle_timeout`: `gpu_lock(duration="2h")`, then `gpu_unlock`.
|
|
@@ -395,9 +395,10 @@ def login_command(
|
|
|
395
395
|
missing = [name for name in names if not credentials.get(name)]
|
|
396
396
|
if missing:
|
|
397
397
|
raise AuthenticationError(
|
|
398
|
-
f"no
|
|
399
|
-
f"
|
|
400
|
-
f"
|
|
398
|
+
f"no GPU provider account is connected yet ({cls.display_name}: "
|
|
399
|
+
f"{', '.join(missing)} not found). In your own terminal, run "
|
|
400
|
+
f"`gpu login{'' if provider is None else ' --provider ' + cls.name}`: "
|
|
401
|
+
f"it walks you through it in about two minutes{where_to_get}"
|
|
401
402
|
)
|
|
402
403
|
values = {name: credentials.get(name) or "" for name in names}
|
|
403
404
|
source = (credentials.file_source(names[0]) or "environment") if names else "none needed"
|
|
@@ -420,11 +421,17 @@ def login_command(
|
|
|
420
421
|
"gpu login needs a terminal for the hidden prompt; "
|
|
421
422
|
"run it in your own terminal, or pipe the key with --stdin"
|
|
422
423
|
)
|
|
423
|
-
if
|
|
424
|
-
|
|
424
|
+
if provider is None and _choose_freely(context):
|
|
425
|
+
cls = _choose_provider(registry_classes(), cls)
|
|
426
|
+
if cls is None:
|
|
427
|
+
return
|
|
428
|
+
names = list(cls.required_credentials)
|
|
429
|
+
provider = cls.name
|
|
430
|
+
_walk_through(cls)
|
|
425
431
|
for name in names:
|
|
432
|
+
label = "your key" if len(names) == 1 else name
|
|
426
433
|
values[name] = getpass.getpass(
|
|
427
|
-
f"
|
|
434
|
+
f"Paste {label} here and press Enter (it stays hidden): "
|
|
428
435
|
).strip()
|
|
429
436
|
empty = [name for name, value in values.items() if not value]
|
|
430
437
|
if empty:
|
|
@@ -443,6 +450,69 @@ def login_command(
|
|
|
443
450
|
return
|
|
444
451
|
where = summary.get("saved") or summary.get("source")
|
|
445
452
|
balance = summary.get("balance_usd")
|
|
446
|
-
console.print(Text(f"{cls.display_name}
|
|
453
|
+
console.print(Text(f"{cls.display_name} is connected ({where}).", style="green"))
|
|
447
454
|
if balance is not None:
|
|
448
|
-
console.print(Text(f"
|
|
455
|
+
console.print(Text(f"Credit: ${balance:.2f}", style="dim"))
|
|
456
|
+
if balance <= 0:
|
|
457
|
+
console.print(Text("Add some credit before your agent rents a GPU.", style="yellow"))
|
|
458
|
+
if not check:
|
|
459
|
+
console.print("Go back to your agent and tell it you're done.")
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
def registry_classes() -> list:
|
|
463
|
+
return list(load_builtin_providers().classes())
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
def _choose_freely(context: Context) -> bool:
|
|
467
|
+
"""No project and no saved default: the user picks the provider."""
|
|
468
|
+
if context.config_path is not None or find_config() is not None:
|
|
469
|
+
return False
|
|
470
|
+
return not account_credentials(Path.cwd()).get(PROVIDER_SETTING)
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
def _choose_provider(classes: list, default):
|
|
474
|
+
"""Show what is available and return the chosen adapter, or None for "another one"."""
|
|
475
|
+
classes = sorted(classes, key=lambda c: (c is not default, c.display_name))
|
|
476
|
+
console.print("[bold]Connect a GPU provider[/bold], so your agent can rent GPUs on its own.")
|
|
477
|
+
console.print("Your key stays on this computer; the agent never sees it.\n")
|
|
478
|
+
for i, item in enumerate(classes, 1):
|
|
479
|
+
note = f" [dim]{item.tagline}[/dim]" if item.tagline else ""
|
|
480
|
+
console.print(f" {i}) {item.display_name}{note}", highlight=False)
|
|
481
|
+
other = len(classes) + 1
|
|
482
|
+
console.print(
|
|
483
|
+
f" {other}) Another provider I already use "
|
|
484
|
+
"[dim]RunPod, Lambda, my company's servers, ...: your agent adds it[/dim]\n",
|
|
485
|
+
highlight=False,
|
|
486
|
+
)
|
|
487
|
+
choice = typer.prompt("Choose", default="1", err=True).strip()
|
|
488
|
+
try:
|
|
489
|
+
index = int(choice)
|
|
490
|
+
except ValueError:
|
|
491
|
+
index = 0
|
|
492
|
+
if 1 <= index <= len(classes):
|
|
493
|
+
return classes[index - 1]
|
|
494
|
+
if index != other:
|
|
495
|
+
raise ConfigError(f"choose a number from 1 to {other}")
|
|
496
|
+
console.print(
|
|
497
|
+
"\nAsk your agent, naming the provider:\n"
|
|
498
|
+
" [cyan]Add PROVIDER as a GPU provider to GPU for Agents. Fetch "
|
|
499
|
+
"https://gpu4agents.jambu.ai/providers.md with curl and follow its steps.[/cyan]\n"
|
|
500
|
+
"It writes the connection for you, then asks you to run "
|
|
501
|
+
"[bold]gpu login --provider NAME[/bold] here to paste that provider's key.",
|
|
502
|
+
highlight=False,
|
|
503
|
+
)
|
|
504
|
+
return None
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def _walk_through(cls) -> None:
|
|
508
|
+
"""The steps from no account to a key, in plain words."""
|
|
509
|
+
steps = list(cls.setup_steps)
|
|
510
|
+
if not steps and cls.credentials_url:
|
|
511
|
+
steps = ["Create a key at {credentials_url} and copy it."]
|
|
512
|
+
if not steps:
|
|
513
|
+
return
|
|
514
|
+
console.print(f"\n[bold]{cls.display_name}[/bold], in {len(steps)} steps:", highlight=False)
|
|
515
|
+
for i, step in enumerate(steps, 1):
|
|
516
|
+
text = step.format(signup_url=cls.signup_url or cls.credentials_url, credentials_url=cls.credentials_url)
|
|
517
|
+
console.print(f" {i}. {text}", soft_wrap=True, highlight=False)
|
|
518
|
+
console.print("[dim]Already have an account? Skip to the key.[/dim]\n")
|
|
@@ -54,6 +54,12 @@ class GPUProvider(ABC):
|
|
|
54
54
|
required_credentials: list[str] = []
|
|
55
55
|
# Where the user creates those credentials; `gpu login` prints it.
|
|
56
56
|
credentials_url: str = ""
|
|
57
|
+
# For `gpu login`'s first-time walk-through: one line on what the provider
|
|
58
|
+
# is, and the steps from no account to a key, in plain words. Each step may
|
|
59
|
+
# use {signup_url} and {credentials_url}.
|
|
60
|
+
tagline: str = ""
|
|
61
|
+
signup_url: str = ""
|
|
62
|
+
setup_steps: list[str] = []
|
|
57
63
|
capabilities: ProviderCapabilities = ProviderCapabilities()
|
|
58
64
|
# Runtime engine -> the image to use when compute.image is unset. A
|
|
59
65
|
# provider names the copy its hosts already cache, so a first boot does
|
|
@@ -12,6 +12,13 @@ from typing import Any, Optional
|
|
|
12
12
|
API_BASE = "https://console.vast.ai/api/v0"
|
|
13
13
|
API_KEY_ENV = "VAST_API_KEY"
|
|
14
14
|
KEYS_URL = "https://cloud.vast.ai/manage-keys/"
|
|
15
|
+
BILLING_URL = "https://cloud.vast.ai/billing/"
|
|
16
|
+
# Where `gpu login` sends someone who has no Vast.ai account yet. Set
|
|
17
|
+
# REFERRAL_LINK to the link under Vast's Settings > Referral Link: Vast then
|
|
18
|
+
# credits the project's referral account with a share of what it earns from
|
|
19
|
+
# that account, at no cost to the user. Empty: the plain sign-up page.
|
|
20
|
+
REFERRAL_LINK = ""
|
|
21
|
+
SIGNUP_URL = REFERRAL_LINK or "https://cloud.vast.ai/"
|
|
15
22
|
|
|
16
23
|
# runtype that gives us sshd plus our own onstart script (the image entrypoint
|
|
17
24
|
# is replaced by Vast's supervisor, so we launch the model server ourselves).
|
|
@@ -40,7 +40,15 @@ from ...core.models import (
|
|
|
40
40
|
from ..base import GPUProvider, WatchdogSpec
|
|
41
41
|
from . import mapper
|
|
42
42
|
from .client import VastClient, VastNotFound
|
|
43
|
-
from .config import
|
|
43
|
+
from .config import (
|
|
44
|
+
API_KEY_ENV,
|
|
45
|
+
BILLING_URL,
|
|
46
|
+
KEYS_URL,
|
|
47
|
+
ONSTART_MAX_BYTES,
|
|
48
|
+
REFERRAL_LINK,
|
|
49
|
+
SIGNUP_URL,
|
|
50
|
+
VastOptions,
|
|
51
|
+
)
|
|
44
52
|
|
|
45
53
|
# Executed inside the remote watchdog; stdlib only, no package imports.
|
|
46
54
|
WATCHDOG_ACTIONS = '''
|
|
@@ -107,6 +115,15 @@ class VastProvider(GPUProvider):
|
|
|
107
115
|
display_name = "Vast.ai"
|
|
108
116
|
required_credentials = [API_KEY_ENV]
|
|
109
117
|
credentials_url = KEYS_URL
|
|
118
|
+
tagline = "built in; GPUs by the hour from a few cents, pay as you go"
|
|
119
|
+
signup_url = SIGNUP_URL
|
|
120
|
+
setup_steps = [
|
|
121
|
+
"Create a Vast.ai account: {signup_url}"
|
|
122
|
+
+ ("\n Signing up through this link supports GPU for Agents, at no cost to you." if REFERRAL_LINK else ""),
|
|
123
|
+
"Add some credit ($5 to $10 is plenty to try it): " + BILLING_URL
|
|
124
|
+
+ "\n You pay only while a GPU runs, and idle ones are shut down for you.",
|
|
125
|
+
"Create a key and copy it: {credentials_url}",
|
|
126
|
+
]
|
|
110
127
|
capabilities = ProviderCapabilities(
|
|
111
128
|
stop=True,
|
|
112
129
|
destroy=True,
|
|
@@ -13,16 +13,18 @@
|
|
|
13
13
|
# Options:
|
|
14
14
|
# --agent NAME claude | codex | gemini | cursor | auto (default) | none
|
|
15
15
|
# --no-modify-path do not add ~/.local/bin to your shell profile
|
|
16
|
+
# --keep-gpu-alias leave a shell alias named gpu alone (see step 4)
|
|
16
17
|
#
|
|
17
18
|
# Environment:
|
|
18
|
-
# GPU4AGENTS_SPEC what to install (default: gpu4agents>=0.9.
|
|
19
|
+
# GPU4AGENTS_SPEC what to install (default: gpu4agents>=0.9.2); a version pin or a wheel path
|
|
19
20
|
# GPU4AGENTS_PYTHON Python version uv uses for the tool (default: 3.12)
|
|
20
21
|
|
|
21
22
|
set -eu
|
|
22
23
|
|
|
23
24
|
AGENT="auto"
|
|
24
25
|
MODIFY_PATH=1
|
|
25
|
-
|
|
26
|
+
FIX_ALIAS=1
|
|
27
|
+
SPEC="${GPU4AGENTS_SPEC:-gpu4agents>=0.9.2}"
|
|
26
28
|
PYVER="${GPU4AGENTS_PYTHON:-3.12}"
|
|
27
29
|
|
|
28
30
|
while [ $# -gt 0 ]; do
|
|
@@ -30,7 +32,8 @@ while [ $# -gt 0 ]; do
|
|
|
30
32
|
--agent) AGENT="${2:-}"; shift 2 ;;
|
|
31
33
|
--agent=*) AGENT="${1#*=}"; shift ;;
|
|
32
34
|
--no-modify-path) MODIFY_PATH=0; shift ;;
|
|
33
|
-
-
|
|
35
|
+
--keep-gpu-alias) FIX_ALIAS=0; shift ;;
|
|
36
|
+
-h|--help) sed -n '2,21p' "$0" 2>/dev/null || true; exit 0 ;;
|
|
34
37
|
*) echo "gpu4agents: unknown option $1" >&2; exit 2 ;;
|
|
35
38
|
esac
|
|
36
39
|
done
|
|
@@ -88,15 +91,66 @@ case "$AGENT" in
|
|
|
88
91
|
*) warn "unknown --agent $AGENT; skipped (use claude, codex, gemini, cursor or auto)" ;;
|
|
89
92
|
esac
|
|
90
93
|
|
|
91
|
-
# 4.
|
|
94
|
+
# 4. A shell alias named gpu. Oh My Zsh's git plugin, on by default, defines
|
|
95
|
+
# gpu='git push upstream', and an alias wins over the command: typing
|
|
96
|
+
# `gpu login`, in a terminal or in the agent's shell, would run git instead.
|
|
97
|
+
# New shells get the alias removed, in a marked block at the end of the rc
|
|
98
|
+
# file. The same command is also installed as `gpu4agents`, which no alias takes.
|
|
99
|
+
MARK="# >>> gpu4agents >>>"
|
|
100
|
+
gpu_kind() { # how an interactive $1 shell resolves `gpu`: alias, function, command or none
|
|
101
|
+
case "$1" in
|
|
102
|
+
zsh) out=$(zsh -ic 'whence -w gpu' </dev/null 2>/dev/null | tail -n 1) ;;
|
|
103
|
+
bash) out=$(bash -ic 'type -t gpu' </dev/null 2>/dev/null | tail -n 1) ;;
|
|
104
|
+
esac
|
|
105
|
+
case "$out" in
|
|
106
|
+
*alias*) echo alias ;; *function*) echo function ;; *command*|*file*) echo command ;; *) echo none ;;
|
|
107
|
+
esac
|
|
108
|
+
}
|
|
109
|
+
ALIAS_NOTE=""
|
|
110
|
+
for sh_name in zsh bash; do
|
|
111
|
+
command -v "$sh_name" >/dev/null 2>&1 || continue
|
|
112
|
+
rc="$HOME/.${sh_name}rc"
|
|
113
|
+
[ -f "$rc" ] || continue
|
|
114
|
+
kind=$(gpu_kind "$sh_name")
|
|
115
|
+
[ "$kind" = alias ] || [ "$kind" = function ] || continue
|
|
116
|
+
if [ "$kind" = function ] || [ "$FIX_ALIAS" = 0 ]; then
|
|
117
|
+
warn "In $sh_name, gpu is a shell $kind of yours, so typing gpu does not run GPU for Agents."
|
|
118
|
+
warn "Use the full name instead: gpu4agents (for example: gpu4agents login)."
|
|
119
|
+
ALIAS_NOTE="gpu4agents"
|
|
120
|
+
continue
|
|
121
|
+
fi
|
|
122
|
+
if ! grep -q "$MARK" "$rc" 2>/dev/null; then
|
|
123
|
+
{
|
|
124
|
+
echo ""
|
|
125
|
+
echo "$MARK"
|
|
126
|
+
echo "# gpu runs GPU for Agents. Your shell had gpu as an alias (Oh My Zsh's git"
|
|
127
|
+
echo "# plugin: gpu = git push upstream). Delete these lines to get the alias back."
|
|
128
|
+
echo "unalias gpu 2>/dev/null"
|
|
129
|
+
echo "# <<< gpu4agents <<<"
|
|
130
|
+
} >> "$rc"
|
|
131
|
+
fi
|
|
132
|
+
if [ "$(gpu_kind "$sh_name")" = alias ]; then
|
|
133
|
+
warn "gpu is still an alias in $sh_name after editing $rc; use gpu4agents instead."
|
|
134
|
+
ALIAS_NOTE="gpu4agents"
|
|
135
|
+
else
|
|
136
|
+
say "Your terminal had gpu as a shortcut for another command (Oh My Zsh sets it to git push upstream)."
|
|
137
|
+
echo " New terminals now run GPU for Agents when you type gpu. The other command still works typed in full."
|
|
138
|
+
echo " (Changed $rc; delete the gpu4agents block there to undo it.)"
|
|
139
|
+
[ -n "$ALIAS_NOTE" ] || ALIAS_NOTE="new-shell"
|
|
140
|
+
fi
|
|
141
|
+
done
|
|
142
|
+
|
|
143
|
+
# 5. What is left for the user.
|
|
144
|
+
CMD=gpu
|
|
145
|
+
[ "$ALIAS_NOTE" = gpu4agents ] && CMD=gpu4agents
|
|
92
146
|
echo
|
|
93
147
|
if "$GPU" login --check >/dev/null 2>&1; then
|
|
94
|
-
say "Your GPU provider account is connected. Ask your agent for a GPU
|
|
148
|
+
say "Your GPU provider account is connected. Ask your agent for something that needs a GPU."
|
|
95
149
|
else
|
|
96
|
-
say "One step left: connect a GPU provider account."
|
|
97
|
-
echo "
|
|
98
|
-
echo " It
|
|
99
|
-
echo " to add
|
|
150
|
+
say "One step left: connect a GPU provider account (about 2 minutes)."
|
|
151
|
+
echo " Open your terminal app and type: $CMD login"
|
|
152
|
+
echo " It shows the providers you can use and walks you through it: Vast.ai is"
|
|
153
|
+
echo " ready to use, and your agent can add one you already have."
|
|
100
154
|
fi
|
|
101
155
|
case ":$ORIG_PATH:" in
|
|
102
156
|
*":$BIN:"*) ;;
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "gpu4agents"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.2"
|
|
8
8
|
description = "GPU for Agents: your coding agent rents the GPU it needs, on its own. You pay only while it works."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -51,6 +51,8 @@ Author = "https://www.linkedin.com/in/joaogabriellima"
|
|
|
51
51
|
|
|
52
52
|
[project.scripts]
|
|
53
53
|
gpu = "gpu4agents.cli.main:main"
|
|
54
|
+
# The same command under a name no shell alias takes (Oh My Zsh has gpu = git push upstream).
|
|
55
|
+
gpu4agents = "gpu4agents.cli.main:main"
|
|
54
56
|
|
|
55
57
|
[tool.hatch.build.targets.wheel]
|
|
56
58
|
packages = ["gpu4agents", "jambu_gpu"]
|
|
@@ -17,7 +17,7 @@ Do these in order. Skip a step whose check already passes.
|
|
|
17
17
|
|
|
18
18
|
### 1. Install the `gpu` command
|
|
19
19
|
|
|
20
|
-
Check: `gpu --version` prints 0.9.
|
|
20
|
+
Check: `gpu --version` prints 0.9.2 or later. First run `type gpu`: if it says `gpu` is an alias or a function (Oh My Zsh's git plugin makes it `git push upstream`), plain `gpu` runs that instead, so use `command gpu`, `~/.local/bin/gpu` or `gpu4agents` for every command in this session. In a git repository the alias would really push. If the command is missing or older, install it (Linux and macOS; on Windows, use WSL):
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
curl -fsSL https://gpu4agents.jambu.ai/install.sh | sh -s -- --agent <runtime>
|
|
@@ -31,10 +31,11 @@ To install by hand: `uv tool install --python 3.12 gpu4agents`, or `pipx install
|
|
|
31
31
|
|
|
32
32
|
Check: `gpu login --check` exits 0. It prints the provider, where the key was found, and the balance when the provider reports one.
|
|
33
33
|
|
|
34
|
-
If it exits 5,
|
|
34
|
+
If it exits 5, no account is connected yet. The user may not be technical, so skip jargon like "API key" and tell them, in these words or close:
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
> One step left, about two minutes: connect the account that pays for the GPUs. Open your terminal app (not this chat) and type `gpu login`. It shows the providers you can use and walks you through it: Vast.ai works right away, and if you already use another one (RunPod, Lambda, your company's servers), pick "Another provider" and I'll add it. Your key stays on your computer; I never see it.
|
|
37
|
+
|
|
38
|
+
If they pick another provider, write its adapter ("Another provider" below), then ask them to run `gpu login --provider <name>` in their terminal.
|
|
38
39
|
|
|
39
40
|
Wait for them to say it is done, then run `gpu login --check` again.
|
|
40
41
|
|
|
@@ -150,6 +151,7 @@ Exit codes are the same for the CLI and the MCP tools (`exit_code` in the error)
|
|
|
150
151
|
| 12 | another gpu command (a setup) holds the project | follow it with `gpu_setup`; `gpu_stop` / `gpu_destroy` cancel it |
|
|
151
152
|
|
|
152
153
|
- `gpu: command not found` right after installing: use `~/.local/bin/gpu`, or open a new shell.
|
|
154
|
+
- `gpu` prints a git error (`fatal: not a git repository`, or it pushed): `gpu` is a shell alias (Oh My Zsh). Use `command gpu` or `gpu4agents`, and tell the user the installer can remove the alias for new terminals.
|
|
153
155
|
- Requests fail with connection refused or a timeout: the machine was stopped for being idle. Call `gpu_setup` again (about a minute), take the new `base_url` from its output, and retry once.
|
|
154
156
|
- `401`: a new machine was rented and the key changed; take it from `gpu_connection`.
|
|
155
157
|
- A long job with quiet stretches longer than `idle_timeout`: `gpu_lock(duration="2h")`, then `gpu_unlock`.
|
|
@@ -563,3 +563,36 @@ def test_entry_point_providers_are_registered(monkeypatch):
|
|
|
563
563
|
monkeypatch.setattr(registry_mod.registry, "_providers", dict(registry_mod.registry._providers))
|
|
564
564
|
monkeypatch.setattr(registry_mod.metadata, "entry_points", lambda group=None: [Entry()])
|
|
565
565
|
assert "installed" in registry_mod.load_builtin_providers().names()
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
def test_login_first_time_shows_the_providers_and_the_steps(tmp_path, monkeypatch, capsys):
|
|
569
|
+
from gpu4agents.cli import account
|
|
570
|
+
from gpu4agents.providers.vast.provider import VastProvider
|
|
571
|
+
|
|
572
|
+
monkeypatch.setattr(account.typer, "prompt", lambda *a, **k: "1")
|
|
573
|
+
chosen = account._choose_provider(account.registry_classes(), VastProvider)
|
|
574
|
+
assert chosen is VastProvider
|
|
575
|
+
account._walk_through(chosen)
|
|
576
|
+
out = " ".join(capsys.readouterr().out.split())
|
|
577
|
+
assert "1) Vast.ai" in out and "Another provider I already use" in out
|
|
578
|
+
assert "Create a Vast.ai account: https://cloud.vast.ai/" in out
|
|
579
|
+
assert "billing" in out and "https://cloud.vast.ai/manage-keys/" in out
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
def test_login_another_provider_points_to_the_agent_and_saves_nothing(tmp_path, monkeypatch, capsys):
|
|
583
|
+
from gpu4agents.cli import account
|
|
584
|
+
from gpu4agents.providers.vast.provider import VastProvider
|
|
585
|
+
|
|
586
|
+
classes = account.registry_classes()
|
|
587
|
+
monkeypatch.setattr(account.typer, "prompt", lambda *a, **k: str(len(classes) + 1))
|
|
588
|
+
assert account._choose_provider(classes, VastProvider) is None
|
|
589
|
+
out = " ".join(capsys.readouterr().out.split())
|
|
590
|
+
assert "providers.md" in out and "gpu login --provider NAME" in out
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
def test_gpu4agents_is_installed_as_a_second_command_name():
|
|
594
|
+
import tomllib
|
|
595
|
+
from pathlib import Path
|
|
596
|
+
|
|
597
|
+
scripts = tomllib.loads((Path(__file__).parents[1] / "pyproject.toml").read_text())["project"]["scripts"]
|
|
598
|
+
assert scripts["gpu"] == scripts["gpu4agents"] == "gpu4agents.cli.main:main"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|