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?

Use the Python binding for the following tasks:

  • 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), or typed OpenTelemetry workflows.
  • Integrate without a framework migration: Wrap framework or provider callbacks while preserving the application’s orchestration model.

What You Get

The Python package provides the following capabilities:

  • 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, plus mark and scope event sanitizers for data, category_profile, and metadata.
  • Subscribers and exporters: OpenTelemetrySubscriber accepts one required full, gen_ai, or openinference endpoint configuration. The nemo_relay.observability helpers configure plugin-owned endpoint fan-out.
  • 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. From an asyncio task, use await nemo_relay.subscribers.flush_async() so async event sanitizers can continue running on that event loop.

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 Distribution

nemo_relay-0.7.3.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

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

nemo_relay-0.7.3-cp311-abi3-win_arm64.whl (8.4 MB view details)

Uploaded CPython 3.11+Windows ARM64

nemo_relay-0.7.3-cp311-abi3-win_amd64.whl (8.8 MB view details)

Uploaded CPython 3.11+Windows x86-64

nemo_relay-0.7.3-cp311-abi3-musllinux_1_2_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

nemo_relay-0.7.3-cp311-abi3-musllinux_1_2_aarch64.whl (10.3 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

nemo_relay-0.7.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.0 MB view details)

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

nemo_relay-0.7.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.5 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

nemo_relay-0.7.3-cp311-abi3-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file nemo_relay-0.7.3.tar.gz.

File metadata

  • Download URL: nemo_relay-0.7.3.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nemo_relay-0.7.3.tar.gz
Algorithm Hash digest
SHA256 ea5a1bb52e25e001dcbf6af1830616be181845e978cc848df58562556bba5604
MD5 a35b45c19ce8e429639d5c3826a26e92
BLAKE2b-256 cde5a259aac8df4aa78c0b3a6f3ad0fbf6305666bfaad5c29d9adc26db0f9e27

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3.tar.gz:

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.7.3-cp311-abi3-win_arm64.whl.

File metadata

  • Download URL: nemo_relay-0.7.3-cp311-abi3-win_arm64.whl
  • Upload date:
  • Size: 8.4 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.7.3-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 6d5444e9a03b8b5d4bba2409105a121349580cb51481d441c6b5e699713a8763
MD5 0d08294d973c6ed8f7e053e7dbc526fc
BLAKE2b-256 f1ac558a05e6b9e28464b64fee8327d9e8a2aab3fb356363b8b82597b6b35b2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3-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.7.3-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: nemo_relay-0.7.3-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 8.8 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.7.3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f123cd45a27fca3d570559f2c26850138763411f66f387559d757e5d88bfa3c1
MD5 5d00aa003bf9711c547f4194eaad57e5
BLAKE2b-256 6bcb8a6f8d5f9922e75100f135c1dc4451bafc15f5d51608081f72b894e0caf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3-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.7.3-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d4895a4df39a92ecbac3633fb4ec59cf1f83286c0369f433760ab28fb8d6dddf
MD5 944ca379220dc8e22dba56904f2b8a8d
BLAKE2b-256 7dfd6ec48f47eb5ca4cca566b197ade8514baf183dddf53d6de3a296b8bc1102

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3-cp311-abi3-musllinux_1_2_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.7.3-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 90ff984a89c42ebd0cfe26a0af3f180b1970e2ebcd743d19a960e547949ad2ef
MD5 b663887cbcee9601c237430231e0d0bc
BLAKE2b-256 8fd8d8c25ba915467bab457d175b84a3af5c33291655867d472c49eada3b77e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3-cp311-abi3-musllinux_1_2_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.7.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8eeaaf8c6a18440e473dd14eb1bb82e56c6514e70adee7456eddf9ce217cff89
MD5 055e866678ce23183e8f63296318f034
BLAKE2b-256 aeabb2f246f971f561a982d234d9f3ec1b29dfa4c72bf4882f3e32ce6db54dfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3-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.7.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 49c70c0a94cebb6cba3dd7521be11f63eac4cd9386881eb29827ac91b1bd780b
MD5 a1fa3652d65647b71c966e25a4a6ce01
BLAKE2b-256 c7a99fb77f7142b1381d8c3c81fdbb76782a02dcff1ee403ac6c93b13fa46b24

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3-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.7.3-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 301dfc8334032ac52c09cc0b1421181e7c4df601abe7c82dfe51aa74ddbb3732
MD5 107f382a2fc5de5f590e82817a00c45d
BLAKE2b-256 ed9e4eb80d2307cadcbb839dad2212a8d888667cd8c531ad0d8c0c1afc841181

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.3-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

This release

0.7.3 This release

8 files

0.7.2

8 files

0.7.1

8 files

0.7.0

8 files

0.6.0

8 files

0.5.0

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