Skip to content

feat(inference): add declarative DGX Spark llama.cpp profile - #8224

Merged
ericksoa merged 4 commits into
mainfrom
feat/llamacpp-spark-express-proof-8173
Aug 4, 2026
Merged

feat(inference): add declarative DGX Spark llama.cpp profile#8224
ericksoa merged 4 commits into
mainfrom
feat/llamacpp-spark-express-proof-8173

Conversation

@ericksoa

@ericksoa ericksoa commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an explicit-only DGX Spark llama.cpp profile for NVIDIA Nemotron to the canonical managed-inference YAML catalog. Preserve the automatic vLLM profile and exclude host-local recipes from the active managed-cluster runtime until later lifecycle and qualification slices land.

Related Issue

Fixes #8173

Changes

  • Add one DGX Spark preset and one llama.cpp recipe with immutable server, CUDA, GGUF, model, license, resource, and serving values. The catalog compiler and shipped-catalog contract tests validate these definitions.
  • Extend the typed llama.cpp schema with declarative loopback exposure, bearer authentication, image size, batching, flash attention, KV cache, and speculative-decoding controls. Schema and semantic tests reject missing or contradictory settings.
  • Load the complete backend-polymorphic catalog, then project only registered vLLM recipes into the existing managed-cluster consumer. The projection filters source provenance and recomputes its catalog digest so existing vLLM materialization keeps its integrity guarantee; direct and public-entrypoint tests protect the boundary.
  • Record the source hierarchy, exact artifact decisions, qualification evidence, and launch-credit requirement in [Managed inference] Add declarative llama.cpp serving recipes and presets #8173.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification: The profile is explicit-only and excluded from the active managed-cluster runtime. This PR adds no user-facing install workflow or supported surface.
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification:
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: Commit df13c021e resolves the writing findings. The profile remains explicit-only and excluded from the active managed-cluster runtime, so this PR adds no user-facing workflow to document.
  • Agent: Codex Desktop

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: 76 focused schema/compiler/loader CLI tests and 6 integration catalog contract tests passed. The 160 tests in the four previously failing CLI shards now pass, as does the isolated Station known-hosts test; npm run build:cli and npm run validate:pr passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: npm run build:cli passed. No broad runtime or repository-wide validation surface changed.
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Aaron Erickson aerickson@nvidia.com

Summary by CodeRabbit

  • New Features

    • Added support for running NVIDIA Nemotron 3 Nano 30B-A3B locally with llama.cpp on a single DGX Spark.
    • Added host-local serving with Linux ARM64, Docker, NVIDIA GPU, bearer authentication, readiness checks, and configurable performance settings.
    • Added compatibility checks for supported hardware and GPU driver versions.
  • Bug Fixes

    • Improved catalog handling to keep host-local options separate from managed-cluster offerings.
  • Validation

    • Added stricter validation for loopback networking, batching, caching, attention, and speculative decoding settings.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa self-assigned this Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9d8f2660-e0cc-467f-bb3a-3e9486988b18

📥 Commits

Reviewing files that changed from the base of the PR and between aedbeb2 and df13c02.

📒 Files selected for processing (1)
  • src/lib/inference/serving/catalog-loader.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/inference/serving/catalog-loader.test.ts

📝 Walkthrough

Walkthrough

Adds a declarative Nemotron 3 Nano llama.cpp recipe and explicit DGX Spark preset. Extends llama.cpp contracts, schema validation, readiness matching, adapter registries, catalog loading, managed-catalog projection, and compiler coverage.

Changes

llama.cpp serving integration

Layer / File(s) Summary
llama.cpp contracts and validation
src/lib/inference/serving/types.ts, managed-inference/schemas/recipe.schema.json, src/lib/inference/serving/catalog.ts, src/lib/inference/serving/catalog.test.ts
Exports LlamaCppServingRecipe. Adds required runtime and serving controls. Rejects unsupported fields and invalid batching or readiness values. Tests cover compilation and rejection cases.
Nemotron recipe and DGX Spark preset
managed-inference/recipes/..., managed-inference/presets/..., src/lib/inference/serving/adapter-registry.ts
Adds pinned Nemotron model and llama.cpp runtime settings, authenticated serving, readiness probes, disabled surfaces, supported capabilities, explicit-only DGX Spark selection, and host-local adapter references.
Serving catalog loading and managed projection
src/lib/inference/serving/catalog-loader.ts, src/lib/inference/serving/catalog-loader.test.ts
Separates full serving-catalog caching from managed-catalog projection. Filters managed definitions, recalculates the digest, validates the projection, and adds recipe and preset lookup APIs.
Compiled catalog integration coverage
test/managed-inference-catalog-compiler.test.ts
Verifies the shipped llama.cpp profile, pinned artifacts, arm64 requirements, explicit-only selection, serving settings, and continued automatic vLLM selection.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant compiledServingCatalog as compiled serving catalog
  participant catalogLoader as catalog loader
  participant managedProjection as managed catalog projection
  participant servingAPI as serving lookup API
  compiledServingCatalog->>catalogLoader: load and cache full catalog
  catalogLoader->>managedProjection: select managed vLLM definitions
  managedProjection->>managedProjection: filter, recalculate digest, validate
  servingAPI->>catalogLoader: request recipe or preset by ID
  catalogLoader-->>servingAPI: return compiled definition
Loading

Possibly related PRs

Suggested labels: area: inference, area: local-models, feature, platform: dgx-spark, v0.0.102

Suggested reviewers: apurvvkumaria

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.56% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding a declarative DGX Spark llama.cpp inference profile.
Linked Issues check ✅ Passed The YAML, schema, compiler, registry, loader, and tests implement the explicit-only DGX Spark llama.cpp slice and preserve the vLLM projection [#8173].
Out of Scope Changes check ✅ Passed All changes support the linked issue, and no unrelated runtime workflow, download, launch, onboarding, or product support was added.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/llamacpp-spark-express-proof-8173

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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Failed after a partial review · low confidence · 0 blockers · 0 warnings · 0 suggestions

Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

1 semantic terminology decision

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • established — host-local at src/lib/inference/serving/catalog-loader.test.ts:117: Retain `host-local`; existing repository usage establishes this host-versus-managed-cluster distinction.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: inference-routing, network-policy

1 optional E2E recommendation
  • spark-install

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/lib/inference/serving/catalog-loader.test.ts (1)

99-111: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Test retention of a managed definition.

This test only proves that an all-host-local catalog becomes empty. A predicate that removes every recipe and preset would also pass.

Add one registered vLLM recipe and preset to this fixture. Assert that the managed definition remains while HOST_LOCAL_RECIPE and HOST_LOCAL_PRESET are excluded.

As per path instructions, “Tests must prove that public entrypoints reach the new path and that the old path is deleted or cannot execute.”

🤖 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 `@src/lib/inference/serving/catalog-loader.test.ts` around lines 99 - 111,
Extend the test case around managedInferenceCatalogFromServingCatalog by adding
a registered vLLM recipe and preset alongside HOST_LOCAL_RECIPE and
HOST_LOCAL_PRESET. Assert that the managed catalog retains the registered
definitions while excluding both host-local definitions, and update the digest
assertion as needed to reflect the retained managed content.

Sources: Coding guidelines, Path instructions

🤖 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 `@managed-inference/schemas/recipe.schema.json`:
- Around line 1088-1102: Close the llama.cpp-specific schemas, including the
nested objects covered by the corresponding properties branch, so unsupported
generic fields are rejected at compile time. Update the compiler handling for
LlamaCppServingRecipe to reject bindings, execution.nodeCount,
runtime.networkMode, serve.executable, and each other generic-only field class
absent from the llama.cpp contract, while preserving the fixed single-host
profile.

In `@src/lib/inference/serving/catalog-loader.ts`:
- Around line 128-134: Add an entrypoint-level test in catalog-loader.test.ts
that calls loadManagedInferenceCatalog() and verifies host-local definitions
such as llama.cpp are excluded from the returned managed catalog. Keep the
existing direct projection test, and assert the filtering through the public
loader entrypoint rather than calling managedInferenceCatalogFromServingCatalog
directly.

---

Nitpick comments:
In `@src/lib/inference/serving/catalog-loader.test.ts`:
- Around line 99-111: Extend the test case around
managedInferenceCatalogFromServingCatalog by adding a registered vLLM recipe and
preset alongside HOST_LOCAL_RECIPE and HOST_LOCAL_PRESET. Assert that the
managed catalog retains the registered definitions while excluding both
host-local definitions, and update the digest assertion as needed to reflect the
retained managed content.
🪄 Autofix

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 26618257-fdcd-422e-add7-6feb8fe4dc4b

📥 Commits

Reviewing files that changed from the base of the PR and between 3835080 and 3f113d9.

📒 Files selected for processing (10)
  • managed-inference/presets/llama-cpp.dgx-spark-gb10.single.nemotron-3-nano-30b-a3b.yaml
  • managed-inference/recipes/llama-cpp.nemotron-3-nano-30b-a3b.spark-single.v1.yaml
  • managed-inference/schemas/recipe.schema.json
  • src/lib/inference/serving/adapter-registry.ts
  • src/lib/inference/serving/catalog-loader.test.ts
  • src/lib/inference/serving/catalog-loader.ts
  • src/lib/inference/serving/catalog.test.ts
  • src/lib/inference/serving/catalog.ts
  • src/lib/inference/serving/types.ts
  • test/managed-inference-catalog-compiler.test.ts

Comment thread managed-inference/schemas/recipe.schema.json
Comment thread src/lib/inference/serving/catalog-loader.ts
@github-code-quality

github-code-quality Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit df13c02 in the feat/llamacpp-spark-... branch remains at 96%, unchanged from commit efc3499 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit df13c02 in the feat/llamacpp-spark-... branch remains at 81%, unchanged from commit efc3499 in the main branch.

Show a code coverage summary of the most impacted files.
File main efc3499 feat/llamacpp-spark-... df13c02 +/-
src/lib/inferen...talog-loader.ts 89% 82% -7%
src/lib/shields/index.ts 69% 69% 0%
src/lib/inferen...y-production.ts 48% 48% 0%
src/lib/sandbox...rce-identity.ts 87% 87% 0%
src/lib/state/m...-acquisition.ts 75% 75% 0%
src/lib/credentials/store.ts 55% 56% +1%
src/lib/inferen...er-discovery.ts 87% 88% +1%
src/lib/inferen...ving/catalog.ts 87% 88% +1%
src/lib/inferen...ter-registry.ts 90% 92% +2%
src/lib/domain/.../connect-env.ts 89% 97% +8%

Updated August 04, 2026 14:35 UTC

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/inference/serving/catalog-loader.test.ts (1)

88-96: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Assert the complete projected definition sets.

expectOnlyManagedVllmDefinitions() checks only non-empty collections and backend labels. It does not verify that every managed vLLM recipe and preset is retained, that host-local definitions are absent, or that unrelated sources are removed. A projection regression can therefore pass both tests.

Assert the expected recipe, preset, and source ID sets from the fixtures. For the public loader test, compare the result with the expected projected catalog. Do not copy the production filter into the test.

As per path instructions, tests must prove observable behavior. The PR objective also requires retaining managed definitions and filtering their sources.

🤖 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 `@src/lib/inference/serving/catalog-loader.test.ts` around lines 88 - 96,
Expand expectOnlyManagedVllmDefinitions() to assert the exact recipe and preset
ID sets expected by the fixtures, ensuring all managed vLLM definitions are
retained and host-local definitions are excluded. Also assert the exact
projected source ID set, excluding unrelated sources, and update the public
loader test to compare its result with the expected projected catalog without
duplicating the production filtering logic.

Source: Path instructions

🤖 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.

Nitpick comments:
In `@src/lib/inference/serving/catalog-loader.test.ts`:
- Around line 88-96: Expand expectOnlyManagedVllmDefinitions() to assert the
exact recipe and preset ID sets expected by the fixtures, ensuring all managed
vLLM definitions are retained and host-local definitions are excluded. Also
assert the exact projected source ID set, excluding unrelated sources, and
update the public loader test to compare its result with the expected projected
catalog without duplicating the production filtering logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8848862c-602d-4e1c-904d-f2ae11d52057

📥 Commits

Reviewing files that changed from the base of the PR and between 3f113d9 and aedbeb2.

📒 Files selected for processing (4)
  • managed-inference/schemas/recipe.schema.json
  • src/lib/inference/serving/catalog-loader.test.ts
  • src/lib/inference/serving/catalog-loader.ts
  • src/lib/inference/serving/catalog.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/inference/serving/catalog-loader.ts

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@wscurran wscurran added area: inference Inference routing, serving, model selection, or outputs area: local-models Local model providers, downloads, launch, or connectivity area: providers Inference provider integrations and provider behavior feature PR adds or expands user-visible functionality platform: dgx-spark Affects DGX Spark hardware or workflows labels Aug 4, 2026
@ericksoa
ericksoa merged commit c7f69a9 into main Aug 4, 2026
88 of 97 checks passed
@ericksoa
ericksoa deleted the feat/llamacpp-spark-express-proof-8173 branch August 4, 2026 15:19
@github-actions github-actions Bot added the v0.0.102 Release target label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: inference Inference routing, serving, model selection, or outputs area: local-models Local model providers, downloads, launch, or connectivity area: providers Inference provider integrations and provider behavior feature PR adds or expands user-visible functionality platform: dgx-spark Affects DGX Spark hardware or workflows v0.0.102 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Managed inference] Add declarative llama.cpp serving recipes and presets

2 participants