-
Notifications
You must be signed in to change notification settings - Fork 17
feat(nemo-agents): adding agent.yaml to FabricConfig translation #701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mmogallapalli
merged 10 commits into
main
from
mmogallapall/aircore-896-define-platform-owned-fabric-agent-config-and-fabricconfig
Jul 16, 2026
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fe28178
updating descriptions and adding constants
mmogallapalli f235142
adding config format, translation, and validation
mmogallapalli 7999587
adding dep todos
mmogallapalli 2392f11
adding config loading
mmogallapalli 4d7ac3a
cleanup and examples
mmogallapalli 600e573
lint
mmogallapalli d5f2531
addressing feedback
mmogallapalli 8aea23b
addressing feedback
mmogallapalli 9509d2d
lint
mmogallapalli 5f5a2e5
feedback
mmogallapalli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: test-agent | ||
| description: Test agent config | ||
|
|
||
| default_harness: hermes | ||
|
|
||
| harnesses: | ||
| hermes: | ||
| kind: hermes | ||
| model: | ||
| provider: nvidia | ||
| model: nvidia/nemotron-3-nano-30b-a3b | ||
| api_key_env: NVIDIA_API_KEY | ||
| temperature: 0.0 | ||
| settings: | ||
| base_url: https://integrate.api.nvidia.com/v1 | ||
| max_iterations: 1 | ||
| max_tokens: 512 | ||
| reasoning_config: | ||
| effort: none | ||
| enabled_toolsets: [] | ||
| system_prompt: You are a concise test assistant. | ||
| codex: | ||
| kind: codex | ||
| settings: | ||
| sandbox: workspace-write | ||
| skip_git_repo_check: true | ||
| config_overrides: | ||
| model_reasoning_effort: high | ||
|
|
||
| models: | ||
| default: | ||
| provider: openai | ||
| model: openai/gpt-5.4 | ||
|
|
||
| prompts: | ||
| system: prompts/system.md | ||
|
|
||
| skills: | ||
|
|
||
| environment: | ||
| workspace: ./workspace | ||
| artifacts: ./artifacts | ||
|
|
||
| telemetry: | ||
| enabled: false | ||
| provider: relay | ||
| output_dir: ./artifacts/relay | ||
| project: test-agent |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
plugins/nemo-agents/src/nemo_agents_plugin/agent_config.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Platform-owned agent.yaml config models for NeMo Agents. | ||
|
|
||
| These models back Agent.config when config_format is nemo-agents-spec-v1. | ||
| RFC122 proposes first-class environment_spec, sandbox_spec, and harness_spec | ||
| fields on Agent; until those shapes are finalized, this config keeps those | ||
| inputs together in the versioned Agent.config payload and can be migrated once | ||
| the RFC122 contract lands. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
| from typing import Any, Self | ||
|
|
||
| import yaml | ||
| from nemo_agents_plugin.entities import AGENT_CONFIG_FILENAME | ||
| from pydantic import BaseModel, ConfigDict, Field, ValidationError, model_validator | ||
|
|
||
|
|
||
| class AgentConfigLoadError(ValueError): | ||
| """Raised when a Platform-owned agent.yaml cannot be loaded.""" | ||
|
|
||
|
|
||
| class ModelConfig(BaseModel): | ||
| model_config = ConfigDict(extra="forbid") | ||
|
|
||
| provider: str | ||
| model: str | ||
| api_key_env: str | None = None | ||
| temperature: float | None = None | ||
| settings: dict[str, Any] = Field(default_factory=dict) | ||
|
|
||
|
|
||
| class HarnessConfig(BaseModel): | ||
| model_config = ConfigDict(extra="forbid") | ||
|
|
||
| kind: str | ||
| model: ModelConfig | None = None | ||
| settings: dict[str, Any] = Field(default_factory=dict) | ||
|
|
||
|
|
||
| class EnvironmentConfig(BaseModel): | ||
| model_config = ConfigDict(extra="forbid") | ||
|
|
||
| provider: str = "local" | ||
| workspace: str = "./workspace" | ||
| artifacts: str = "./artifacts" | ||
| settings: dict[str, Any] = Field(default_factory=dict) | ||
|
|
||
|
|
||
| class TelemetryConfig(BaseModel): | ||
| model_config = ConfigDict(extra="forbid") | ||
|
|
||
| enabled: bool = False | ||
| provider: str | None = None | ||
| output_dir: str | None = None | ||
| project: str | None = None | ||
| atif: dict[str, Any] | None = None | ||
| atof: dict[str, Any] | None = None | ||
|
|
||
|
|
||
| class AgentConfig(BaseModel): | ||
| """Platform-owned agent.yaml config for nemo-agents-spec-v1.""" | ||
|
|
||
| model_config = ConfigDict(extra="forbid") | ||
|
|
||
| name: str | ||
| description: str = "" | ||
| default_harness: str | ||
| harnesses: dict[str, HarnessConfig] | ||
| models: dict[str, ModelConfig] = Field(default_factory=dict) | ||
| prompts: dict[str, str] = Field(default_factory=dict) | ||
| skills: dict[str, Any] | list[Any] | None = None | ||
| environment: EnvironmentConfig = Field(default_factory=EnvironmentConfig) | ||
| telemetry: TelemetryConfig = Field(default_factory=TelemetryConfig) | ||
|
|
||
| @model_validator(mode="after") | ||
| def _validate_default_harness(self) -> Self: | ||
| if self.default_harness not in self.harnesses: | ||
| available = ", ".join(sorted(self.harnesses)) | ||
| raise ValueError(f"default_harness must reference one of harnesses: {available}") | ||
| return self | ||
|
|
||
|
|
||
| def load_agent_config(path: str | Path) -> AgentConfig: | ||
| """Load a Platform-owned agent.yaml file as an AgentConfig.""" | ||
| config_path = Path(path) | ||
|
|
||
| try: | ||
| raw_config = config_path.read_text(encoding="utf-8") | ||
| except OSError as error: | ||
| raise AgentConfigLoadError(f"Unable to read agent config {config_path}: {error}") from error | ||
| except UnicodeDecodeError as error: | ||
| raise AgentConfigLoadError(f"Agent config {config_path} is not valid UTF-8: {error}") from error | ||
|
|
||
| try: | ||
| data = yaml.safe_load(raw_config) | ||
| except yaml.YAMLError as error: | ||
| raise AgentConfigLoadError(f"YAML parse error in agent config {config_path}: {error}") from error | ||
|
|
||
| if not isinstance(data, dict): | ||
| raise AgentConfigLoadError(f"Agent config {config_path} root must be a YAML mapping.") | ||
|
|
||
| try: | ||
| return AgentConfig.model_validate(data) | ||
| except ValidationError as error: | ||
| raise AgentConfigLoadError(f"Invalid agent config {config_path}: {error}") from error | ||
|
|
||
|
|
||
| def load_agent_config_from_dir(agent_dir: str | Path) -> AgentConfig: | ||
| """Load the canonical agent.yaml file from an agent directory.""" | ||
| return load_agent_config(Path(agent_dir) / AGENT_CONFIG_FILENAME) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
plugins/nemo-agents/src/nemo_agents_plugin/fabric/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Fabric Config Boundary | ||
|
|
||
| This package contains the Platform-side config and translation helpers for | ||
| Fabric-backed NeMo Agents. | ||
|
|
||
| NeMo Platform owns the persisted agent contract. A Fabric-backed agent is stored | ||
| using the Platform-owned `nemo-agents-spec-v1` config shape, authored as | ||
| `agent.yaml` in the agent spec fileset and represented in code as `AgentConfig`. | ||
|
|
||
| Fabric is an execution dependency, not the persisted Platform contract. Before | ||
| calling Fabric SDK APIs, NeMo Agents translates the Platform-owned config into a | ||
| typed in-memory `FabricConfig`. | ||
|
|
||
| ```text | ||
| Platform agent.yaml -> AgentConfig -> FabricConfig | ||
| ``` | ||
|
|
||
| `agent.yaml` is not treated as a Fabric SDK file-backed config or profile. The | ||
| Platform config may keep product concepts, defaults, and artifact references in | ||
| the shape NeMo Platform needs, while the Fabric translator owns the mapping into | ||
| Fabric's runtime fields such as harness adapter, model, environment, and | ||
| telemetry config. |
4 changes: 4 additions & 0 deletions
4
plugins/nemo-agents/src/nemo_agents_plugin/fabric/__init__.py
|
mmogallapalli marked this conversation as resolved.
Outdated
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Fabric integration helpers for NeMo Agents.""" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.