Skip to main content

License GitHub Release Codecov PyPI npm node Crates.io Crates.io Crates.io Ask DeepWiki

NeMo Relay

nemo-relay is the NeMo Relay package for Python applications. It gives Python code access to a portable agent runtime for execution scopes, middleware, plugins, lifecycle events, adaptive behavior, and observability around tool and LLM calls.

The package wraps the shared Rust runtime, so Python applications use the same runtime semantics as the Rust and Node.js surfaces.

Why Use It?

  • Own execution context in Python: Group agent, tool, and LLM work into one scope tree from Python application code.
  • Package policy around callbacks: Use guardrails and intercepts to block work, sanitize observability payloads, rewrite requests, or wrap execution.
  • Emit one lifecycle stream: Send runtime events to in-process subscribers, Agent Trajectory Interchange Format (ATIF), OpenTelemetry, or OpenInference workflows.
  • Integrate without a framework migration: Wrap framework or provider callbacks while preserving the application’s orchestration model.

What You Get

  • Scope, tool, and LLM helpers: Managed boundaries that emit lifecycle events and run middleware in a consistent order.
  • Middleware APIs: Guardrails and intercepts for tool and LLM requests, responses, and execution.
  • Subscribers and exporters: Event consumers for observability and diagnostics.
  • Plugin and typed helpers: Public modules for plugins, codecs, typed wrappers, adaptive runtime behavior, and observability plugin configuration.
  • Shared Rust runtime semantics: Python behavior aligned with the Rust and Node.js surfaces.

Installation

Install the published package with uv:

uv add nemo-relay

If you are not using uv, install it with pip:

pip install nemo-relay

Optional Dependencies

LangChain Integration

LangChain integration is available with the langchain extra:

# With uv
uv add "nemo-relay[langchain]"

# With pip
pip install "nemo-relay[langchain]"

LangGraph Integration

LangGraph integration is available with the langgraph extra, this builds upon and includes the langchain extra as well.

# With uv
uv add "nemo-relay[langgraph]"

# With pip
pip install "nemo-relay[langgraph]"

Deep Agents Integration

Deep Agents integration is available with the deepagents extra. This extra builds upon and includes the langgraph and langchain extras.

# With uv
uv add "nemo-relay[deepagents]"

# With pip
pip install "nemo-relay[deepagents]"

LangChain NVIDIA Integration

The LangChain NVIDIA extra builds upon the langchain extra adding a compatible version of the langchain-nvidia-ai-endpoints package.

# With uv
uv add "nemo-relay[langchain-nvidia]"

# With pip
pip install "nemo-relay[langchain-nvidia]"

To install this along with the langgraph extra, use:

# With uv
uv add "nemo-relay[langgraph,langchain-nvidia]"
# With pip
pip install "nemo-relay[langgraph,langchain-nvidia]"

Getting Started

Register a subscriber, create a scope, and emit a mark event:

import nemo_relay


def on_event(event) -> None:
    print(f"{event.kind} {event.name}")


nemo_relay.subscribers.register("printer", on_event)

with nemo_relay.scope.scope("demo-agent", nemo_relay.ScopeType.Agent) as handle:
    nemo_relay.scope.event("initialized", handle=handle, data={"binding": "python"})

nemo_relay.subscribers.flush()
nemo_relay.subscribers.deregister("printer")

Native subscriber delivery is asynchronous, so call nemo_relay.subscribers.flush() before you read subscriber output or exit.

For host integrations that need a serialized event shape, consume the canonical JSON payload from the subscriber event object:

import json
import nemo_relay


def on_event(event) -> None:
    payload = event.to_dict()
    print(payload["kind"], payload["name"])
    assert json.loads(event.to_json()) == payload


nemo_relay.subscribers.register("host-exporter", on_event)
try:
    with nemo_relay.scope.scope("demo-agent", nemo_relay.ScopeType.Agent):
        nemo_relay.scope.event("initialized", data={"binding": "python"})
finally:
    nemo_relay.subscribers.flush()
    nemo_relay.subscribers.deregister("host-exporter")

Package Surface

The public package modules are:

  • nemo_relay.scope
  • nemo_relay.tools
  • nemo_relay.llm
  • nemo_relay.guardrails
  • nemo_relay.intercepts
  • nemo_relay.subscribers
  • nemo_relay.plugin
  • nemo_relay.adaptive
  • nemo_relay.observability
  • nemo_relay.typed
  • nemo_relay.codecs

Integrations

  • nemo_relay.integrations.langchain
  • nemo_relay.integrations.langgraph
  • nemo_relay.integrations.deepagents

The compiled extension is exposed as nemo_relay._native.

Documentation

NeMo Relay Documentation: https://docs.nvidia.com/nemo/relay

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nemo_relay-0.5.0-cp311-abi3-win_arm64.whl (6.9 MB view details)

Uploaded CPython 3.11+Windows ARM64

nemo_relay-0.5.0-cp311-abi3-win_amd64.whl (7.4 MB view details)

Uploaded CPython 3.11+Windows x86-64

nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

nemo_relay-0.5.0-cp311-abi3-macosx_11_0_arm64.whl (7.8 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file nemo_relay-0.5.0-cp311-abi3-win_arm64.whl.

File metadata

  • Download URL: nemo_relay-0.5.0-cp311-abi3-win_arm64.whl
  • Upload date:
  • Size: 6.9 MB
  • Tags: CPython 3.11+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nemo_relay-0.5.0-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 87462585f17b40ce82c54347acef5ace96ee11de3015f234e0b902f23b3793fb
MD5 248d978281439fad4b4b7cf26f55c624
BLAKE2b-256 4ef265c3ef0435e671c829063d4872897f9054f369f0aeacab12c5aefe486705

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.5.0-cp311-abi3-win_arm64.whl:

Publisher: ci.yaml on NVIDIA/NeMo-Relay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nemo_relay-0.5.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: nemo_relay-0.5.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 7.4 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nemo_relay-0.5.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 da1bd1e1dec79b7bda3984dd8c59b32ba97abf96c37e85cd1f38d208a29f42b9
MD5 492629b4c192979e9b6a0a4473e2f7be
BLAKE2b-256 da8b5681f3430e6d25bf7419dbe576da14599e1cfadc083edb74e691a0c3a980

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.5.0-cp311-abi3-win_amd64.whl:

Publisher: ci.yaml on NVIDIA/NeMo-Relay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb323569f104506f4f1a0e2104b22d74c9a0bbf3280ec4d58ad3d768de76fb15
MD5 8730ec8ed6799c187fb286f7d40ddd19
BLAKE2b-256 4997bd4c77e975d50f7d09f8bfcb74d7e704e05a8b2205f555bf557f84edc5fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: ci.yaml on NVIDIA/NeMo-Relay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 de61ad0644c5e8c300de814f6884c5de7ae51db14694f5057f938b4da54bfaaf
MD5 b96f0004a750a0a6ab4ca84be6da6ed1
BLAKE2b-256 dd1325c4fcf6fb979af07c9562238819183588a910c2ae09767603500d6948c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.5.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: ci.yaml on NVIDIA/NeMo-Relay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nemo_relay-0.5.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.5.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 203409e0f392fc4f40f52277347ed75ba9969b2af28ddb3b6ae53f789185a0ed
MD5 a3098480e535bbf28eef04e8a14658c7
BLAKE2b-256 aafc6892859ffbfb60f8cc09a4181c8d407b574d49490e35cd563e7f0a61bf54

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.5.0-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: ci.yaml on NVIDIA/NeMo-Relay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.7.3

8 files

0.7.2

8 files

0.7.1

8 files

0.7.0

8 files

0.6.0

8 files

This release

0.5.0 This release

5 files

0.4.0

5 files

0.3.0

5 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page