Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.0rc5.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.0rc5-cp311-abi3-win_arm64.whl (12.5 MB view details)

Uploaded CPython 3.11+Windows ARM64

nemo_relay-0.7.0rc5-cp311-abi3-win_amd64.whl (13.1 MB view details)

Uploaded CPython 3.11+Windows x86-64

nemo_relay-0.7.0rc5-cp311-abi3-musllinux_1_2_x86_64.whl (15.2 MB view details)

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

nemo_relay-0.7.0rc5-cp311-abi3-musllinux_1_2_aarch64.whl (14.9 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

nemo_relay-0.7.0rc5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.0 MB view details)

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

nemo_relay-0.7.0rc5-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

nemo_relay-0.7.0rc5-cp311-abi3-macosx_11_0_arm64.whl (13.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file nemo_relay-0.7.0rc5.tar.gz.

File metadata

  • Download URL: nemo_relay-0.7.0rc5.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.0rc5.tar.gz
Algorithm Hash digest
SHA256 54bf5bfbe4a07e07b4e1dbfe05653fa7a944dae1214427519f022f44c7572822
MD5 9c47bba8a5be34035653e8b4de6858d5
BLAKE2b-256 140e6d9ad18e0b0dc739502b9a9444b1b3c6a710896a3d6e672bac5293752ac2

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.0rc5.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.0rc5-cp311-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.0rc5-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 5ae15c81056aa014935a51fba6a42a18cbc3c5df041b41e915f170c9456b5e28
MD5 b015b79eaf78bf65f518be43736bff9e
BLAKE2b-256 a417849da7fbcaf4b33ec93ded9c290db3b5a9cb325d75ac450fb75d4783d4e7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nemo_relay-0.7.0rc5-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0ece694f1d019a108ef7390e652830de6d12747a2292799892b16d17e66c8eb7
MD5 cd1cffd554b3bc455704b09d2c56c6a5
BLAKE2b-256 c6f478b85750066104bf2cc5bbc4113e6f14e400d1dd6d714de9d6e55f9f787f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nemo_relay-0.7.0rc5-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 860fbfe801efc06a9f6c36ab0a88d0b1b004b6f44a38a601b0207ba2dfcad876
MD5 ef73d0b32dada7a79955d4b25c1acfff
BLAKE2b-256 b27017b5c5f329c3c6a3becfd6e9e5969d7cdd31098a9a2c51294f30d2d5c4bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.0rc5-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.0rc5-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.0rc5-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 271c90259b7f25ca6e112e5263e33f87f2bde1cdc93e7e69e1c69923bdd66eee
MD5 33a0b13efeed49c04f4090770dbbb511
BLAKE2b-256 b305c02a0d767e4abc0be4a06d0da3918d0f458ef83ee2fc5627298dd2e52259

See more details on using hashes here.

Provenance

The following attestation bundles were made for nemo_relay-0.7.0rc5-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.0rc5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nemo_relay-0.7.0rc5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe94b35ad69e2f283c6fbdf1b7b1e2cfa42c71ab469813dceb7837cba0aa930f
MD5 d49fb6e28705e8ccbc59d0889ab70ba6
BLAKE2b-256 86f1071c2bcc415601608560dc1e786821aa9d87c8a43b1d6a321fc2835e7644

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nemo_relay-0.7.0rc5-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 448f4018482766b7fe365fb5e3a4efdf49354ae64f7984dd4d8bd07bbd61ec2f
MD5 4440e0359a489734549837477472ce7d
BLAKE2b-256 325f0ecc46de6fc7dd8ef33ee71820947c83b734cf77b4a7691a8589f5a4da61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nemo_relay-0.7.0rc5-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e849471c8023f9c58921ee05e55e346d385e65e39381239512cf7442fb21b48b
MD5 045d06c52e490497841a486cca02fe3b
BLAKE2b-256 efba0155249bf4ef0e0e2f1dc459331d17ecf64c799d82bb4190fa28d9b40c81

See more details on using hashes here.

Provenance

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

This release

0.7.0rc5 This release

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