Skip to navigation

1. Install One Harness

View as MarkdownOpen in Claude

Ask an agent to review a small Python function through NVIDIA NeMo Fabric. This package-based path uses LangChain Deep Agents and an NVIDIA-hosted model. It requires Python 3.11 or later and an NVIDIA API key; the Installation Overview describes supported platforms.

Run this Quickstart on Linux, macOS, or Windows using WSL2. On Windows, run all commands inside your WSL2 Linux environment.

This is the first of three connected quickstarts and an optional sandbox continuation. Keep first_agent.py and its configuration for the next two guides.

1

Install One Harness

Create an isolated application environment, then install NeMo Fabric and its supported Deep Agents adapter and dependencies. In your POSIX shell, run:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install 'nemo-fabric[deepagents]'

This example does not require the separate CLI or NeMo Relay.

2

Provide Model Access

Create an API key at NVIDIA Build and set it in the shell that will run the application:

export NVIDIA_API_KEY='<your-key>'

Keep the key out of the Python file.

3

Run a Code Review

Save this complete example as first_agent.py in your application directory. The request supplies the function inline and asks for a review without tool use or file changes.

import asyncio
from nemo_fabric import (
EnvironmentConfig, Fabric, FabricConfig, HarnessConfig,
MetadataConfig, ModelConfig, RunRequest, ToolsConfig,
)
config = FabricConfig(
metadata=MetadataConfig(name="code-review"),
harness=HarnessConfig(adapter_id="nvidia.fabric.langchain.deepagents"),
models={
"default": ModelConfig(
provider="nvidia",
model="nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",
api_key_env="NVIDIA_API_KEY",
base_url="https://integrate.api.nvidia.com/v1",
)
},
environment=EnvironmentConfig(provider="local", workspace="."),
tools=ToolsConfig(enabled=[]),
)
REVIEW_INPUT = (
"Review this Python function for correctness issues. Explain any bug you find. "
"Do not use tools or change files.\n\n"
"def average(values):\n"
" return sum(values) / len(values)\n"
)
async def main():
fabric = Fabric()
result = await fabric.run(
config,
request=RunRequest(
input=REVIEW_INPUT,
request_id="first-code-review",
),
)
print("Adapter:", result.adapter_id)
print("Status:", result.status)
print("Request:", result.request_id)
if result.status == "succeeded":
print(result.output.response)
else:
print("Error:", result.error)
print("Artifacts:", result.artifacts)
if __name__ == "__main__":
asyncio.run(main())

Run it from the application directory:

python first_agent.py
4

Check the Outcome

The returned adapter ID should be nvidia.fabric.langchain.deepagents. A successful request has status succeeded and request ID first-code-review. The review should identify that average([]) causes division by zero. The prose and suggested fix can vary; check the status and the finding separately. The request to avoid tools and file changes is an instruction to the agent, not a security boundary.

Fabric.run() starts the runtime, invokes it once, and attempts shutdown. It can return a failed normalized result; configuration and lifecycle failures can instead raise SDK exceptions. Follow Troubleshooting if the run does not succeed.

Next Steps

Change only the input to ask for a test that covers the empty-list case. The same configuration and result-handling code still apply. Then continue to 2. Switch Harnesses to run the review through another harness while retaining your application interface.

For further exploration, see Multi-Turn Runtimes to preserve state between related turns, or the maintained onboarding notebooks for an interactive tour.