> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server. # nemo_relay > Python bindings for the NeMo Relay runtime. Generated from `python/nemo_relay/__init__.pyi`. Module `nemo_relay`. Python bindings for the NeMo Relay runtime. ## Functions ### `get_scope_stack` ```python def get_scope_stack() -> ScopeStack ``` Return the current task's active scope stack. ### `scope_stack_active` ```python def scope_stack_active() -> bool ``` Report whether the current context already owns a scope stack. ### `propagate_scope_to_thread` ```python def propagate_scope_to_thread() -> ScopeStack ``` Capture the active scope stack for use in another thread. ### `create_scope_stack` ```python def create_scope_stack() -> ScopeStack ``` Create a new isolated scope stack. ### `set_thread_scope_stack` ```python def set_thread_scope_stack(stack: ScopeStack) -> None ``` Install a scope stack into the current thread's native runtime context. ## Type Aliases And Constants * `Event` * `Json` * `JsonObject` * `JsonPrimitive` * `JsonValue` * `LlmConditionalExecutionGuardrail` * `LlmExecutionIntercept` * `LlmRequestIntercept` * `LlmSanitizeRequestGuardrail` * `LlmSanitizeResponseGuardrail` * `LlmStreamExecutionIntercept` * `ToolConditionalExecutionGuardrail` * `ToolExecutionIntercept` * `ToolRequestIntercept` * `ToolSanitizeGuardrail` * `UnsupportedBehavior` ## Re-exports * `AnnotatedLLMRequest` * `AnnotatedLLMResponse` * `AtifExporter` * `AtofEndpointConfig` * `AtofExporter` * `AtofExporterConfig` * `AtofExporterMode` * `LLMAttributes` * `LLMHandle` * `LLMRequest` * `LLMRequestInterceptOutcome` * `MarkEvent` * `OpenInferenceConfig` * `OpenInferenceSubscriber` * `OpenTelemetryConfig` * `OpenTelemetrySubscriber` * `PendingMarkSpec` * `ScopeAttributes` * `ScopeEvent` * `ScopeHandle` * `ScopeStack` * `ScopeType` * `ToolAttributes` * `ToolExecutionInterceptOutcome` * `ToolHandle` * `adaptive` * `codecs` * `guardrails` * `intercepts` * `llm` * `model_pricing` * `observability` * `pii_redaction` * `plugin` * `scope` * `scope_local` * `subscribers` * `tools` * `typed` > Python bindings for the NeMo Relay runtime. ## Docs - [nemo_relay.adaptive](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/adaptive.md): Adaptive plugin configuration helpers. - [nemo_relay.codecs](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/codecs.md): Protocol definitions for request and response codecs used by `nemo_relay.llm`. - [nemo_relay.guardrails](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/guardrails.md): Global guardrail registration for tools and LLMs. - [nemo_relay.integrations](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations.md): Optional integrations for NeMo Relay. - [nemo_relay.integrations.deepagents](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/deepagents.md): NeMo Relay integrations for Deep Agents. - [nemo_relay.integrations.deepagents.callbacks](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/deepagents/callbacks.md): Deep Agents callback handler for NeMo Relay observability. - [nemo_relay.integrations.deepagents.middleware](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/deepagents/middleware.md): Deep Agents middleware for NeMo Relay observability. - [nemo_relay.integrations.langchain](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/langchain.md): NeMo Relay integrations for LangChain. - [nemo_relay.integrations.langchain.callbacks](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/langchain/callbacks.md): LangChain callback handler that maps run hierarchy to NeMo Relay scopes. - [nemo_relay.integrations.langchain.middleware](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/langchain/middleware.md): LangChain AgentMiddleware implementation for NeMo Relay. - [nemo_relay.integrations.langgraph](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/langgraph.md): NeMo Relay integrations for LangGraph. - [nemo_relay.integrations.langgraph.callbacks](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/integrations/langgraph/callbacks.md): LangGraph callback handler that reuses the LangChain NeMo Relay integration. - [nemo_relay.intercepts](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/intercepts.md): Global middleware intercept registration for tools and LLMs. - [nemo_relay.llm](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/llm.md): LLM lifecycle helpers for non-streaming and streaming calls. - [nemo_relay.model_pricing](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/model-pricing.md): Model pricing plugin configuration helpers. - [nemo_relay.observability](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/observability.md): Observability plugin configuration helpers. - [nemo_relay.pii_redaction](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/pii-redaction.md): PII redaction plugin configuration helpers. - [nemo_relay.plugin](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/plugin.md): Generic plugin configuration and registration helpers. - [nemo_relay.scope](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/scope.md): Scope stack operations. - [nemo_relay.scope_local](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/scope-local.md): Scope-local middleware and subscriber registration. - [nemo_relay.subscribers](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/subscribers.md): Global event subscriber registration. - [nemo_relay.tools](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/tools.md): Tool lifecycle helpers. - [nemo_relay.typed](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/typed.md): Typed wrappers around the JSON-based NeMo Relay execution APIs. - [nemo_relay.utils](https://docs.nvidia.com/nemo/relay/v0.5.0/reference/api/python-library-reference/nemo-relay/utils.md):