Skip to content

Update GPU Inference and Managed Model Selection - #72

Merged
PSchmiedmayer merged 38 commits into
mainfrom
feature/gpu-runtime-and-model-catalog
Jul 22, 2026
Merged

Update GPU Inference and Managed Model Selection#72
PSchmiedmayer merged 38 commits into
mainfrom
feature/gpu-runtime-and-model-catalog

Conversation

@PSchmiedmayer

@PSchmiedmayer PSchmiedmayer commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

♻️ Current situation & Problem

Heartwood's GPU runtime and managed-model metadata did not provide a reproducible CUDA 12.9 stack, platform-aware resource planning, or an end-to-end qualification gate for coding models.

Related: #25, #34, #42, #44, #49, #51, #53.

⚙️ Release Notes

  • Lock vLLM 0.25.1+cu129 with PyTorch 2.11.0+cu129 in an isolated, fully hashed runtime and prevent CUDA 13 dependency substitution.
  • Add one shared, revision-pinned model catalog for CLI, browser, and notebook use, with simple capability tiers and an arbitrary Hugging Face model path.
  • Add platform-aware Terra and Carina GPU detection, allocation planning, explicit download/allocation confirmations, and unsupported-hardware guards.
  • Add protected GPU qualification for direct inference, OpenHands tool calling, approval, file modification, verification, replay, and audit export.

The new platform configurations remain evaluation candidates until the exact released image and model revision pass the protected acceptance task on Terra T4 or Carina L40S hardware. Heartwood does not label or automatically select an unqualified candidate as recommended.

📚 Documentation

Adds a release-owned GPU compatibility matrix and expands the model, Terra, Carina, container, CLI, testing, and recovery guidance with pinned revisions, resource envelopes, expected download sizes, startup ranges, context defaults, tensor parallelism, and tool parsers.

✅ Testing

  • 777 passed with 90.08% Python coverage; Ruff, mypy, actionlint, shellcheck, yamllint, and strict documentation build pass.
  • Web format, lint, typecheck, 72 unit tests, production build, Playwright, gateway proxy, and Jupyter proxy smokes pass.
  • Generic and Terra-derived GPU images pass in-image vLLM/PyTorch/CUDA/tool-parser verification.
  • GPU lock reproduction and immutable Hugging Face source verification pass.
  • Native installer contract tests and a clean Ubuntu 24.04 installation with managed-inference smoke pass.

Live Terra and Carina model qualification requires their managed GPU environments and therefore remains gated by the protected workflow rather than claimed from CPU-only CI.

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copilot AI review requested due to automatic review settings July 21, 2026 08:25
@github-project-automation github-project-automation Bot moved this to Backlog in Heartwood Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds GPU compatibility manifests, CUDA 12.9 runtime verification, pinned vLLM dependencies, GPU and Slurm capacity discovery, qualified model selection, and tensor-parallel launch planning. It introduces shared coding-agent acceptance scripts with direct inference, approval handling, replay, audit verification, and qualification reports. Model catalogs and persisted selections gain expanded metadata and schema v2 support. CLI and Web UI downloads now require explicit confirmation, while workflows collect qualification artifacts and documentation describes the new GPU compatibility and runtime paths.

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant SessionGateway
  participant GPUEnvironment
  participant ModelCatalog
  participant VLLMRuntime
  CLI->>SessionGateway: request managed model plan
  SessionGateway->>GPUEnvironment: inspect visible GPUs or Slurm capacity
  SessionGateway->>ModelCatalog: recommend qualified compatible snapshot
  ModelCatalog-->>SessionGateway: model configuration and resource requirements
  SessionGateway-->>CLI: launch plan and download requirement
  CLI->>VLLMRuntime: start tensor-parallel vLLM runtime
  VLLMRuntime-->>CLI: health readiness
Loading

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes around GPU inference and managed model selection.
Description check ✅ Passed The description clearly matches the changeset and covers the runtime, catalog, GPU planning, qualification, and documentation updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (3)
documentation/reference/glossary.md (2)

75-80: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Maintain alphabetical order in the glossary.

As per coding guidelines, glossary entries should be kept roughly alphabetical. Tensor parallelism (T-e-n) should appear before Terra (T-e-r).

♻️ Proposed fix to reorder entries
-**Terra**
-: A cloud platform for biomedical research workspaces, data, workflows, and interactive Jupyter compute.
-
 **Tensor parallelism**
 : A runtime layout that divides one model across a fixed number of GPUs.
 
+**Terra**
+: A cloud platform for biomedical research workspaces, data, workflows, and interactive Jupyter compute.
+
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@documentation/reference/glossary.md` around lines 75 - 80, Reorder the
glossary entries so “Tensor parallelism” appears before “Terra,” preserving the
existing entry text and formatting.

Source: Coding guidelines


30-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Maintain alphabetical order in the glossary.

As per coding guidelines, glossary entries should be kept roughly alphabetical. CUDA (C-u) should appear after Credential binding (C-r).

♻️ Proposed fix to reorder entries
-**CUDA**
-: NVIDIA's software platform and application binary interface for GPU computing.
-
 **Credential binding**
 : A non-secret identifier that tells Heartwood where an authorized process or platform supplies a provider credential.
 
+**CUDA**
+: NVIDIA's software platform and application binary interface for GPU computing.
+
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@documentation/reference/glossary.md` around lines 30 - 34, Reorder the
glossary entries so “Credential binding” appears before “CUDA,” preserving the
existing definitions and formatting.

Source: Coding guidelines

packages/gateway/src/heartwood/gateway/_gateway.py (1)

843-845: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Consider memoizing the GPU inventory to avoid blocking subprocesses on hot paths.

gpu_environment() runs inspect_gpu_environment, which shells out to nvidia-smi (10s timeout) and, on Carina login nodes, sinfo (15s timeout). This executes on every model_artifacts() call (Line 774) and again on the vLLM-availability fallback in _local_model_choice_dict (gpu_environment or self.gpu_environment()), reached from inspect_model_repository (Line 909) and _require_local_model_runtime (Line 1475, only to build an error message). Hardware/scheduler inventory is effectively static within a gateway lifetime, so repeated synchronous discovery adds avoidable latency to interactive model-listing requests.

Caching the result per gateway instance (with an explicit refresh if needed) would keep listing responsive.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/gateway/src/heartwood/gateway/_gateway.py` around lines 843 - 845,
Memoize the result of gpu_environment() per gateway instance so repeated
model_artifacts(), _local_model_choice_dict(), inspect_model_repository(), and
_require_local_model_runtime() calls reuse the discovered inventory instead of
rerunning blocking subprocesses. Add an explicit refresh mechanism that
invalidates and recomputes the cached GpuEnvironment when requested, while
preserving the existing inspect_gpu_environment inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@images/generic/scripts/verify_coding_agent_e2e.py`:
- Around line 93-94: Update the tool execution validation using the existing
event.payload access so a missing exit_code defaults to 0 before comparing
against the failure value. Preserve raising ValueError for explicitly nonzero
exit codes while allowing successful executions that omit exit_code.
- Around line 147-154: Update the artifact_path handling before the
sensitive-value validation loop so the path is resolved to an absolute path,
then use its resolved parent directory when checking audit_text. Preserve the
existing checks for the task-content strings and the unsanitized-content
ValueError.

In `@packages/cli/src/heartwood/cli/__init__.py`:
- Around line 430-435: Update the combined validation error in the
argument-validation flow to remove --cpus from its message, since --cpus is
handled by its own check. Keep the validation condition for --startup-timeout
and --port unchanged and report only those options in the associated
parser.error message.

In `@packages/gateway/src/heartwood/gateway/_project_config.py`:
- Around line 716-717: Update the catalog_source fallback in the project
configuration construction to use "catalog" instead of the superseded
"recommended" value. Keep it consistent with LocalModelSelection.validate(), the
dataclass default, and select_local_model’s default, without retaining a
compatibility path for "recommended".

---

Nitpick comments:
In `@documentation/reference/glossary.md`:
- Around line 75-80: Reorder the glossary entries so “Tensor parallelism”
appears before “Terra,” preserving the existing entry text and formatting.
- Around line 30-34: Reorder the glossary entries so “Credential binding”
appears before “CUDA,” preserving the existing definitions and formatting.

In `@packages/gateway/src/heartwood/gateway/_gateway.py`:
- Around line 843-845: Memoize the result of gpu_environment() per gateway
instance so repeated model_artifacts(), _local_model_choice_dict(),
inspect_model_repository(), and _require_local_model_runtime() calls reuse the
discovered inventory instead of rerunning blocking subprocesses. Add an explicit
refresh mechanism that invalidates and recomputes the cached GpuEnvironment when
requested, while preserving the existing inspect_gpu_environment inputs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f5762379-d423-4db1-a9c4-e71c53114b93

📥 Commits

Reviewing files that changed from the base of the PR and between bfcce75 and 2074931.

📒 Files selected for processing (72)
  • .github/workflows/container-smoke.yml
  • .github/workflows/create-release.yml
  • .github/workflows/dependency-review.yml
  • .github/workflows/gpu-container-image.yml
  • .github/workflows/main-validation.yml
  • .github/workflows/validate.yml
  • AGENTS.md
  • deploy/carina/bootstrap.sh
  • deploy/tests/native_installer_smoke.sh
  • deploy/verify_gpu_compatibility.py
  • deploy/verify_model_sources.py
  • documentation/architecture/testing.md
  • documentation/models/choose-managed.md
  • documentation/models/run-with-heartwood.md
  • documentation/operate/index.md
  • documentation/platforms/carina.md
  • documentation/platforms/containers.md
  • documentation/platforms/index.md
  • documentation/platforms/terra.md
  • documentation/reference/cli.md
  • documentation/reference/glossary.md
  • documentation/reference/gpu-compatibility.md
  • documentation/reference/troubleshooting.md
  • images/Dockerfile
  • images/generic/README.md
  • images/generic/local-runtime/snapshots.toml
  • images/generic/scripts/capable_model_e2e.sh
  • images/generic/scripts/coding_agent_e2e.sh
  • images/generic/scripts/verify_coding_agent_e2e.py
  • images/gpu/coding_agent_e2e.sh
  • images/gpu/compatibility.toml
  • images/gpu/heartwood-vllm
  • images/gpu/heartwood_vllm.py
  • images/gpu/install_runtime.sh
  • images/gpu/qualification_config.py
  • images/gpu/sitecustomize.py
  • images/gpu/start_vllm.sh
  • images/gpu/verify_runtime.sh
  • images/gpu/verify_vllm.py
  • images/gpu/vllm-exclusions.txt
  • images/gpu/vllm-overrides.txt
  • images/gpu/vllm-requirements.txt
  • images/gpu/vllm.in
  • images/platforms.toml
  • packages/cli/src/heartwood/cli/__init__.py
  • packages/cli/src/heartwood/cli/_launch.py
  • packages/cli/tests/test_carina_launch_integration.py
  • packages/cli/tests/test_cli.py
  • packages/cli/tests/test_launch.py
  • packages/compliance/tests/test_coding_agent_qualification.py
  • packages/compliance/tests/test_container_assets.py
  • packages/compliance/tests/test_model_source_verification.py
  • packages/gateway/src/heartwood/gateway/__init__.py
  • packages/gateway/src/heartwood/gateway/_gateway.py
  • packages/gateway/src/heartwood/gateway/_gpu_environment.py
  • packages/gateway/src/heartwood/gateway/_local_import.py
  • packages/gateway/src/heartwood/gateway/_local_models.py
  • packages/gateway/src/heartwood/gateway/_model_snapshots.py
  • packages/gateway/src/heartwood/gateway/_project_config.py
  • packages/gateway/tests/test_gateway_contract.py
  • packages/gateway/tests/test_gpu_environment.py
  • packages/gateway/tests/test_local_models.py
  • packages/gateway/tests/test_model_artifacts.py
  • packages/gateway/tests/test_model_snapshots.py
  • packages/gateway/tests/test_project_config.py
  • packages/gateway/tests/test_readiness.py
  • packages/webui/src/App.test.tsx
  • packages/webui/src/client.test.ts
  • packages/webui/src/components/UtilitySheet.tsx
  • packages/webui/src/e2e/app.spec.ts
  • packages/webui/src/types.ts
  • zensical.toml
💤 Files with no reviewable changes (3)
  • images/gpu/sitecustomize.py
  • images/gpu/heartwood_vllm.py
  • deploy/carina/bootstrap.sh

Comment thread images/generic/scripts/verify_coding_agent_e2e.py Outdated
Comment thread images/generic/scripts/verify_coding_agent_e2e.py
Comment thread packages/cli/src/heartwood/cli/__init__.py Outdated
Comment thread packages/gateway/src/heartwood/gateway/_project_config.py Outdated
@PSchmiedmayer

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI review requested due to automatic review settings July 21, 2026 15:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 21, 2026 17:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 21, 2026 17:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 21, 2026 17:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 21, 2026 17:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 21, 2026 19:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 21, 2026 19:25
Copilot AI review requested due to automatic review settings July 22, 2026 05:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 06:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 06:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 06:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 06:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 08:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 08:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 22, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@PSchmiedmayer
PSchmiedmayer merged commit 8a401fb into main Jul 22, 2026
29 checks passed
@PSchmiedmayer
PSchmiedmayer deleted the feature/gpu-runtime-and-model-catalog branch July 22, 2026 09:37
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Heartwood Jul 22, 2026
@PSchmiedmayer PSchmiedmayer self-assigned this Jul 24, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Aug 3, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants