gpu4agents 0.5.0__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.
Files changed (116) hide show
  1. gpu4agents-0.5.0/.env.example +11 -0
  2. gpu4agents-0.5.0/.github/ISSUE_TEMPLATE/bug_report.yml +38 -0
  3. gpu4agents-0.5.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. gpu4agents-0.5.0/.github/ISSUE_TEMPLATE/feature_request.yml +19 -0
  5. gpu4agents-0.5.0/.github/dependabot.yml +10 -0
  6. gpu4agents-0.5.0/.github/pull_request_template.md +7 -0
  7. gpu4agents-0.5.0/.github/workflows/ci.yml +36 -0
  8. gpu4agents-0.5.0/.github/workflows/release.yml +49 -0
  9. gpu4agents-0.5.0/.gitignore +20 -0
  10. gpu4agents-0.5.0/CHANGELOG.md +60 -0
  11. gpu4agents-0.5.0/CODE_OF_CONDUCT.md +84 -0
  12. gpu4agents-0.5.0/CONTRIBUTING.md +81 -0
  13. gpu4agents-0.5.0/LICENSE +21 -0
  14. gpu4agents-0.5.0/PKG-INFO +157 -0
  15. gpu4agents-0.5.0/README.md +116 -0
  16. gpu4agents-0.5.0/SECURITY.md +19 -0
  17. gpu4agents-0.5.0/docs/ACCEPTANCE.md +85 -0
  18. gpu4agents-0.5.0/docs/ADDING_A_PROVIDER.md +132 -0
  19. gpu4agents-0.5.0/docs/AGENTS.md +56 -0
  20. gpu4agents-0.5.0/docs/CHOOSING_A_MODEL.md +198 -0
  21. gpu4agents-0.5.0/docs/CONFIG.md +242 -0
  22. gpu4agents-0.5.0/docs/INTEGRATION.md +233 -0
  23. gpu4agents-0.5.0/docs/LIFECYCLE.md +128 -0
  24. gpu4agents-0.5.0/docs/USAGE.md +156 -0
  25. gpu4agents-0.5.0/docs/assets/banner.png +0 -0
  26. gpu4agents-0.5.0/docs/assets/jambu-logo.jpg +0 -0
  27. gpu4agents-0.5.0/examples/experiment.py +48 -0
  28. gpu4agents-0.5.0/examples/jambu.yaml +36 -0
  29. gpu4agents-0.5.0/examples/mastra-agent/README.md +70 -0
  30. gpu4agents-0.5.0/examples/mastra-agent/package-lock.json +2235 -0
  31. gpu4agents-0.5.0/examples/mastra-agent/package.json +19 -0
  32. gpu4agents-0.5.0/examples/mastra-agent/src/agent.ts +42 -0
  33. gpu4agents-0.5.0/examples/mastra-agent/src/index.ts +11 -0
  34. gpu4agents-0.5.0/examples/mastra-agent/src/tools/weather-tool.ts +36 -0
  35. gpu4agents-0.5.0/examples/mastra-agent/tsconfig.json +15 -0
  36. gpu4agents-0.5.0/examples/typescript-client/README.md +44 -0
  37. gpu4agents-0.5.0/examples/typescript-client/package-lock.json +71 -0
  38. gpu4agents-0.5.0/examples/typescript-client/package.json +18 -0
  39. gpu4agents-0.5.0/examples/typescript-client/src/gpu.ts +178 -0
  40. gpu4agents-0.5.0/examples/typescript-client/src/index.ts +31 -0
  41. gpu4agents-0.5.0/examples/typescript-client/tsconfig.json +16 -0
  42. gpu4agents-0.5.0/gpu4agents/__init__.py +5 -0
  43. gpu4agents-0.5.0/gpu4agents/__main__.py +4 -0
  44. gpu4agents-0.5.0/gpu4agents/agent/__init__.py +1 -0
  45. gpu4agents-0.5.0/gpu4agents/agent/install.py +173 -0
  46. gpu4agents-0.5.0/gpu4agents/agent/jobs.py +193 -0
  47. gpu4agents-0.5.0/gpu4agents/agent/mcp.py +646 -0
  48. gpu4agents-0.5.0/gpu4agents/agent/skill/SKILL.md +68 -0
  49. gpu4agents-0.5.0/gpu4agents/cli/__init__.py +0 -0
  50. gpu4agents-0.5.0/gpu4agents/cli/_common.py +131 -0
  51. gpu4agents-0.5.0/gpu4agents/cli/account.py +330 -0
  52. gpu4agents-0.5.0/gpu4agents/cli/agent.py +74 -0
  53. gpu4agents-0.5.0/gpu4agents/cli/inspect.py +207 -0
  54. gpu4agents-0.5.0/gpu4agents/cli/lifecycle.py +127 -0
  55. gpu4agents-0.5.0/gpu4agents/cli/main.py +163 -0
  56. gpu4agents-0.5.0/gpu4agents/cli/providers.py +96 -0
  57. gpu4agents-0.5.0/gpu4agents/cli/run.py +38 -0
  58. gpu4agents-0.5.0/gpu4agents/cli/setup.py +164 -0
  59. gpu4agents-0.5.0/gpu4agents/cli/status.py +224 -0
  60. gpu4agents-0.5.0/gpu4agents/cli/timer.py +143 -0
  61. gpu4agents-0.5.0/gpu4agents/cli/validate.py +57 -0
  62. gpu4agents-0.5.0/gpu4agents/core/__init__.py +0 -0
  63. gpu4agents-0.5.0/gpu4agents/core/beacon.py +133 -0
  64. gpu4agents-0.5.0/gpu4agents/core/config.py +647 -0
  65. gpu4agents-0.5.0/gpu4agents/core/credentials.py +95 -0
  66. gpu4agents-0.5.0/gpu4agents/core/durations.py +47 -0
  67. gpu4agents-0.5.0/gpu4agents/core/engine.py +1335 -0
  68. gpu4agents-0.5.0/gpu4agents/core/errors.py +94 -0
  69. gpu4agents-0.5.0/gpu4agents/core/events.py +117 -0
  70. gpu4agents-0.5.0/gpu4agents/core/execution.py +169 -0
  71. gpu4agents-0.5.0/gpu4agents/core/health.py +62 -0
  72. gpu4agents-0.5.0/gpu4agents/core/hosts.py +58 -0
  73. gpu4agents-0.5.0/gpu4agents/core/model_inspect.py +368 -0
  74. gpu4agents-0.5.0/gpu4agents/core/models.py +313 -0
  75. gpu4agents-0.5.0/gpu4agents/core/paths.py +42 -0
  76. gpu4agents-0.5.0/gpu4agents/core/policy.py +264 -0
  77. gpu4agents-0.5.0/gpu4agents/core/state.py +406 -0
  78. gpu4agents-0.5.0/gpu4agents/core/sweep.py +478 -0
  79. gpu4agents-0.5.0/gpu4agents/core/tool_parsers.py +63 -0
  80. gpu4agents-0.5.0/gpu4agents/providers/__init__.py +4 -0
  81. gpu4agents-0.5.0/gpu4agents/providers/base.py +137 -0
  82. gpu4agents-0.5.0/gpu4agents/providers/registry.py +63 -0
  83. gpu4agents-0.5.0/gpu4agents/providers/vast/__init__.py +3 -0
  84. gpu4agents-0.5.0/gpu4agents/providers/vast/client.py +255 -0
  85. gpu4agents-0.5.0/gpu4agents/providers/vast/config.py +56 -0
  86. gpu4agents-0.5.0/gpu4agents/providers/vast/mapper.py +292 -0
  87. gpu4agents-0.5.0/gpu4agents/providers/vast/provider.py +438 -0
  88. gpu4agents-0.5.0/gpu4agents/runtime/__init__.py +6 -0
  89. gpu4agents-0.5.0/gpu4agents/runtime/base.py +184 -0
  90. gpu4agents-0.5.0/gpu4agents/runtime/vllm.py +295 -0
  91. gpu4agents-0.5.0/gpu4agents/watchdog/__init__.py +3 -0
  92. gpu4agents-0.5.0/gpu4agents/watchdog/agent_body.py +959 -0
  93. gpu4agents-0.5.0/gpu4agents/watchdog/builder.py +248 -0
  94. gpu4agents-0.5.0/jambu.example.yaml +89 -0
  95. gpu4agents-0.5.0/jambu.models.yaml +102 -0
  96. gpu4agents-0.5.0/jambu.yaml +42 -0
  97. gpu4agents-0.5.0/jambu_gpu/__init__.py +9 -0
  98. gpu4agents-0.5.0/jambu_gpu/__main__.py +4 -0
  99. gpu4agents-0.5.0/pyproject.toml +67 -0
  100. gpu4agents-0.5.0/tests/conftest.py +81 -0
  101. gpu4agents-0.5.0/tests/fakes.py +210 -0
  102. gpu4agents-0.5.0/tests/test_agent.py +348 -0
  103. gpu4agents-0.5.0/tests/test_cli.py +311 -0
  104. gpu4agents-0.5.0/tests/test_config.py +398 -0
  105. gpu4agents-0.5.0/tests/test_engine.py +920 -0
  106. gpu4agents-0.5.0/tests/test_engine_sessions.py +445 -0
  107. gpu4agents-0.5.0/tests/test_integration.py +289 -0
  108. gpu4agents-0.5.0/tests/test_model_inspect.py +219 -0
  109. gpu4agents-0.5.0/tests/test_paths.py +50 -0
  110. gpu4agents-0.5.0/tests/test_policy.py +232 -0
  111. gpu4agents-0.5.0/tests/test_runtime_vllm.py +263 -0
  112. gpu4agents-0.5.0/tests/test_state.py +187 -0
  113. gpu4agents-0.5.0/tests/test_sweep.py +680 -0
  114. gpu4agents-0.5.0/tests/test_vast_mapper.py +276 -0
  115. gpu4agents-0.5.0/tests/test_vast_provider.py +438 -0
  116. gpu4agents-0.5.0/tests/test_watchdog.py +1130 -0
@@ -0,0 +1,11 @@
1
+ # Credentials are resolved from the environment, this file, or
2
+ # ~/.jambu/credentials - never from jambu.yaml.
3
+
4
+ # Required by the vast provider.
5
+ VAST_API_KEY=
6
+
7
+ # Optional: needed for gated HuggingFace models.
8
+ HF_TOKEN=
9
+
10
+ # Optional: per-profile override, used when provider.profile: staging
11
+ # VAST_API_KEY__staging=
@@ -0,0 +1,38 @@
1
+ name: Bug report
2
+ description: Something does not work as documented.
3
+ labels: [bug]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: Never paste `VAST_API_KEY`, endpoint keys or `.env` contents. Security issues go to SECURITY.md, not here.
8
+ - type: textarea
9
+ id: what
10
+ attributes:
11
+ label: What happened
12
+ description: What you ran, what you expected, what you got.
13
+ validations:
14
+ required: true
15
+ - type: textarea
16
+ id: repro
17
+ attributes:
18
+ label: How to reproduce
19
+ description: The command or MCP tool call, and the relevant part of `jambu.yaml`.
20
+ render: shell
21
+ - type: textarea
22
+ id: output
23
+ attributes:
24
+ label: Output
25
+ description: "`gpu --json ...` output, the error and exit code, or `gpu logs --source onstart`."
26
+ render: text
27
+ - type: input
28
+ id: version
29
+ attributes:
30
+ label: Version
31
+ description: "`gpu --version`"
32
+ validations:
33
+ required: true
34
+ - type: dropdown
35
+ id: surface
36
+ attributes:
37
+ label: How were you using it
38
+ options: [CLI, Claude Code, Cursor, Claude Desktop, Another MCP client, From an application]
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Questions and ideas
4
+ url: https://github.com/jambuai/gpu4agents/discussions
5
+ about: Ask how to do something or share what you built.
6
+ - name: Security issue
7
+ url: https://github.com/jambuai/gpu4agents/security/advisories/new
8
+ about: Report a vulnerability privately.
@@ -0,0 +1,19 @@
1
+ name: Feature request
2
+ description: A provider, a runtime, a tool for agents, or something else.
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: The problem
9
+ description: What are you or your agent trying to do, and what gets in the way?
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: idea
14
+ attributes:
15
+ label: What you would like
16
+ - type: textarea
17
+ id: alternatives
18
+ attributes:
19
+ label: Alternatives you considered
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: monthly
7
+ - package-ecosystem: pip
8
+ directory: /
9
+ schedule:
10
+ interval: monthly
@@ -0,0 +1,7 @@
1
+ ## What and why
2
+
3
+ ## How it was tested
4
+
5
+ - [ ] `pytest` passes
6
+ - [ ] Docs updated (README, `docs/`, `CHANGELOG.md`) if behavior changed
7
+ - [ ] No key, token or `.env` content in the diff, tests or fixtures
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python: ["3.10", "3.11", "3.12", "3.13"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python }}
23
+ cache: pip
24
+ - run: pip install -e ".[dev]"
25
+ - run: python -m pytest -q
26
+
27
+ build:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v4
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.12"
34
+ - run: pip install build twine
35
+ - run: python -m build
36
+ - run: twine check dist/*
@@ -0,0 +1,49 @@
1
+ name: Release
2
+
3
+ # Runs when a GitHub release is published: builds the wheel and sdist, attaches
4
+ # them to the release, and publishes to PyPI with trusted publishing once the
5
+ # repository variable PYPI_PUBLISH is "true" (see CONTRIBUTING.md, "Releasing").
6
+
7
+ on:
8
+ release:
9
+ types: [published]
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+ - name: Check the tag matches the package version
22
+ run: |
23
+ version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
24
+ test "v$version" = "${{ github.event.release.tag_name }}"
25
+ - run: pip install build twine && python -m build && twine check dist/*
26
+ - name: Attach to the release
27
+ env:
28
+ GH_TOKEN: ${{ github.token }}
29
+ run: gh release upload "${{ github.event.release.tag_name }}" dist/* --clobber
30
+ - uses: actions/upload-artifact@v4
31
+ with:
32
+ name: dist
33
+ path: dist/
34
+
35
+ pypi:
36
+ needs: build
37
+ if: vars.PYPI_PUBLISH == 'true'
38
+ runs-on: ubuntu-latest
39
+ environment: pypi
40
+ permissions:
41
+ id-token: write
42
+ steps:
43
+ - uses: actions/download-artifact@v4
44
+ with:
45
+ name: dist
46
+ path: dist/
47
+ - uses: pypa/gh-action-pypi-publish@release/v1
48
+ with:
49
+ skip-existing: true
@@ -0,0 +1,20 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ venv/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .gpu/
9
+ .jambu/
10
+ .env
11
+ .env.*
12
+ !.env.example
13
+ .pytest_cache/
14
+ .coverage
15
+ node_modules/
16
+ *.tsbuildinfo
17
+ .claude/
18
+
19
+ # Cloudflare wrangler cache
20
+ .wrangler/
@@ -0,0 +1,60 @@
1
+ # Changelog
2
+
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
+
5
+ ## [0.5.0] - 2026-11-02
6
+
7
+ ### Changed
8
+ - **Renamed to GPU for Agents.** The package is now `gpu4agents` on PyPI (it was `jambu-gpu`) and the module is `gpu4agents`. The `gpu` command, the MCP server and tool names, `jambu.yaml`, `.gpu/`, `~/.gpu` and the labels on running instances are unchanged, so existing projects and machines keep working.
9
+ - The repository moved to [jambuai/gpu4agents](https://github.com/jambuai/gpu4agents); the old URLs redirect.
10
+ - New website: [gpu4agents.jambu.ai](https://gpu4agents.jambu.ai).
11
+
12
+ ### Added
13
+ - `gpu --version` (same as `gpu version`).
14
+
15
+ ### Migrating
16
+ - `pipx uninstall jambu-gpu && pipx install gpu4agents` (or `uv tool install gpu4agents`).
17
+ - A `jambu_gpu` alias module ships with the package, so sweep timers that run `python -m jambu_gpu sweep --apply` keep working; `gpu sweep --install-timer` rewrites them for `gpu4agents`.
18
+ - `jambu-gpu` 0.5.0 on PyPI is a transition release that installs `gpu4agents`.
19
+
20
+ ## [0.4.1] - 2026-10-25
21
+
22
+ ### Fixed
23
+ - A stalled image pull no longer costs 30 minutes per host. `gpu setup` replaces a host whose pull shows no progress for `health.pull_stall_timeout` (default `10m`; `off` disables it). The host is destroyed, remembered as bad for 24h, and another is rented. A host that pulls slowly but steadily still waits for `boot_timeout`.
24
+
25
+ ## [0.4.0] - 2026-10-25
26
+
27
+ ### Added
28
+ - `gpu mcp`: a local MCP server (stdio) with 13 tools, from `gpu_init` to `gpu_destroy`. `gpu_setup` runs in the background and re-attaches on each call, so a long first rent never hits a tool timeout.
29
+ - A bundled skill that tells the agent to show the price and ask before renting, wait out a slow setup, never touch `VAST_API_KEY`, and clean up.
30
+ - `gpu agent install` (`-t claude | cursor | desktop`, `--global`) writes the skill and registers the server.
31
+
32
+ ### Fixed
33
+ - `gpu status` and `gpu logs` work during a setup (`"busy": true`); a held project lock is exit code 12.
34
+ - The last host that failed when setup gave up is remembered as bad.
35
+ - On Vast the vLLM image defaults to `vastai/vllm:v0.32.0-cuda-13.0`, cached on Vast hosts.
36
+
37
+ ## [0.3.1] - 2026-10-25
38
+
39
+ ### Fixed
40
+ - Vast: floor the GPU compute capability (vLLM: 8.0 on CUDA-13 images, 7.0 on CUDA-12), overridable with `compute.gpu.compute_cap_min`, so old cards behind a new driver are no longer rented.
41
+
42
+ ## [0.3.0] - 2026-10-24
43
+
44
+ ### Changed
45
+ - Files live in `.gpu/` (per project) and `~/.gpu` (per user) instead of `.jambu`. The first command renames the old directories. `GPU_HOME` overrides `~/.gpu`.
46
+
47
+ ## [0.2.0] - 2026-10-24
48
+
49
+ ### Added
50
+ - The watchdog retries a failed stop, re-arms on every restart and runs under a supervisor; inference traffic counts as activity; stopped instances are destroyed after `lifecycle.stopped_ttl`.
51
+ - `gpu ls` and `gpu sweep` (with a systemd timer) guard every project and clean up orphans.
52
+ - A per-instance endpoint key; `gpu --json setup` / `gpu env` return `base_url`, `api_key` and `model`.
53
+ - [docs/INTEGRATION.md](docs/INTEGRATION.md) and a one-file TypeScript client.
54
+
55
+ [0.5.0]: https://github.com/jambuai/gpu4agents/compare/v0.4.1...v0.5.0
56
+ [0.4.1]: https://github.com/jambuai/gpu4agents/compare/v0.4.0...v0.4.1
57
+ [0.4.0]: https://github.com/jambuai/gpu4agents/compare/v0.3.1...v0.4.0
58
+ [0.3.1]: https://github.com/jambuai/gpu4agents/compare/v0.3.0...v0.3.1
59
+ [0.3.0]: https://github.com/jambuai/gpu4agents/compare/v0.2.0...v0.3.0
60
+ [0.2.0]: https://github.com/jambuai/gpu4agents/releases/tag/v0.2.0
@@ -0,0 +1,84 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
7
+
8
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
9
+
10
+ ## Our Standards
11
+
12
+ Examples of behavior that contributes to a positive environment for our community include:
13
+
14
+ * Demonstrating empathy and kindness toward other people
15
+ * Being respectful of differing opinions, viewpoints, and experiences
16
+ * Giving and gracefully accepting constructive feedback
17
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
18
+ * Focusing on what is best not just for us as individuals, but for the overall community
19
+
20
+ Examples of unacceptable behavior include:
21
+
22
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
26
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
27
+
28
+ ## Enforcement Responsibilities
29
+
30
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
31
+
32
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
33
+
34
+ ## Scope
35
+
36
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37
+
38
+ ## Enforcement
39
+
40
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at joao.gabriel@jambu.ai. All complaints will be reviewed and investigated promptly and fairly.
41
+
42
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
43
+
44
+ ## Enforcement Guidelines
45
+
46
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
47
+
48
+ ### 1. Correction
49
+
50
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
51
+
52
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
53
+
54
+ ### 2. Warning
55
+
56
+ **Community Impact**: A violation through a single incident or series of actions.
57
+
58
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
59
+
60
+ ### 3. Temporary Ban
61
+
62
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
63
+
64
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
65
+
66
+ ### 4. Permanent Ban
67
+
68
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
69
+
70
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
71
+
72
+ ## Attribution
73
+
74
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
75
+
76
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
77
+
78
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
79
+
80
+ [homepage]: https://www.contributor-covenant.org
81
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
82
+ [Mozilla CoC]: https://github.com/mozilla/diversity
83
+ [FAQ]: https://www.contributor-covenant.org/faq
84
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,81 @@
1
+ # Contributing
2
+
3
+ `gpu4agents` provisions a temporary GPU runtime and guarantees it stops billing
4
+ when nothing is using it. Contributions are welcome. By submitting a change you
5
+ agree it is licensed under the [MIT License](LICENSE).
6
+
7
+ ## Command name
8
+
9
+ The published command is `gpu`. The package is `gpu4agents` (published as `jambu-gpu` before 0.5.0).
10
+
11
+ Do not add a second console script. One command, in `pyproject.toml`:
12
+
13
+ ```toml
14
+ [project.scripts]
15
+ gpu = "gpu4agents.cli.main:main"
16
+ ```
17
+
18
+ ## Setup
19
+
20
+ ```bash
21
+ python3 -m venv .venv
22
+ .venv/bin/pip install -e ".[dev]"
23
+ ```
24
+
25
+ Python 3.10 or newer. Tests do not need `VAST_API_KEY`, a GPU, or network access.
26
+
27
+ ## Tests
28
+
29
+ ```bash
30
+ .venv/bin/pytest
31
+ .venv/bin/pytest tests/test_policy.py # shutdown rule
32
+ .venv/bin/pytest tests/test_watchdog.py # generated guard, as a real process
33
+ .venv/bin/pytest tests/test_integration.py # setup -> boot -> run -> auto-stop
34
+ ```
35
+
36
+ A change to lifecycle behaviour needs a test that fails before the change and
37
+ passes after it. The policy in `gpu4agents/core/policy.py` and the watchdog that
38
+ runs on the instance must keep agreeing: the watchdog inlines that module at
39
+ provision time.
40
+
41
+ `tests/test_integration.py` does not mock the boot. It runs the onstart script
42
+ the engine generated, starts the real watchdog, waits on a real health endpoint,
43
+ runs a workload with real heartbeats, and asserts the guard stops the instance
44
+ with the right reason.
45
+
46
+ ## What you may change
47
+
48
+ | Change | Where it goes |
49
+ | --- | --- |
50
+ | New provider | `gpu4agents/providers/<name>/` plus one registry line. See [docs/ADDING_A_PROVIDER.md](docs/ADDING_A_PROVIDER.md). |
51
+ | Shutdown rule | `gpu4agents/core/policy.py` and `tests/test_policy.py`. |
52
+ | How the model server starts | `gpu4agents/runtime/`. |
53
+ | CLI surface | `gpu4agents/cli/`. Keep `--json` and `--config` on every command. |
54
+
55
+ The core must not branch on a provider name. Branch on `provider.capabilities`.
56
+ If a provider feature requires an `if provider == "..."` in `core/`, the contract
57
+ is wrong — extend the contract instead.
58
+
59
+ Out of scope: multi-instance scheduling, multi-GPU
60
+ orchestration, Kubernetes, distributed inference, automatic provider selection,
61
+ job queues, a web dashboard. See [docs/ACCEPTANCE.md](docs/ACCEPTANCE.md).
62
+
63
+ ## Secrets
64
+
65
+ Never commit credentials, `.env`, `.gpu/state.json`, or provider instance
66
+ ids from a real run. Keys are read from the environment, a gitignored `.env`,
67
+ or `~/.gpu/credentials`. `.env.example` ships with empty values only.
68
+
69
+ ## Pull requests
70
+
71
+ - Explain why the behaviour should change, not only what moved.
72
+ - Run `.venv/bin/pytest` and report the result.
73
+ - Keep commits focused. A provider adapter and a policy change are two PRs.
74
+ - Match the surrounding style: English identifiers and docs, type hints on new
75
+ public functions, no new dependency unless the standard library cannot do the job.
76
+
77
+ ## Releasing
78
+
79
+ 1. Bump `version` in `pyproject.toml` and `gpu4agents/__init__.py`, and add the entry to `CHANGELOG.md`.
80
+ 2. Merge to `main`, tag `vX.Y.Z` and publish a GitHub release with the changelog entry as notes.
81
+ 3. The `Release` workflow builds the wheel and sdist, checks the tag matches the version, and attaches them to the release. With the repository variable `PYPI_PUBLISH=true` and a PyPI trusted publisher for this repository (workflow `release.yml`, environment `pypi`), it also publishes to PyPI.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jambu.ai and João Gabriel Lima
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.5
2
+ Name: gpu4agents
3
+ Version: 0.5.0
4
+ Summary: GPU for Agents: your coding agent rents the GPU it needs, on its own. You pay only while it works.
5
+ Project-URL: Homepage, https://gpu4agents.jambu.ai
6
+ Project-URL: Documentation, https://github.com/jambuai/gpu4agents/tree/main/docs
7
+ Project-URL: Repository, https://github.com/jambuai/gpu4agents
8
+ Project-URL: Issues, https://github.com/jambuai/gpu4agents/issues
9
+ Project-URL: Changelog, https://github.com/jambuai/gpu4agents/blob/main/CHANGELOG.md
10
+ Project-URL: Author, https://www.linkedin.com/in/joaogabriellima
11
+ Author: Jambu.ai
12
+ Author-email: João Gabriel Lima <joao.gabriel@jambu.ai>
13
+ License: MIT
14
+ License-File: LICENSE
15
+ Keywords: agents,claude-code,cost,cursor,gpu,inference,llm,mcp,vast-ai,vllm
16
+ Classifier: Development Status :: 4 - Beta
17
+ Classifier: Environment :: Console
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Intended Audience :: Science/Research
20
+ Classifier: License :: OSI Approved :: MIT License
21
+ Classifier: Operating System :: MacOS
22
+ Classifier: Operating System :: POSIX :: Linux
23
+ Classifier: Programming Language :: Python :: 3
24
+ Classifier: Programming Language :: Python :: 3.10
25
+ Classifier: Programming Language :: Python :: 3.11
26
+ Classifier: Programming Language :: Python :: 3.12
27
+ Classifier: Programming Language :: Python :: 3.13
28
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
29
+ Classifier: Topic :: System :: Distributed Computing
30
+ Requires-Python: >=3.10
31
+ Requires-Dist: httpx>=0.27.0
32
+ Requires-Dist: pydantic>=2.6.0
33
+ Requires-Dist: pyyaml>=6.0.1
34
+ Requires-Dist: rich>=13.7.0
35
+ Requires-Dist: typer>=0.12.0
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
38
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
39
+ Requires-Dist: respx>=0.21.0; extra == 'dev'
40
+ Description-Content-Type: text/markdown
41
+
42
+ <p align="center">
43
+ <a href="https://gpu4agents.jambu.ai">
44
+ <img src="docs/assets/banner.png" alt="GPU for Agents: your agent rents the GPU it needs, on its own. You pay only while it works." width="100%">
45
+ </a>
46
+ </p>
47
+
48
+ <p align="center">
49
+ <a href="https://pypi.org/project/gpu4agents/"><img src="https://img.shields.io/pypi/v/gpu4agents?color=5CBF3A&label=pypi" alt="PyPI"></a>
50
+ <a href="https://pypi.org/project/gpu4agents/"><img src="https://img.shields.io/pypi/pyversions/gpu4agents?color=5CBF3A" alt="Python versions"></a>
51
+ <a href="https://github.com/jambuai/gpu4agents/actions/workflows/ci.yml"><img src="https://github.com/jambuai/gpu4agents/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
52
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-5CBF3A" alt="MIT license"></a>
53
+ </p>
54
+
55
+ <p align="center">
56
+ <a href="https://gpu4agents.jambu.ai">Website</a> ·
57
+ <a href="https://gpu4agents.jambu.ai/#video">1-minute video</a> ·
58
+ <a href="docs/AGENTS.md">Agents guide</a> ·
59
+ <a href="https://github.com/jambuai/gpu4agents/wiki">Wiki</a> ·
60
+ <a href="CHANGELOG.md">Changelog</a>
61
+ </p>
62
+
63
+ # GPU for Agents
64
+
65
+ **Your agent rents the GPU it needs, on its own.**
66
+ **You pay only while it works: we watch every machine and shut down the idle ones.**
67
+
68
+ Ask Claude Code, Cursor or any MCP client to "compare Qwen 7B and Llama 8B on these 50 prompts". The agent finds a GPU under your budget, serves the model behind an OpenAI-compatible API with vLLM, and runs the experiment. A watchdog runs on the machine itself, so when nothing uses it for `idle_timeout` (15 minutes by default) it shuts down, even if the agent forgot, the chat closed or your laptop is asleep.
69
+
70
+ - **Self-service GPUs for agents.** A skill and local MCP tools (`gpu_offers`, `gpu_setup`, `gpu_run`, `gpu_status`, `gpu_destroy`, ...) give the agent the whole lifecycle. The skill tells it to show you the price and ask before renting.
71
+ - **Billing that ends when the work does.** Idle timeout, maximum lifetime, hourly and session budgets, and a sweep that cleans up anything left behind.
72
+ - **Any app, any language.** `gpu --json setup` returns `base_url`, `api_key` and `model` for any OpenAI SDK.
73
+
74
+ Vast.ai is the first provider; another provider is a new adapter, and the lifecycle rule stays the same.
75
+
76
+ ## Quickstart: give your agent a GPU
77
+
78
+ ```bash
79
+ pipx install gpu4agents # or: uv tool install gpu4agents
80
+ cd your-project
81
+ echo "VAST_API_KEY=..." >> .env # or ~/.gpu/credentials; never in jambu.yaml
82
+ gpu agent install # Claude Code; -t cursor, -t desktop, --global
83
+ ```
84
+
85
+ Then ask the agent for an experiment. See [Letting a coding agent rent GPUs](docs/AGENTS.md).
86
+
87
+ ## Quickstart: from a shell or an app
88
+
89
+ ```bash
90
+ gpu init --model Qwen/Qwen2.5-7B-Instruct
91
+ gpu validate
92
+ gpu offers # see prices, rent nothing
93
+ gpu setup # rent, boot vLLM, wait until the model answers
94
+ gpu run python experiment.py # OPENAI_BASE_URL / OPENAI_API_KEY are set for the job
95
+ gpu destroy # or walk away: the idle timeout does it
96
+ ```
97
+
98
+ From an application in any language, `gpu --json setup` prints the endpoint as JSON. See [Integrating into an application](docs/INTEGRATION.md), with a ready TypeScript client.
99
+
100
+ ## Declare the limits
101
+
102
+ ```yaml
103
+ # jambu.yaml (only the gpu_runtime key is read, so other Jambu tools can share the file)
104
+ gpu_runtime:
105
+ provider: {name: vast}
106
+ model_profile: qwythos-9b
107
+ lifecycle:
108
+ idle_timeout: 15m # the watchdog on the machine stops it
109
+ max_lifetime: 6h # a hard ceiling, busy or not
110
+ budget:
111
+ max_hourly_cost_usd: 0.60 # offers above this are never rented
112
+ max_session_cost_usd: 5.00
113
+ health:
114
+ pull_stall_timeout: 10m # a host whose image pull stalls is replaced
115
+ ```
116
+
117
+ A full example is [`jambu.example.yaml`](jambu.example.yaml). As a last line of defense, `gpu ls` shows every machine billing in the account and `gpu sweep --install-timer` guards every project on the machine and cleans up orphans. See [Keeping the account clean](docs/USAGE.md#keeping-the-account-clean).
118
+
119
+ The API key is read from the environment, a project `.env`, or `~/.gpu/credentials`. It never goes in the manifest, and the agent never sees it.
120
+
121
+ ## Docs
122
+
123
+ - [Letting a coding agent rent GPUs (Claude Code, Cursor, Claude Desktop)](docs/AGENTS.md)
124
+ - [Integrating into an application (any language)](docs/INTEGRATION.md)
125
+ - [Commands, workloads, and agents](docs/USAGE.md)
126
+ - [Every config field](docs/CONFIG.md)
127
+ - [Choosing a model](docs/CHOOSING_A_MODEL.md)
128
+ - [How shutdown works](docs/LIFECYCLE.md)
129
+ - [Adding a provider](docs/ADDING_A_PROVIDER.md)
130
+
131
+ ## Coming from `jambu-gpu`
132
+
133
+ The package was called `jambu-gpu` until 0.4.1. Same code, same `gpu` command, same `jambu.yaml`, same machines:
134
+
135
+ ```bash
136
+ pipx uninstall jambu-gpu && pipx install gpu4agents
137
+ ```
138
+
139
+ Sweep timers installed by `jambu-gpu` keep working; `gpu sweep --install-timer` rewrites them for the new module.
140
+
141
+ ## Contributing
142
+
143
+ Issues and pull requests are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md). Report security issues privately, as described in [SECURITY.md](SECURITY.md).
144
+
145
+ ## Author
146
+
147
+ Created by [João Gabriel Lima](https://www.linkedin.com/in/joaogabriellima) at [Jambu.ai](https://jambu.ai).
148
+
149
+ ## License
150
+
151
+ [MIT](LICENSE).
152
+
153
+ <p align="center">
154
+ <a href="https://jambu.ai">
155
+ <img src="docs/assets/jambu-logo.jpg" alt="Jambu.ai — Applied Intelligence Lab" width="240">
156
+ </a>
157
+ </p>