Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2298,6 +2298,7 @@ jobs:
permissions:
contents: read
outputs:
agent_qualification_execution: ${{ steps.plan.outputs.agent_qualification_execution }}
environment: ${{ steps.plan.outputs.environment }}
execution: ${{ steps.plan.outputs.execution }}
model_host_path: ${{ steps.plan.outputs.model_host_path }}
Expand Down Expand Up @@ -2460,6 +2461,10 @@ jobs:
with:
build-cli: "false"

- name: Install OpenShell CLI for declarative OpenClaw qualification
if: ${{ needs.llama-cpp-dgx-spark-plan.outputs.agent_qualification_execution == 'enabled' }}
run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh

- name: Materialize trusted llama.cpp qualification plan
env:
CANDIDATE_ROOT: ${{ github.workspace }}/.candidate-llama-cpp
Expand Down Expand Up @@ -7515,8 +7520,6 @@ jobs:
if (!response.ok) {
core.setFailed(`Slack webhook returned ${response.status}`);
}


- name: Upload E2E runtime summary
if: ${{ always() && github.event_name == 'push' }}
uses: NVIDIA/NemoClaw/.github/actions/upload-e2e-artifacts@7768e15eb90d3ee2d33432f481dfe8747e4f6d57
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

apiVersion: nemoclaw.nvidia.com/managed-inference/v1
kind: AgentQualification

metadata:
id: llama-cpp.openclaw.spark-single.v1

spec:
execution: disabled
agent: openclaw
image:
reference: ghcr.io/nvidia/nemoclaw/openclaw-sandbox@sha256:3648441718cdd6c2bc4c8fe39fa0d04d3931656b2063af34215cc51841cd0d5e
sourceRevision: eb1d2f5700393892f227ac9fd56f485fc6718bce
runtimeProvider: docker
sandbox:
name: nemoclaw-llama-cpp-openclaw
gpuAccess: disabled
route:
provider: llama-cpp-local
api: openai-completions
routedBaseUrl: https://inference.local/v1
upstreamBaseUrl: http://host.openshell.internal:8081/v1
probes:
- synchronous-chat
- streaming-chat
- agent-normal-turn
- agent-tool-call
- agent-tool-result-continuation
- agent-multi-turn
bounds:
commandTimeoutSeconds: 420
maxResponseBytes: 16777216
maxStreamEvents: 512
maxTokens: 32
expectations:
normal: PONG
sessions:
normal: llama-cpp-openclaw-normal
tool: llama-cpp-openclaw-tool
prompts:
normal: "Reply with exactly one word: PONG"
tool: "Use the read tool to read /tmp/nemoclaw-llama-cpp-tool.txt. Reply with exactly the file contents: LLAMA_CPP_OPENCLAW_TOOL_OK"
continuation: "Repeat the exact value LLAMA_CPP_OPENCLAW_TOOL_OK from the file you read in the prior turn."
fixture:
path: /tmp/nemoclaw-llama-cpp-tool.txt
value: LLAMA_CPP_OPENCLAW_TOOL_OK
tool:
name: read
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ export function exportLlamaCppDgxSparkQualificationPlan(sourceRoot: string) {
) {
throw new Error("protected llama.cpp DGX Spark qualification is not enabled");
}
parseLlamaCppDgxSparkExecutionPlan(
const executionPlan = parseLlamaCppDgxSparkExecutionPlan(
JSON.parse(config.publication_qualification_plan) as unknown,
config.publication_qualification_plan_sha256,
);

return {
agent_qualification_execution: executionPlan.qualification.agentQualification.execution,
environment: qualification.environment,
execution: qualification.execution,
model_host_path: qualification.model.hostPath,
Expand All @@ -72,6 +73,9 @@ if (process.argv[1] === fileURLToPath(import.meta.url)) {
const output = githubOutput(exportLlamaCppDgxSparkQualificationPlan(args[1]));
const githubOutputPath = process.env.GITHUB_OUTPUT;
if (githubOutputPath)
fs.appendFileSync(githubOutputPath, output, { encoding: "utf8", mode: 0o600 });
fs.appendFileSync(githubOutputPath, output, {
encoding: "utf8",
mode: 0o600,
});
else process.stdout.write(output);
}
39 changes: 39 additions & 0 deletions scripts/checks/export-llama-cpp-image-config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Ajv2020 from "ajv/dist/2020.js";
import YAML from "yaml";

import {
LLAMA_CPP_DGX_SPARK_AGENT_QUALIFICATION_PATH,
LLAMA_CPP_DGX_SPARK_PROTOCOL_PROBES,
llamaCppDgxSparkExecutionPlanSha256,
parseLlamaCppDgxSparkExecutionPlan,
Expand Down Expand Up @@ -151,6 +152,7 @@ type LlamaCppQualificationRecipe = {
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(scriptDir, "../..");
const manifestPath = path.join(repoRoot, "managed-inference", "images", "llama-cpp", "image.yaml");
const agentQualificationPath = path.join(repoRoot, LLAMA_CPP_DGX_SPARK_AGENT_QUALIFICATION_PATH);
const recipePath = path.join(
repoRoot,
"managed-inference",
Expand Down Expand Up @@ -251,13 +253,48 @@ function parseImageManifest(source: string): ServerImageManifest {
return document.toJS({ maxAliasCount: 0 }) as ServerImageManifest;
}

function parseAgentQualificationDocument(source: string): unknown {
const document = YAML.parseDocument(source, {
strict: true,
uniqueKeys: true,
});
const issues = [...document.errors, ...document.warnings];
if (issues.length > 0) {
throw new Error(`invalid llama.cpp agent qualification YAML: ${issues.join("; ")}`);
}
const value = document.toJS({ maxAliasCount: 0 }) as unknown;
assertExactKeys(value, "agent qualification document", [
"apiVersion",
"kind",
"metadata",
"spec",
]);
const qualification = value as {
apiVersion?: unknown;
kind?: unknown;
metadata?: unknown;
spec?: unknown;
};
assertExactKeys(qualification.metadata, "agent qualification metadata", ["id"]);
if (
qualification.apiVersion !== "nemoclaw.nvidia.com/managed-inference/v1" ||
qualification.kind !== "AgentQualification" ||
(qualification.metadata as { id?: unknown }).id !== "llama-cpp.openclaw.spark-single.v1"
) {
throw new Error("invalid llama.cpp agent qualification identity");
}
return qualification.spec;
}

export function loadLlamaCppImageConfig(
source = fs.readFileSync(manifestPath, "utf8"),
recipeSource = fs.readFileSync(recipePath, "utf8"),
recipeSchemaSource = fs.readFileSync(recipeSchemaPath, "utf8"),
agentQualificationSource = fs.readFileSync(agentQualificationPath, "utf8"),
) {
const manifest = parseImageManifest(source);
const recipe = parseQualificationRecipe(recipeSource, recipeSchemaSource);
const agentQualification = parseAgentQualificationDocument(agentQualificationSource);
assertExactKeys(manifest, "manifest", ["apiVersion", "kind", "metadata", "spec"]);
assertExactKeys(manifest.metadata, "metadata", ["id"]);
assertExactKeys(manifest.spec, "spec", [
Expand Down Expand Up @@ -674,6 +711,7 @@ export function loadLlamaCppImageConfig(
},
},
qualification: {
agentQualification,
probeBounds: qualification?.probeBounds,
probes: qualification?.probes,
},
Expand Down Expand Up @@ -868,6 +906,7 @@ export function loadLlamaCppImageConfigFromRoot(sourceRoot: string) {
"managed-inference/recipes/llama-cpp.nemotron-3-nano-30b-a3b.spark-single.v1.yaml",
),
fs.readFileSync(recipeSchemaPath, "utf8"),
readBoundedRegularFile(root, LLAMA_CPP_DGX_SPARK_AGENT_QUALIFICATION_PATH),
);
}

Expand Down
Loading
Loading