gpu4agents 0.13.0__tar.gz → 0.15.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.13.0 → gpu4agents-0.15.2}/.claude-plugin/plugin.json +1 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.cursor-plugin/plugin.json +1 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.github/workflows/ci.yml +13 -5
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.github/workflows/release.yml +4 -4
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/CHANGELOG.md +75 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/INSTALL.md +1 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/JOBS.md +4 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/PKG-INFO +15 -2
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/PROVIDERS.md +1 -1
- gpu4agents-0.15.2/QUEUE.md +217 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/README.md +8 -1
- gpu4agents-0.15.2/benchmarks/fetch-rate/.gitignore +2 -0
- gpu4agents-0.15.2/benchmarks/fetch-rate/README.md +26 -0
- gpu4agents-0.15.2/benchmarks/fetch-rate/bench.py +152 -0
- gpu4agents-0.15.2/benchmarks/fetch-rate/gpu.yaml +37 -0
- gpu4agents-0.15.2/benchmarks/fetch-rate/gpujob.yaml +3 -0
- gpu4agents-0.15.2/benchmarks/fetch-rate/results-2026-11-21.json +118 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/ACCEPTANCE.md +15 -5
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/ADDING_A_PROVIDER.md +18 -6
- gpu4agents-0.15.2/docs/CLAUDE_CODE.md +98 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/CONFIG.md +65 -15
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/INTEGRATION.md +16 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/LIFECYCLE.md +12 -2
- gpu4agents-0.15.2/docs/QUEUE_BACKENDS.md +74 -0
- gpu4agents-0.15.2/docs/RUNBOOK.md +128 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/USAGE.md +12 -0
- gpu4agents-0.15.2/docs/engineering/dossier.md +801 -0
- gpu4agents-0.15.2/docs/engineering/fast-provisioning.md +214 -0
- gpu4agents-0.15.2/docs/handoff/2026-11-12-queue-mode-field-run.md +35 -0
- gpu4agents-0.15.2/docs/superpowers/plans/2026-11-12-queue-mode.md +489 -0
- gpu4agents-0.15.2/docs/superpowers/plans/2026-11-14-gpu-dashboard.md +179 -0
- gpu4agents-0.15.2/docs/superpowers/plans/2026-11-15-llama-engine-anthropic-adapter.md +183 -0
- gpu4agents-0.15.2/docs/superpowers/specs/2026-11-12-queue-mode-design.md +257 -0
- gpu4agents-0.15.2/docs/superpowers/specs/2026-11-14-gpu-dashboard-design.md +182 -0
- gpu4agents-0.15.2/docs/superpowers/specs/2026-11-15-llama-engine-anthropic-adapter-design.md +200 -0
- gpu4agents-0.15.2/examples/queue-smoke/.env.example +5 -0
- gpu4agents-0.15.2/examples/queue-smoke/.gitignore +3 -0
- gpu4agents-0.15.2/examples/queue-smoke/gpu.yaml +43 -0
- gpu4agents-0.15.2/examples/queue-smoke/job/gpujob.yaml +3 -0
- gpu4agents-0.15.2/examples/queue-smoke/job/matmul.py +26 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu.example.yaml +25 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/__init__.py +1 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/agent/mcp.py +109 -0
- {gpu4agents-0.13.0/skills/gpu4agents → gpu4agents-0.15.2/gpu4agents/agent/skill}/SKILL.md +11 -3
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/_common.py +7 -2
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/account.py +93 -4
- gpu4agents-0.15.2/gpu4agents/cli/claude.py +119 -0
- gpu4agents-0.15.2/gpu4agents/cli/dashboard.py +247 -0
- gpu4agents-0.15.2/gpu4agents/cli/gateway.py +135 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/main.py +13 -2
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/providers.py +1 -1
- gpu4agents-0.15.2/gpu4agents/cli/queue.py +408 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/setup.py +67 -4
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/status.py +10 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/timer.py +126 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/beacon.py +27 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/config.py +253 -8
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/engine.py +370 -46
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/events.py +33 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/job.py +30 -2
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/models.py +3 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/policy.py +10 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/state.py +14 -2
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/sweep.py +141 -3
- gpu4agents-0.15.2/gpu4agents/dashboard/__init__.py +11 -0
- gpu4agents-0.15.2/gpu4agents/dashboard/auth.py +58 -0
- gpu4agents-0.15.2/gpu4agents/dashboard/collect.py +89 -0
- gpu4agents-0.15.2/gpu4agents/dashboard/ops.py +93 -0
- gpu4agents-0.15.2/gpu4agents/dashboard/page.html +297 -0
- gpu4agents-0.15.2/gpu4agents/dashboard/probe.py +90 -0
- gpu4agents-0.15.2/gpu4agents/dashboard/server.py +214 -0
- gpu4agents-0.15.2/gpu4agents/dashboard/service.py +130 -0
- gpu4agents-0.15.2/gpu4agents/gateway/__init__.py +21 -0
- gpu4agents-0.15.2/gpu4agents/gateway/adapters.py +113 -0
- gpu4agents-0.15.2/gpu4agents/gateway/anthropic_openai.py +442 -0
- gpu4agents-0.15.2/gpu4agents/gateway/base.py +145 -0
- gpu4agents-0.15.2/gpu4agents/gateway/server.py +152 -0
- gpu4agents-0.15.2/gpu4agents/gateway/service.py +129 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/runpod/provider.py +1 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/vast/client.py +8 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/vast/mapper.py +18 -2
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/vast/provider.py +1 -1
- gpu4agents-0.15.2/gpu4agents/queue/__init__.py +1 -0
- gpu4agents-0.15.2/gpu4agents/queue/api.py +520 -0
- gpu4agents-0.15.2/gpu4agents/queue/audit.py +487 -0
- gpu4agents-0.15.2/gpu4agents/queue/backend.py +120 -0
- gpu4agents-0.15.2/gpu4agents/queue/backends/__init__.py +1 -0
- gpu4agents-0.15.2/gpu4agents/queue/backends/local.py +336 -0
- gpu4agents-0.15.2/gpu4agents/queue/backends/redis.py +500 -0
- gpu4agents-0.15.2/gpu4agents/queue/coordinator.py +1862 -0
- gpu4agents-0.15.2/gpu4agents/queue/models.py +121 -0
- gpu4agents-0.15.2/gpu4agents/queue/observe.py +129 -0
- gpu4agents-0.15.2/gpu4agents/queue/outputs.py +428 -0
- gpu4agents-0.15.2/gpu4agents/queue/pool.py +1013 -0
- gpu4agents-0.15.2/gpu4agents/queue/pool_types.py +40 -0
- gpu4agents-0.15.2/gpu4agents/queue/preflight.py +121 -0
- gpu4agents-0.15.2/gpu4agents/queue/scaler.py +85 -0
- gpu4agents-0.15.2/gpu4agents/queue/spend.py +94 -0
- gpu4agents-0.15.2/gpu4agents/queue/testing.py +270 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/runtime/__init__.py +3 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/runtime/base.py +26 -0
- gpu4agents-0.15.2/gpu4agents/runtime/llama.py +224 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/runtime/vllm.py +40 -3
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/watchdog/agent_body.py +28 -14
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/watchdog/builder.py +8 -9
- gpu4agents-0.15.2/gpu4agents/watchdog/fetch_ext.py +620 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/watchdog/jobs_ext.py +101 -4
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/install.sh +2 -2
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/pyproject.toml +4 -2
- {gpu4agents-0.13.0/gpu4agents/agent/skill → gpu4agents-0.15.2/skills/gpu4agents}/SKILL.md +11 -3
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/conftest.py +34 -0
- gpu4agents-0.15.2/tests/queue_fakes.py +414 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_agent.py +1 -0
- gpu4agents-0.15.2/tests/test_anthropic_openai.py +367 -0
- gpu4agents-0.15.2/tests/test_claude_cli.py +60 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_cli.py +91 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_config.py +44 -0
- gpu4agents-0.15.2/tests/test_dashboard.py +441 -0
- gpu4agents-0.15.2/tests/test_docs.py +88 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_engine.py +63 -1
- gpu4agents-0.15.2/tests/test_fetch.py +409 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_field_run.py +94 -3
- gpu4agents-0.15.2/tests/test_gateway.py +381 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_job_outputs.py +5 -5
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_jobs.py +91 -27
- gpu4agents-0.15.2/tests/test_llama_runtime.py +156 -0
- gpu4agents-0.15.2/tests/test_park.py +65 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_policy.py +26 -0
- gpu4agents-0.15.2/tests/test_queue_audit.py +491 -0
- gpu4agents-0.15.2/tests/test_queue_backend_local.py +78 -0
- gpu4agents-0.15.2/tests/test_queue_backend_redis.py +169 -0
- gpu4agents-0.15.2/tests/test_queue_backend_redis_config.py +80 -0
- gpu4agents-0.15.2/tests/test_queue_cli.py +673 -0
- gpu4agents-0.15.2/tests/test_queue_coordinator.py +1410 -0
- gpu4agents-0.15.2/tests/test_queue_models.py +49 -0
- gpu4agents-0.15.2/tests/test_queue_observe.py +49 -0
- gpu4agents-0.15.2/tests/test_queue_outputs.py +394 -0
- gpu4agents-0.15.2/tests/test_queue_pool.py +669 -0
- gpu4agents-0.15.2/tests/test_queue_preflight.py +108 -0
- gpu4agents-0.15.2/tests/test_queue_scaler.py +86 -0
- gpu4agents-0.15.2/tests/test_queue_spend.py +63 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_runtime_vllm.py +2 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_serve.py +3 -1
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_sweep.py +161 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_vast_mapper.py +9 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_watchdog.py +45 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.claude-plugin/marketplace.json +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.env.example +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.github/dependabot.yml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.github/pull_request_template.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/.gitignore +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/CODE_OF_CONDUCT.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/CONTRIBUTING.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/LICENSE +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/SECURITY.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/SERVING.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/AGENTS.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/CHOOSING_A_MODEL.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/assets/banner.png +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/assets/jambu-logo.jpg +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/docs/handoff/2026-11-11-video-validation-fixes.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/experiment.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/gpu.yaml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/mastra-agent/README.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/mastra-agent/package-lock.json +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/mastra-agent/package.json +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/mastra-agent/src/agent.ts +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/mastra-agent/src/index.ts +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/mastra-agent/src/tools/weather-tool.ts +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/mastra-agent/tsconfig.json +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/typescript-client/README.md +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/typescript-client/package-lock.json +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/typescript-client/package.json +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/typescript-client/src/gpu.ts +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/typescript-client/src/index.ts +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/examples/typescript-client/tsconfig.json +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu.models.yaml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu.yaml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/__main__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/agent/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/agent/install.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/agent/jobs.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/agent.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/inspect.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/job.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/lifecycle.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/run.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/cli/validate.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/credentials.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/durations.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/errors.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/execution.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/health.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/hosts.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/model_inspect.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/paths.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/core/tool_parsers.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/base.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/gpus.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/http.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/lambdacloud/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/lambdacloud/client.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/lambdacloud/config.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/lambdacloud/mapper.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/lambdacloud/provider.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/registry.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/runpod/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/runpod/client.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/runpod/config.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/runpod/mapper.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/scaffold.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/vast/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/providers/vast/config.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/runtime/service.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/serve/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/serve/hf/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/serve/hf/install.sh +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/serve/hf/server.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/serve/template/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/serve/template/gpujob.yaml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/serve/template/server.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/gpu4agents/watchdog/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/jambu_gpu/__init__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/jambu_gpu/__main__.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/skills/gpu4agents/agents/openai.yaml +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/fakes.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_engine_sessions.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_integration.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_lambda_provider.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_model_inspect.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_paths.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_runpod_provider.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_state.py +0 -0
- {gpu4agents-0.13.0 → gpu4agents-0.15.2}/tests/test_vast_provider.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.15.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "João Gabriel Lima",
|
|
7
7
|
"url": "https://www.linkedin.com/in/joaogabriellima"
|
|
@@ -15,20 +15,28 @@ jobs:
|
|
|
15
15
|
fail-fast: false
|
|
16
16
|
matrix:
|
|
17
17
|
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
18
|
+
services:
|
|
19
|
+
redis:
|
|
20
|
+
image: redis:7
|
|
21
|
+
ports: ["6379:6379"]
|
|
22
|
+
options: >-
|
|
23
|
+
--health-cmd "redis-cli ping" --health-interval 5s --health-timeout 3s --health-retries 10
|
|
24
|
+
env:
|
|
25
|
+
GPU_TEST_REDIS_URL: redis://localhost:6379/15
|
|
18
26
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
20
|
-
- uses: actions/setup-python@
|
|
27
|
+
- uses: actions/checkout@v7
|
|
28
|
+
- uses: actions/setup-python@v7
|
|
21
29
|
with:
|
|
22
30
|
python-version: ${{ matrix.python }}
|
|
23
31
|
cache: pip
|
|
24
|
-
- run: pip install -e ".[dev]"
|
|
32
|
+
- run: pip install -e ".[dev,queue-redis]"
|
|
25
33
|
- run: python -m pytest -q
|
|
26
34
|
|
|
27
35
|
build:
|
|
28
36
|
runs-on: ubuntu-latest
|
|
29
37
|
steps:
|
|
30
|
-
- uses: actions/checkout@
|
|
31
|
-
- uses: actions/setup-python@
|
|
38
|
+
- uses: actions/checkout@v7
|
|
39
|
+
- uses: actions/setup-python@v7
|
|
32
40
|
with:
|
|
33
41
|
python-version: "3.12"
|
|
34
42
|
- run: pip install build twine
|
|
@@ -14,8 +14,8 @@ jobs:
|
|
|
14
14
|
permissions:
|
|
15
15
|
contents: write
|
|
16
16
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
18
|
-
- uses: actions/setup-python@
|
|
17
|
+
- uses: actions/checkout@v7
|
|
18
|
+
- uses: actions/setup-python@v7
|
|
19
19
|
with:
|
|
20
20
|
python-version: "3.12"
|
|
21
21
|
- name: Check the tag matches the package version
|
|
@@ -27,7 +27,7 @@ jobs:
|
|
|
27
27
|
env:
|
|
28
28
|
GH_TOKEN: ${{ github.token }}
|
|
29
29
|
run: gh release upload "${{ github.event.release.tag_name }}" dist/* --clobber
|
|
30
|
-
- uses: actions/upload-artifact@
|
|
30
|
+
- uses: actions/upload-artifact@v7
|
|
31
31
|
with:
|
|
32
32
|
name: dist
|
|
33
33
|
path: dist/
|
|
@@ -40,7 +40,7 @@ jobs:
|
|
|
40
40
|
permissions:
|
|
41
41
|
id-token: write
|
|
42
42
|
steps:
|
|
43
|
-
- uses: actions/download-artifact@
|
|
43
|
+
- uses: actions/download-artifact@v8
|
|
44
44
|
with:
|
|
45
45
|
name: dist
|
|
46
46
|
path: dist/
|
|
@@ -2,6 +2,81 @@
|
|
|
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
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.15.2] - 2026-12-01
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **`gpu init --claude` normalizes reasoning effort so Claude Code does not 400.** Claude Code asks for effort `high`; self-hosted thinking models (Qwen3.x and others) accept `xhigh/medium/low` and reject `high`. The written gateway now maps `high` to `xhigh` and drops any level the model does not list.
|
|
11
|
+
- **`gpu init` sizes the GPU for a vLLM model from its weights.** It wrote the 24 GB default for every chat model, so `gpu setup` on a 27B (needs ~74 GB) would rent a card it cannot boot on. It now reads the weight size from the model card, the same floor `gpu inspect-model` prints.
|
|
12
|
+
|
|
13
|
+
## [0.15.1] - 2026-12-01
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- **`gpu login --hf`** saves a Hugging Face token in `~/.gpu/credentials` after checking it with Hugging Face, and `gpu login --check` shows whether one is there. Gated models no longer need an `export`.
|
|
17
|
+
- **`gpu setup` says what the model server is doing.** Every 15 s it prints the last line of the server's log (download, `torch.compile`, CUDA graphs) instead of "still starting".
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- **A failed setup keeps the server's log.** The machine was destroyed with its log, so `gpu logs` had nothing to read; the log is now saved to `.gpu/logs/setup-failure-<id>.log` and its last lines printed before the cleanup.
|
|
21
|
+
- `gpu claude -p "..." --permission-mode ...` passes options through to `claude` (it rejected `-p`), and needs no Claude account: it sends a placeholder credential the gateway drops.
|
|
22
|
+
- A wrong Vast.ai key says the key was rejected, not `object not found: GET /users/current/`.
|
|
23
|
+
- `gpu setup` on a project made with `--claude` ends with `next: gpu claude`; `gpu init` asks for `gpu login` only when no account is connected; the low-balance warning prints dollars.
|
|
24
|
+
|
|
25
|
+
## [0.15.0] - 2026-12-01
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- **`gpu claude`: Claude Code on your own model, in one command.** It reads `gpu.yaml`, starts the gateway if it is not listening, and launches `claude` with the base URL, the model for every alias, the context window (`runtime.context_length`) and an output cap that fits in it. Arguments after `gpu claude` go to `claude`. Guide: [docs/CLAUDE_CODE.md](docs/CLAUDE_CODE.md); step by step: [docs/RUNBOOK.md](docs/RUNBOOK.md).
|
|
29
|
+
- **`gpu init --claude`** writes a project `gpu claude` can use as is: a gateway on `127.0.0.1:18090` with the `anthropic-openai` adapter, `tool_calling: auto` and a 32k window (the default 16k does not hold Claude Code's own prompt and tools).
|
|
30
|
+
- **`runtime.engine: llama`**: GGUF models on `llama-server`, under the same lifecycle as vLLM (health, the watchdog's activity probe, per-machine key).
|
|
31
|
+
- **Gateway adapter `anthropic-openai`**: Anthropic `/v1/messages` in, OpenAI `/v1/chat/completions` out, and the answer back, streaming and tool calls included. Any OpenAI-only backend can now serve Claude Code.
|
|
32
|
+
- `gpu init` also writes a project skeleton: `CLAUDE.md`, `scripts/` and `work/`.
|
|
33
|
+
- **Setup picks hosts that can download the model fast, and llama.cpp gets its weights over 32 connections.** In the lab's own setups on Vast, a 27B model took a median of 9.3 minutes to serve and a 26.6 GB GGUF 17 minutes, nearly all of it downloading weights. A benchmark on two rented hosts (2026-11-21, [benchmarks/fetch-rate](benchmarks/fetch-rate/)) found two causes:
|
|
34
|
+
- The host's link, for everything. The same 55.6 GB took 494 s on an 864 Mbps host and 52 s on an 8 Gbps one. For `vllm` and `llama`, `setup` now raises Vast's `min_inet_down_mbps` so the weights can arrive in about 90 s (up to 5000 Mbps). That day it did not change the cheapest 80 GB offer.
|
|
35
|
+
- llama.cpp's single connection. Its `-hf` download ran at 119 MB/s on the fast host. With `runtime.fetch: auto`, the watchdog now downloads a llama model's GGUF, and its vision projector when the repo has one, over 32 connections before the server starts (446 MB/s on the same host), and starts `llama-server -m`. A host that downloads slower than `health.fetch_min_mbps` (200) for `health.fetch_slow_timeout` (2m) is replaced like a stalled image pull. If the fetcher cannot help, the server downloads as before.
|
|
36
|
+
- vLLM keeps its own download: `huggingface_hub` with `hf_xet` reached 1065 MB/s on the fast host, more than the fetcher's 439. `runtime.fetch: watchdog` forces the fetcher, `server` turns it off.
|
|
37
|
+
- `gpu setup` notices the model server is up within 2 s (`health.interval` default 2s, was 60s clamped to 30s).
|
|
38
|
+
- New events: `weights_fetch_started`, `weights_fetch_ended` (with `mb_per_s`).
|
|
39
|
+
- **`lifecycle.park`: the machine waits for you, if you pay for its disk.** With `park: 6h`, an idle machine stops and keeps its disk instead of being destroyed, and the next `gpu setup` restarts it with the weights already there. A restart measured 41 s; a cold setup of a 27B model took a median of 557 s in our logs. If the parked machine is not running within 2 minutes (on Vast.ai its GPU may have been rented by someone else), setup destroys it and rents a new one, and records `park_restart_failed`. The disk bills while parked (about $0.27 for 6 h for 120 GB on Vast.ai at today's median storage price), and only the sweep timer removes it when `park` runs out, so `gpu validate` warns when the timer is not installed. Off by default: nothing bills after a session unless you turn it on.
|
|
40
|
+
- **`gpu gateway`: a managed local endpoint that follows the machine.** Provisioning a model is only half the job - you still have to reach it, and the rented machine's `base_url` changes every time it is re-rented. `gpu gateway start` runs a loopback endpoint (127.0.0.1) that forwards to the current instance, re-reading the endpoint from state so it keeps working across stop/restart. `gpu gateway install` writes a systemd user service (`Type=simple`, `Restart=always`, boot-safe via linger) so the gateway owns its own lifecycle instead of being a hand-run script. Pluggable adapters shape the request per client: `openai`, `anthropic` (drops the client's own credential so a claude.ai OAuth token never reaches the rented machine, injects the instance key, renames the model to the served one) and `none` (transparent), plus a `gateway.plugin` escape hatch mirroring provider plugins. The `anthropic` adapter also normalizes reasoning effort across `reasoning_effort`, `reasoning.effort` and `output_config.effort`, mapping to what the served model accepts, so a client that spells an effort level differently no longer 400s. New `gateway:` section in gpu.yaml; off by default.
|
|
41
|
+
- **`gpu dashboard`: a read-only control-plane web UI.** Provisioning and a stable endpoint still leave you driving the CLI (or an agent) for every look — what is running, what it costs, is it idle, is the proxy healthy, why did that request fail. `gpu dashboard start` runs a loopback web page (sibling to `gpu gateway`) that shows every GPU, proxy and service this host can see — model, cost, idle, state, reachability — from each project's `.gpu/state.json`. A background watch probes each endpoint on an interval and keeps a short rolling window, so a transient fault (a slow connect, a 5xx burst, an `Errno 110` connection timeout) is visible the moment it happens. `gpu dashboard install` writes a systemd user service (`Type=simple`, `Restart=always`, boot-safe via linger), like the gateway. Read-only by default — no route mutates anything; bound to 127.0.0.1, and a non-loopback bind requires a token so the fleet is never served open (reach it over Tailscale/SSH). **Optional control** (`dashboard.control_enabled`, off by default) turns it into a live console: it **reconciles local state against the provider's live instance list** so a ghost (a project whose `state.json` still names a destroyed machine) is marked gone instead of shown running; it lists **offers and rents** a GPU, fetches **logs**, and **stops / destroys / locks** any project this host manages — each action targeting that project's own directory via the `gpu` CLI (so every provider works), behind the token **and** an explicit confirm. Enabling control means the service shells `gpu setup/stop/destroy` and so needs provider credentials. New `dashboard:` section in gpu.yaml; off by default.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
- **`compute.gpu.name_filter` finds the card on Vast.ai when cheaper cards exist.** The filter was applied to the 24 cheapest offers the search returned, so `name_filter: A100` found nothing whenever 24 cheaper cards were on offer (on 2026-11-21 there were 119 offers that matched, 9 of them A100s, and none among the cheapest 24). With a name filter, the search now asks for up to 1000 offers before filtering.
|
|
45
|
+
- **On Vast.ai, the quoted price now includes the disk.** The offer search did not tell Vast how much disk the machine gets, so Vast priced every offer with a few GB. `gpu offers`, the budget check and the price cap on a pinned quote all missed the disk: an A100 SXM4 quoted at $1.078/h rented at $1.275/h with `disk_gb: 150`. The search now sends `disk_gb`, and the price it shows is the price the machine bills.
|
|
46
|
+
- **A machine found gone long after it ended no longer bills until the moment someone noticed.** The reconcile closed the session's cost at "now", so a project left without a provider key for two days reported $65 for a machine Vast billed 1.4 h ($1.62). The state now keeps `last_seen` (the last time the provider confirmed the machine) and bills until the first lifecycle rule that came due after it, or until `last_seen`; `state_reconciled` carries `cost_if_ran_until_now_usd` as the worst case.
|
|
47
|
+
- **The inferred reason for a vanished machine is the first rule that came due, not whichever rule applies today.** Replaying the rules as of "now" blamed `max_lifetime` for a machine that the idle rule had ended 54 hours earlier. `instance_destroyed` now records what was observed (`reason: unknown`, `by: unknown`) and the inference apart (`likely_reason`, `likely_by`, `due_at`, `inferred: true`).
|
|
48
|
+
- **`gpu status` says when it could not ask the provider.** It showed the cached `ready` and a frozen cost as if current; it now prints a red `STALE` line, and `--json` has `reconciled: false`, `stale_reason` and `last_seen`.
|
|
49
|
+
|
|
50
|
+
### Documentation
|
|
51
|
+
- **Engineering dossier** ([docs/engineering/dossier.md](docs/engineering/dossier.md)): how each part works (providers, setup and serving, the watchdog and cost caps, jobs and the queue, the agent surfaces), the design decisions, what failed and what changed, the known limits, and where to start reading the code. Every statement cites the lines of code that back it, at a pinned commit. It is linked from the README, the docs site and `llms.txt`.
|
|
52
|
+
- **The docs now say what the code does where the dossier found they did not.**
|
|
53
|
+
- CONFIG.md: `max_lifetime` counts from the session start, so a restart gets a new lease; `max_session_cost_usd` applies only after `/identify` delivers the price and not to pool machines; `health.interval` is clamped to 30 s; `trust_remote_code`, `served_name` and `dtype` say which engines honour them; `ssh_counts_as_activity` is marked as having no effect.
|
|
54
|
+
- README and the docs site: changing `model.id` swaps the model in place only with `hf` and `custom`; `vllm` and `llama` need `gpu setup --recreate`.
|
|
55
|
+
- QUEUE.md: a failed health check sends a job back to the queue only when the job also exited non-zero, not by timeout.
|
|
56
|
+
- JOBS.md: documents `max_cost_usd` and `min_vram_gb` in `gpujob.yaml` (queue preflight only).
|
|
57
|
+
- ADDING_A_PROVIDER.md and PROVIDERS.md: what happens when an adapter returns no watchdog spec, where published ports come from, and how narrow the provider-name test is.
|
|
58
|
+
- The skill: Vast.ai, RunPod and Lambda are all built in, and `gpu_run` returns the command's own exit code in a normal result.
|
|
59
|
+
- Docstrings and help text: the watchdog's route list, the gateway and dashboard services (Linux only), the dashboard's control mode, `gpu providers`, and the gateway plugin path.
|
|
60
|
+
|
|
61
|
+
## [0.14.0] - 2026-11-12
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
- **Queue mode** for applications that send jobs over the day. A `queue:` section in `gpu.yaml` turns it on; a project without one behaves exactly as 0.13.0. Full guide: [QUEUE.md](QUEUE.md).
|
|
65
|
+
- `gpu queue submit | status | ls | cancel | retry | pull | pause | resume | drain | audit | stats | run | install-service`, a Python API (`gpu4agents.queue.api`) and the MCP tools `gpu_queue_submit`, `gpu_queue_status`, `gpu_queue_cancel`, `gpu_queue_pull` and `gpu_queue_control`. Every control action is recorded with who did it.
|
|
66
|
+
- A **coordinator** (`gpu queue run`) opens machines when the oldest queued job has waited `scale_up_after`, within `max_machines` and `max_usd_per_hour`, checks each machine's health, runs jobs back to back on a warm machine, and retires machines that have nothing to do. A second coordinator waits as a standby.
|
|
67
|
+
- **Retries**: a job whose machine vanished, went silent or failed its health check runs again on another machine, up to `max_attempts`, then fails with every attempt's reason. A retried attempt finds the earlier attempt's outputs in `$JAMBU_PREVIOUS_OUTPUT_DIR`.
|
|
68
|
+
- **Deadlines instead of lifetimes**: the coordinator moves each machine's deadline in its own watchdog (`POST /deadline`) to cover the job it took. With the coordinator dead, the pool drains to zero by itself.
|
|
69
|
+
- **Preflight** per job (`timeout`, and the new optional `max_cost_usd` and `min_vram_gb` in `gpujob.yaml`), or your own `module:function`.
|
|
70
|
+
- **Backends**: `local` (SQLite) and `redis` (Redis 5 or newer, one node), and outputs to a local directory or S3, each checked against a sha256 manifest. Others plug in through [the contract](docs/QUEUE_BACKENDS.md); `QueueBackendContract` is the suite a backend runs. Addresses and keys come from `GPU_QUEUE_URL`, `GPU_OUTPUTS_URL` and `AWS_*` in the environment or `~/.gpu/credentials`, never `gpu.yaml`. `redis` and `boto3` are optional extras (`queue-redis`, `queue-s3`).
|
|
71
|
+
- **An auditor** (`gpu queue audit`) checks eight invariants (I1 to I8) and repairs what is safe; events, metrics and alert thresholds are in QUEUE.md.
|
|
72
|
+
- `gpu sweep` and the sweep timer cover pool machines, so a dead coordinator still ends in a destroy with finished jobs' outputs saved, and a pool machine is never taken for an orphan.
|
|
73
|
+
- Acceptance guarantees 24 to 31, one for each thing queue mode must never do (docs/ACCEPTANCE.md).
|
|
74
|
+
|
|
75
|
+
### Notes
|
|
76
|
+
- Set `queue.namespace` when you use Redis: without it the keyspace follows the config fingerprint and changes when the runtime part of `gpu.yaml` changes.
|
|
77
|
+
- After a takeover by a coordinator whose pool is different, a job on a machine it cannot see waits until that attempt's deadline plus a grace before it runs again.
|
|
78
|
+
- Redis Cluster is not supported.
|
|
79
|
+
|
|
5
80
|
## [0.13.0] - 2026-11-11
|
|
6
81
|
|
|
7
82
|
The first real, filmed use of 0.12.0 (an agent making images with SDXL and running a CUDA benchmark) found these. Each is fixed and tested.
|
|
@@ -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.15.2 or later.
|
|
24
24
|
|
|
25
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`.
|
|
26
26
|
|
|
@@ -35,8 +35,12 @@ env: # extra environment variables
|
|
|
35
35
|
timeout: 2h # killed after this long (exit 124)
|
|
36
36
|
exclude: [data/raw, "*.ckpt"] # left out of the upload
|
|
37
37
|
label: lora-qwen-7b
|
|
38
|
+
max_cost_usd: 5 # queue only: refused if the timeout costs more at the pool's price
|
|
39
|
+
min_vram_gb: 40 # queue only: refused if the pool's card has less VRAM
|
|
38
40
|
```
|
|
39
41
|
|
|
42
|
+
`max_cost_usd` and `min_vram_gb` are read only by the queue ([queue.md](https://gpu4agents.jambu.ai/queue.md)). Its preflight checks them before the job runs: a job whose `timeout` would cost more than `max_cost_usd` at the pool's hourly price, or that needs more VRAM than the pool's card, fails at once and rents nothing. Without `max_cost_usd`, the project's `queue.defaults.max_cost_usd` applies. `gpu job run` on a single machine ignores both; size that machine with `compute.gpu.min_vram_gb` in `gpu.yaml`.
|
|
43
|
+
|
|
40
44
|
These never upload: `.git`, virtualenvs, `__pycache__`, `node_modules`, `.gpu`, `.env` and `.env.*`, and `gpu-outputs/`. The upload limit is 2 GB. Have the job download large data itself (Hugging Face, a URL) instead of shipping it.
|
|
41
45
|
|
|
42
46
|
## 3. What the job can count on
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: gpu4agents
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.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
|
|
@@ -34,9 +34,15 @@ Requires-Dist: pyyaml>=6.0.1
|
|
|
34
34
|
Requires-Dist: rich>=13.7.0
|
|
35
35
|
Requires-Dist: typer>=0.12.0
|
|
36
36
|
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: fakeredis[lua]>=2.23; extra == 'dev'
|
|
38
|
+
Requires-Dist: moto[s3]>=5; extra == 'dev'
|
|
37
39
|
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
|
|
38
40
|
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
39
41
|
Requires-Dist: respx>=0.21.0; extra == 'dev'
|
|
42
|
+
Provides-Extra: queue-redis
|
|
43
|
+
Requires-Dist: redis>=5; extra == 'queue-redis'
|
|
44
|
+
Provides-Extra: queue-s3
|
|
45
|
+
Requires-Dist: boto3>=1.34; extra == 'queue-s3'
|
|
40
46
|
Description-Content-Type: text/markdown
|
|
41
47
|
|
|
42
48
|
<p align="center">
|
|
@@ -149,6 +155,10 @@ Write this as a GPU for Agents job and run it. Fetch https://gpu4agents.jambu.ai
|
|
|
149
155
|
|
|
150
156
|
[JOBS.md](JOBS.md) has the contract: the directory, `gpujob.yaml`, the environment a job gets, and the rules its code follows.
|
|
151
157
|
|
|
158
|
+
## Queue mode
|
|
159
|
+
|
|
160
|
+
For an application that sends jobs over the day, `gpu queue submit` puts a job directory in a queue and a coordinator (`gpu queue run`) opens and closes machines for it, retries a job on another machine when one dies, and keeps its verified outputs, within the machine and hourly-spend caps you set. It works with any provider, and the queue can be a local file or Redis. See [QUEUE.md](QUEUE.md).
|
|
161
|
+
|
|
152
162
|
## Serve any model
|
|
153
163
|
|
|
154
164
|
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.
|
|
@@ -160,7 +170,7 @@ gpu init --model BAAI/bge-m3 # embeddings -> /v1/embeddings
|
|
|
160
170
|
gpu setup && eval "$(gpu env)" # OPENAI_BASE_URL, OPENAI_API_KEY, JAMBU_MODEL_ID
|
|
161
171
|
```
|
|
162
172
|
|
|
163
|
-
Requests count as activity, so the machine stays up while clients call it and stops by itself once they stop.
|
|
173
|
+
Requests count as activity, so the machine stays up while clients call it and stops by itself once they stop. With the `hf` and `custom` engines, pointing `model.id` at another model and running `gpu setup` again swaps the model on the same GPU, with no new rental. With `vllm` and `llama` the model is fixed when the machine is created, so a new `model.id` needs `gpu setup --recreate`, which replaces the machine. 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
174
|
|
|
165
175
|
## Use any GPU provider
|
|
166
176
|
|
|
@@ -215,14 +225,17 @@ A full example is [`gpu.example.yaml`](gpu.example.yaml). `gpu ls` shows every m
|
|
|
215
225
|
|
|
216
226
|
## Docs
|
|
217
227
|
|
|
228
|
+
- [Claude Code on your own model, step by step (pt-BR)](docs/RUNBOOK.md)
|
|
218
229
|
- [Letting a coding agent rent GPUs (Claude Code, Codex, Gemini CLI, Cursor, Claude Desktop)](docs/AGENTS.md)
|
|
219
230
|
- [Integrating into an application (any language)](docs/INTEGRATION.md)
|
|
220
231
|
- [Running your own code as a job](JOBS.md)
|
|
232
|
+
- [Queue mode: jobs on a pool of GPUs](QUEUE.md)
|
|
221
233
|
- [Commands, workloads, and agents](docs/USAGE.md)
|
|
222
234
|
- [Every config field](docs/CONFIG.md)
|
|
223
235
|
- [Choosing a model](docs/CHOOSING_A_MODEL.md)
|
|
224
236
|
- [How shutdown works](docs/LIFECYCLE.md)
|
|
225
237
|
- [Adding a provider](docs/ADDING_A_PROVIDER.md), and [the steps for an agent](PROVIDERS.md)
|
|
238
|
+
- [Engineering dossier: how it works, what failed and what changed, known limits, each statement cited to the code](docs/engineering/dossier.md)
|
|
226
239
|
|
|
227
240
|
## Coming from `jambu-gpu`
|
|
228
241
|
|
|
@@ -37,7 +37,7 @@ What each part must do:
|
|
|
37
37
|
| `capabilities` | Declare only what the API supports. Set `stop_eliminates_billing=False` if a stopped machine still bills for disk. |
|
|
38
38
|
| `verify_credentials` | Call an account endpoint with the key the user typed into `gpu login`. Return only safe fields, such as `{"balance_usd": 12.5}`. Never return an email, a name or the key. |
|
|
39
39
|
| `find_offers` | List GPUs for rent that fit `spec.gpu.min_vram_gb`, `spec.gpu.count`, `spec.disk_gb` and `spec.max_hourly_cost_usd`, cheapest first. |
|
|
40
|
-
| `setup` | Rent one machine: image `spec.image`, environment `spec.env`, label `spec.label`, every port in `spec.ports` published, and `spec.onstart` run at boot. That script starts the model server and the watchdog. |
|
|
40
|
+
| `setup` | Rent one machine: image `spec.image`, environment `spec.env`, label `spec.label`, every port in `spec.ports` published (the model port and, when the watchdog is on, its port; the built-in adapters build the same list from the config in `_wanted_ports()`), and `spec.onstart` run at boot. That script starts the model server and the watchdog. |
|
|
41
41
|
| `status`, `_to_instance` | Map the provider's states onto `InstanceState` and its published ports onto `endpoints["model"]` and `endpoints["watchdog"]`. |
|
|
42
42
|
| `stop`, `destroy` | Succeed when the machine is already stopped or gone. |
|
|
43
43
|
| `list_instances` | Return only machines whose label starts with `jambu-`. Never touch anything else in the account. |
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Queue mode: jobs on a pool of GPUs
|
|
2
|
+
|
|
3
|
+
Agent mode rents one machine for one conversation. Queue mode is for an application that sends jobs over the day: you submit a job directory, a coordinator opens and closes machines as the queue grows and empties, runs the job on one of them, runs it again somewhere else if the machine dies, and keeps the outputs. Any GPU provider works; the pool is rented from the same `gpu.yaml`, through the same provider contract.
|
|
4
|
+
|
|
5
|
+
A project without a `queue:` section behaves exactly as before. Writing a job is unchanged: it is a directory with `gpujob.yaml`, as [jobs.md](https://gpu4agents.jambu.ai/jobs.md) describes. It gains two optional fields, `max_cost_usd` and `min_vram_gb`.
|
|
6
|
+
|
|
7
|
+
Two guarantees from agent mode carry over. A machine with nothing to do for `idle_timeout` (15 minutes) ends, by the same rule as today. And the coordinator is allowed to die: every machine keeps its own watchdog and a hard deadline, so a pool with no coordinator drains to zero by itself.
|
|
8
|
+
|
|
9
|
+
## Contents
|
|
10
|
+
|
|
11
|
+
- [Quickstart](#quickstart)
|
|
12
|
+
- [The pieces](#the-pieces)
|
|
13
|
+
- [Configuration](#configuration)
|
|
14
|
+
- [Credentials](#credentials)
|
|
15
|
+
- [Submitting and following jobs](#submitting-and-following-jobs)
|
|
16
|
+
- [How a job runs](#how-a-job-runs)
|
|
17
|
+
- [Controls: pause, resume, drain](#controls-pause-resume-drain)
|
|
18
|
+
- [Running the coordinator](#running-the-coordinator)
|
|
19
|
+
- [Observing it: events, metrics, the auditor](#observing-it)
|
|
20
|
+
- [Alerts](#alerts)
|
|
21
|
+
- [What can go wrong](#what-can-go-wrong)
|
|
22
|
+
- [Limits of this version](#limits-of-this-version)
|
|
23
|
+
|
|
24
|
+
## Quickstart
|
|
25
|
+
|
|
26
|
+
One machine, one host, nothing to install beyond gpu4agents. The local queue is a SQLite file in the project, and outputs land in `gpu-outputs/`.
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
# gpu.yaml
|
|
30
|
+
gpu_runtime:
|
|
31
|
+
version: 1
|
|
32
|
+
model: {id: Qwen/Qwen2.5-7B-Instruct} # or any model; jobs may use the server over loopback
|
|
33
|
+
compute: {gpu: {min_vram_gb: 24}}
|
|
34
|
+
queue:
|
|
35
|
+
max_machines: 2
|
|
36
|
+
max_usd_per_hour: 2.00
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
gpu queue submit ./my-job # prints the job id at once; nothing is rented yet
|
|
41
|
+
gpu queue run # the coordinator: opens machines, runs jobs (leave it running)
|
|
42
|
+
gpu queue status # queue counts, pool machines and what they cost per hour
|
|
43
|
+
gpu queue status JOB_ID
|
|
44
|
+
gpu queue pull JOB_ID # verified outputs into gpu-outputs/JOB_ID/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Starting `gpu queue run` rents GPUs and spends money. Decide the caps first (`max_machines`, `max_usd_per_hour`, and each job's `timeout` and `max_cost_usd`).
|
|
48
|
+
|
|
49
|
+
## The pieces
|
|
50
|
+
|
|
51
|
+
| Piece | What it is |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| Queue | Where jobs wait. Behind a backend contract. Built in: `local` (SQLite, one host) and `redis` (several hosts share it). Any other queue plugs in through [the contract](https://github.com/jambuai/gpu4agents/blob/main/docs/QUEUE_BACKENDS.md). |
|
|
54
|
+
| Output store | Where job bundles and results live. Built in: `local` (a directory) and `s3` (any S3-compatible bucket). Plugs in the same way. |
|
|
55
|
+
| Coordinator | `gpu queue run`. One process per queue holds a lease; a second one waits as a standby and takes over when the lease expires. Any number of processes may submit. |
|
|
56
|
+
| Pool | The machines, one per slot, labeled `jambu-<name>-<slot>-<fp6>`. They grow when jobs wait and shrink when machines have nothing to do. |
|
|
57
|
+
| Preflight | Runs when a job is claimed. Sets the job's limits (time, cost) and refuses a job that cannot run, with the reason. |
|
|
58
|
+
| Auditor | Checks the queue's guarantees (invariants I1 to I8) and repairs what it safely can. |
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
`gpu_runtime.queue` turns queue mode on. Every field and its default is in [docs/CONFIG.md](https://github.com/jambuai/gpu4agents/blob/main/docs/CONFIG.md#queue). The ones to decide first:
|
|
63
|
+
|
|
64
|
+
| Field | Default | What it controls |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `backend` | `local` | `local`, `redis`, or `module:factory` for your own |
|
|
67
|
+
| `outputs` | `local` | `local`, `s3`, or `module:factory` |
|
|
68
|
+
| `namespace` | none | The name of the keyspace on a shared backend |
|
|
69
|
+
| `min_machines` | `0` | Machines kept on with an empty queue (they still time out when idle, see [Controls](#controls-pause-resume-drain)) |
|
|
70
|
+
| `max_machines` | `1` | The most machines at once |
|
|
71
|
+
| `max_usd_per_hour` | none | Cap on what the whole pool bills per hour; blocks opening new machines |
|
|
72
|
+
| `scale_up_after` | `30s` | A machine is opened when the oldest queued job has waited this long |
|
|
73
|
+
| `jobs_per_machine` | `1` | Jobs a machine runs at once |
|
|
74
|
+
| `max_attempts` | `3` | Runs per job before it is failed with every attempt's reason |
|
|
75
|
+
| `unresponsive_after` | `5m` | How long a silent machine is waited for before it is destroyed and its jobs requeued |
|
|
76
|
+
| `max_machine_lifetime` | none | Optional hard ceiling on a machine's age (a warm machine is otherwise never replaced just for being old) |
|
|
77
|
+
| `health_check` | built in | Checked before a machine's first job and between jobs |
|
|
78
|
+
| `defaults` | `timeout: 1h` | Limits for a job that sets none |
|
|
79
|
+
|
|
80
|
+
Set `queue.namespace` when you use Redis. Without it the keyspace is named after the config fingerprint, so it changes when the runtime part of `gpu.yaml` changes, and the new coordinator would look at an empty queue. A name you chose (or the `GPU_QUEUE_NAMESPACE` environment variable) keeps the same keyspace across edits. It is not a secret.
|
|
81
|
+
|
|
82
|
+
The health check is the GPU being visible and a small CUDA operation succeeding. A project may set its own `health_check.command`. That command must not write job outputs: anything it writes under the job outputs counts as activity and holds the idle shutdown.
|
|
83
|
+
|
|
84
|
+
## Credentials
|
|
85
|
+
|
|
86
|
+
Addresses and keys never go in `gpu.yaml` (a URL there is a config error). They come from the environment or `~/.gpu/credentials`, like provider keys:
|
|
87
|
+
|
|
88
|
+
| Name | Used for |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `GPU_QUEUE_URL` | the Redis queue (`redis://` or `rediss://`); logged with the password removed |
|
|
91
|
+
| `GPU_OUTPUTS_URL` | the S3 store, `s3://bucket/prefix` |
|
|
92
|
+
| `AWS_*` | the S3 store's keys and endpoint (`AWS_ENDPOINT_URL` for a non-AWS store), the standard boto3 names |
|
|
93
|
+
| `GPU_QUEUE_NAMESPACE` | optional namespace when `queue.namespace` is not set |
|
|
94
|
+
| `GPU_QUEUE_SUBMITTER` | who is recorded as having submitted or controlled (default `user@host`) |
|
|
95
|
+
|
|
96
|
+
The provider's key never reaches a job, the queue, an output store, an event or a metric. A service started by systemd or launchd does not get your shell's environment, so put the credentials in `~/.gpu/credentials` for it.
|
|
97
|
+
|
|
98
|
+
The Redis and S3 clients are optional extras: `pip install "gpu4agents[queue-redis]"` and `"gpu4agents[queue-s3]"`. Importing gpu4agents without them works.
|
|
99
|
+
|
|
100
|
+
## Submitting and following jobs
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
gpu queue submit DIR [--key KEY] [--env NAME=VALUE ...]
|
|
104
|
+
gpu queue status [JOB]
|
|
105
|
+
gpu queue ls [--state STATE]
|
|
106
|
+
gpu queue cancel JOB
|
|
107
|
+
gpu queue retry JOB
|
|
108
|
+
gpu queue pull JOB [--to DIR]
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- `submit` packs DIR (honouring `exclude`), stores the bundle and returns the job id at once. A bad job (no `run`, a bundle over 2 GB, a `timeout` that does not parse) is rejected before anything is stored. A paused queue still takes the job and says so.
|
|
112
|
+
- `--key` makes a submit idempotent: the same key never queues twice, however many replicas retry it.
|
|
113
|
+
- Job ids are at most 60 characters. `--env` values reach the job but are redacted (shown as `***`) in every status output and never written to the audit trail or the events.
|
|
114
|
+
- Job states: `queued`, `claimed`, `running`, `delivering`, `succeeded`, `failed`, `cancelled`. The last three are final. A job always ends in one of them, with the reason; never "unknown".
|
|
115
|
+
- `cancel` is immediate for a queued job. For a running one the coordinator stops it on its machine and keeps the outputs written so far.
|
|
116
|
+
- `retry` queues a failed job again; it keeps its attempts.
|
|
117
|
+
- `pull` verifies the outputs against their sha256 manifest before it hands them over.
|
|
118
|
+
|
|
119
|
+
From Python, an application does not need to shell out:
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from gpu4agents.queue import api
|
|
123
|
+
job_id = api.submit("train/", key="train-2026-11-12") # idempotent on the key
|
|
124
|
+
info = api.wait(job_id, timeout_s=3600)
|
|
125
|
+
path = api.outputs(job_id)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Agents use the MCP tools `gpu_queue_submit`, `gpu_queue_status`, `gpu_queue_cancel`, `gpu_queue_pull` and `gpu_queue_control`. They never start the coordinator: that rents GPUs and is the user's decision.
|
|
129
|
+
|
|
130
|
+
## How a job runs
|
|
131
|
+
|
|
132
|
+
1. The coordinator claims the oldest queued job. The claim is a lease: nobody else sees the job until it expires or the job is settled.
|
|
133
|
+
2. The preflight decides the job's limits: its `timeout`, its `max_cost_usd` and `min_vram_gb`, with the project's `queue.defaults` filling what it leaves out. A job that cannot run (it needs more VRAM than the pool's card, or its cost limit is below what its timeout costs at the pool's price) fails at once with the reason and rents nothing. A project can name its own preflight (`queue.preflight: module:function`) to decide per job.
|
|
134
|
+
3. A machine that passed the health check takes the job. The coordinator moves that machine's deadline in its watchdog to cover the job's timeout plus a margin. While work keeps arriving the deadline keeps moving, and a warm machine runs job after job without being set up again. If the coordinator dies nobody moves it: the machine finishes what it has and ends at its deadline at the latest, or after `idle_timeout` with nothing running, whichever comes first.
|
|
135
|
+
4. When the job ends, the coordinator fetches its outputs, stores them in the output store with a sha256 manifest, verifies them, and only then settles the job as `succeeded`. Nothing on the machine is deleted before that.
|
|
136
|
+
|
|
137
|
+
When a machine disappears, stops answering for `unresponsive_after`, or the job exits non-zero (not by timeout) and the machine then fails the health check, the job goes back to the queue and runs on another machine, up to `max_attempts`. A machine that fails the health check after a clean exit is retired, but the job keeps its result and is delivered as `succeeded`. A job that exits non-zero while the machine is healthy is the job's fault and is not retried automatically (`gpu queue retry` does it by hand). Every attempt's outcome is recorded: `succeeded`, `job_failed`, `timeout`, `machine_lost`, `unhealthy`, `unresponsive`, `preflight_rejected`, `cancelled`, `delivery_failed`, `drained`, `not_started`.
|
|
138
|
+
|
|
139
|
+
A retried attempt starts from scratch, but its `run` is prefixed with `export JAMBU_PREVIOUS_OUTPUT_DIR=...`: the verified outputs of the earlier attempt are there, so a job that writes checkpoints can resume. The job decides whether to use them. The same directory is described in [jobs.md](https://gpu4agents.jambu.ai/jobs.md).
|
|
140
|
+
|
|
141
|
+
Outputs that could not be stored (the store was down) stay under `<state_dir>/queue/work/` on the coordinator's host and are retried; the auditor reports any that are an hour old (I8). A store outage never retires machines: outputs the machine still holds are kept, not given up on.
|
|
142
|
+
|
|
143
|
+
## Controls: pause, resume, drain
|
|
144
|
+
|
|
145
|
+
| Command | What it does |
|
|
146
|
+
| --- | --- |
|
|
147
|
+
| `gpu queue pause` | Stops new claims. Running jobs go on. Idle machines, `min_machines` included, time out by the normal idle rule, so a paused queue lets the pool fall to zero |
|
|
148
|
+
| `gpu queue resume` | Starts jobs again, and drops a drain that was requested |
|
|
149
|
+
| `gpu queue drain` | Pauses, and lets the machines idle out and stop |
|
|
150
|
+
| `gpu queue drain --now` | Also sends running jobs back to the queue and retires every machine at once, pulling outputs first. Those jobs are requeued, not failed, and a drained attempt does not count toward `max_attempts` |
|
|
151
|
+
|
|
152
|
+
`drain --now` through MCP needs `confirm=true` and the user's yes. Every control action is recorded in the audit trail with who did it, and a coordinator that holds the lease does the work itself; without one, the command does it directly.
|
|
153
|
+
|
|
154
|
+
## Running the coordinator
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
gpu queue run [--once] [--metrics-port PORT]
|
|
158
|
+
gpu queue install-service [--uninstall]
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`run` stops on Ctrl-C or SIGTERM; machines keep their deadlines. `--once` runs one tick and exits. `--metrics-port` serves `/metrics` on `127.0.0.1` only. `install-service` writes a user service (systemd on Linux, launchd on macOS) for this project and prints the command that enables it; it does not enable it. A systemd timer and a service do not inherit `devrun` or your shell: put credentials in `~/.gpu/credentials`.
|
|
162
|
+
|
|
163
|
+
The coordinator renews its lease from a heartbeat thread, so a long upload does not lose it. Leases use the backend's clock, never the caller's. The coordinator lease is 15 s at the default tick (3 ticks, never less); a job's lease is 60 s (12 ticks, never less).
|
|
164
|
+
|
|
165
|
+
A coordinator that takes over (after a crash or an expired lease) looks for every job its predecessor left in flight. A run its machine lists is adopted, never started twice. When the predecessor died after it recorded an attempt but before the machine got the job, the new coordinator asks that machine's job runner: if the runner has no record of the run, no upload in progress and no code waiting for a start, the run never started. Before the job goes back to the queue, the coordinator fences that remote id on the machine: the runner records it as refused and deletes any code it holds for it, so an upload or a start that the old coordinator still sends late gets a 409 and never runs (an old coordinator that sees the refusal drops the job). If the run did start in the meantime, the runner says so and the run is adopted instead. Once the fence is acknowledged, the job goes back to the queue at once with the outcome `not_started`. Like a drained attempt, it does not count toward `max_attempts`, and the next attempt gets a new remote id; a job whose runs fail to start more than twice `max_attempts` times fails with every reason listed. If the machine lists its jobs but the fence does not get through, nothing is requeued early: the job waits as long as an upload could take, as before. If code for the run is still arriving, the coordinator waits for it. While it waits it sends the machine a keepalive every tick, so the machine does not reach `idle_timeout` with that run still undecided.
|
|
166
|
+
|
|
167
|
+
After a takeover by a host whose pool is different (another computer, a new state directory), a job running on a machine the new coordinator cannot see waits until that attempt's deadline plus a grace before it runs again, because destroying or reaching the machine is the only way to be sure the first run is over.
|
|
168
|
+
|
|
169
|
+
`gpu sweep` and the sweep timer know about pool machines: with a dead coordinator, a stopped machine still ends in a destroy, with finished jobs' outputs saved first, and a pool machine is never treated as an orphan.
|
|
170
|
+
|
|
171
|
+
## Observing it
|
|
172
|
+
|
|
173
|
+
Every decision is an event in `.gpu/logs/events.jsonl`; metrics are in `.gpu/queue/metrics.prom` and on `/metrics`; the auditor checks the guarantees. `gpu queue stats` shows the metrics as of the coordinator's last tick; `gpu queue audit [--repair]` runs the auditor (exit 1 while a violation remains).
|
|
174
|
+
|
|
175
|
+
| Concern | Events | Metrics | Invariant or alert |
|
|
176
|
+
| --- | --- | --- | --- |
|
|
177
|
+
| Coordinator | `coordinator_started`, `coordinator_lease_acquired`, `coordinator_lease_lost`, `coordinator_stopped` | `gpu_queue_coordinator_heartbeat_age_seconds`, `gpu_queue_lease_renew_failures_total` | I7 lease fresh |
|
|
178
|
+
| Machines | `pool_machine_requested`, `_ready`, `_unhealthy`, `_unresponsive`, `_gone`, `_retired` | `gpu_pool_machines{state}`, `gpu_pool_cold_start_seconds`, `gpu_pool_health_failures_total` | I4 no orphan machine |
|
|
179
|
+
| Deadlines | `pool_deadline_extended`, `instance_destroyed reason=deadline` | `gpu_pool_deadline_remaining_seconds{slot}` | remaining below 0 with a job running |
|
|
180
|
+
| Retries | `queue_job_retried`, `queue_job_dead` | `gpu_queue_attempts_total{outcome}`, `gpu_queue_retries_total{cause}` | retry rate |
|
|
181
|
+
| Ownership | `queue_job_claimed`, `queue_lease_expired`, `queue_stale_write_refused` | `gpu_queue_stale_writes_total` | I1 every running job is on a live machine; I2 no job on two machines |
|
|
182
|
+
| State | `queue_invariant_violated` | `gpu_queue_invariant_violations_total{code}` | any violation |
|
|
183
|
+
| Outputs | `queue_outputs_stored`, `queue_outputs_delivery_failed`, `queue_outputs_lost` | `gpu_queue_outputs_pending`, `gpu_queue_outputs_oldest_pending_seconds`, `gpu_queue_outputs_bytes_total` | I3 manifests verify; I8 outputs stored |
|
|
184
|
+
| Latency | `queue_job_submitted`, `queue_job_started`, `queue_job_succeeded`, `queue_job_failed` | `gpu_queue_depth`, `gpu_queue_oldest_queued_seconds`, `gpu_queue_job_wait_seconds`, `gpu_queue_job_run_seconds` | I6 no job past its deadline plus grace |
|
|
185
|
+
| Money | `pool_scale_decision`, `pool_cap_blocked`, `queue_preflight_rejected` | `gpu_pool_usd_per_hour`, `gpu_pool_spend_usd_total`, `gpu_queue_job_cost_usd` | I5 spend within `max_usd_per_hour` |
|
|
186
|
+
| Who and what | `queue_job_submitted` (submitted_by), `queue_control` (action, actor) | `gpu_queue_jobs_total{final_state}` | the audit trail is append-only |
|
|
187
|
+
| Control | `queue_control` | `gpu_queue_paused` | pause honored within one tick |
|
|
188
|
+
|
|
189
|
+
The invariants: I1 running job without a machine, I2 duplicate execution, I3 outputs unverified, I4 orphan machine, I5 spend over the cap, I6 job past its deadline, I7 stale coordinator, I8 outputs not stored.
|
|
190
|
+
|
|
191
|
+
## Alerts
|
|
192
|
+
|
|
193
|
+
Page someone when any of these holds:
|
|
194
|
+
|
|
195
|
+
- the coordinator heartbeat age is more than 3 ticks;
|
|
196
|
+
- any invariant violation (`gpu_queue_invariant_violations_total` rises, or `gpu queue audit` exits 1);
|
|
197
|
+
- the oldest pending output delivery is older than 10 minutes;
|
|
198
|
+
- the retry rate is above 20% over 1 hour (`gpu_queue_retries_total` leaves out attempts sent back by `drain --now` and runs that never started, which are not failures);
|
|
199
|
+
- the pool's spend is at or above 90% of `max_usd_per_hour`;
|
|
200
|
+
- the oldest queued job is older than 2 × `scale_up_after` plus the cold start p50 while `blocked_by` is set (the last `pool_scale_decision` says which cap: `max_machines`, `max_usd_per_hour`, `no_offer` or `backoff`).
|
|
201
|
+
|
|
202
|
+
## What can go wrong
|
|
203
|
+
|
|
204
|
+
| Symptom | What it means |
|
|
205
|
+
| --- | --- |
|
|
206
|
+
| Jobs stay queued and `blocked_by` is `no_offer` or `backoff` | The provider has no matching capacity. Jobs wait, they do not fail, and the opening of machines backs off up to 5 minutes |
|
|
207
|
+
| A job is `delivering` for a long time | The output store is unreachable or the manifest does not verify. Nothing is marked delivered; it retries. The machine's outputs are held |
|
|
208
|
+
| The queue looks empty after a `gpu.yaml` edit | The Redis keyspace followed the config fingerprint. Set `queue.namespace` |
|
|
209
|
+
| `gpu queue status` says no coordinator holds the lease | Start `gpu queue run` (or enable the service). Machines already running end by their deadlines |
|
|
210
|
+
| Exit 4 from a `gpu queue` command | The queue or its output store is unreachable; the message names it, without the password |
|
|
211
|
+
|
|
212
|
+
## Limits of this version
|
|
213
|
+
|
|
214
|
+
- Redis must be 5 or newer and a single node. Redis Cluster is not supported (its atomic steps are Lua scripts over several keys).
|
|
215
|
+
- One pool per project: one `gpu.yaml`, one provider, one kind of card. No priorities, schedules or job dependencies.
|
|
216
|
+
- It is for batch work, not for autoscaling a live model endpoint.
|
|
217
|
+
- There is no Jambu server. The queue and the store are ones you run or rent.
|
|
@@ -108,6 +108,10 @@ 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
|
+
## Queue mode
|
|
112
|
+
|
|
113
|
+
For an application that sends jobs over the day, `gpu queue submit` puts a job directory in a queue and a coordinator (`gpu queue run`) opens and closes machines for it, retries a job on another machine when one dies, and keeps its verified outputs, within the machine and hourly-spend caps you set. It works with any provider, and the queue can be a local file or Redis. See [QUEUE.md](QUEUE.md).
|
|
114
|
+
|
|
111
115
|
## Serve any model
|
|
112
116
|
|
|
113
117
|
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.
|
|
@@ -119,7 +123,7 @@ gpu init --model BAAI/bge-m3 # embeddings -> /v1/embeddings
|
|
|
119
123
|
gpu setup && eval "$(gpu env)" # OPENAI_BASE_URL, OPENAI_API_KEY, JAMBU_MODEL_ID
|
|
120
124
|
```
|
|
121
125
|
|
|
122
|
-
Requests count as activity, so the machine stays up while clients call it and stops by itself once they stop.
|
|
126
|
+
Requests count as activity, so the machine stays up while clients call it and stops by itself once they stop. With the `hf` and `custom` engines, pointing `model.id` at another model and running `gpu setup` again swaps the model on the same GPU, with no new rental. With `vllm` and `llama` the model is fixed when the machine is created, so a new `model.id` needs `gpu setup --recreate`, which replaces the machine. 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
127
|
|
|
124
128
|
## Use any GPU provider
|
|
125
129
|
|
|
@@ -174,14 +178,17 @@ A full example is [`gpu.example.yaml`](gpu.example.yaml). `gpu ls` shows every m
|
|
|
174
178
|
|
|
175
179
|
## Docs
|
|
176
180
|
|
|
181
|
+
- [Claude Code on your own model, step by step (pt-BR)](docs/RUNBOOK.md)
|
|
177
182
|
- [Letting a coding agent rent GPUs (Claude Code, Codex, Gemini CLI, Cursor, Claude Desktop)](docs/AGENTS.md)
|
|
178
183
|
- [Integrating into an application (any language)](docs/INTEGRATION.md)
|
|
179
184
|
- [Running your own code as a job](JOBS.md)
|
|
185
|
+
- [Queue mode: jobs on a pool of GPUs](QUEUE.md)
|
|
180
186
|
- [Commands, workloads, and agents](docs/USAGE.md)
|
|
181
187
|
- [Every config field](docs/CONFIG.md)
|
|
182
188
|
- [Choosing a model](docs/CHOOSING_A_MODEL.md)
|
|
183
189
|
- [How shutdown works](docs/LIFECYCLE.md)
|
|
184
190
|
- [Adding a provider](docs/ADDING_A_PROVIDER.md), and [the steps for an agent](PROVIDERS.md)
|
|
191
|
+
- [Engineering dossier: how it works, what failed and what changed, known limits, each statement cited to the code](docs/engineering/dossier.md)
|
|
185
192
|
|
|
186
193
|
## Coming from `jambu-gpu`
|
|
187
194
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Weight-fetch benchmark
|
|
2
|
+
|
|
3
|
+
Measures how fast a rented Vast machine gets model weights from Hugging Face: with `gpu4agents/watchdog/fetch_ext.py`, and with the downloads vLLM and llama.cpp do on their own. It backs the numbers in [docs/engineering/fast-provisioning.md](../../docs/engineering/fast-provisioning.md).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
cp ../../gpu4agents/watchdog/fetch_ext.py . # the job imports it
|
|
7
|
+
gpu offers # show the card and price, get a yes
|
|
8
|
+
gpu setup --offer <id>
|
|
9
|
+
gpu job run # about 30 minutes
|
|
10
|
+
gpu destroy --confirm
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The results land in `gpu-outputs/<job id>/results.json`.
|
|
14
|
+
|
|
15
|
+
## Results, 2026-11-21
|
|
16
|
+
|
|
17
|
+
Two Vast hosts, about $1.20 in all. The raw numbers are in `results-2026-11-21.json`.
|
|
18
|
+
|
|
19
|
+
| Download | A100 SXM4, 864 Mbps advertised | Quadro RTX 8000, 7988 Mbps advertised |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| 27.5 GB GGUF, one connection (llama.cpp `-hf`) | 67 MB/s | 119 MB/s |
|
|
22
|
+
| 27.5 GB GGUF, fetcher, 32 connections | 117 MB/s | 446 MB/s |
|
|
23
|
+
| 55.6 GB safetensors, fetcher, 32 connections | 100 MB/s | 439 MB/s |
|
|
24
|
+
| 55.6 GB safetensors, `huggingface_hub` 2.2.0 + `hf_xet` 1.7.0 (vLLM) | 112 MB/s | 1065 MB/s |
|
|
25
|
+
|
|
26
|
+
On the slow host the link caps every method at about 110 MB/s. On the fast host, `hf_xet` beats the fetcher, and the fetcher beats a single connection by 3.7 times. That is why `runtime.fetch: auto` uses the fetcher for llama.cpp only.
|