Use this guide when you own the model-provider callback and want NeMo Relay to emit lifecycle events, apply LLM middleware, and preserve the active agent scope around the call.
You will wrap one existing LLM provider invocation with the managed LLM execution API. The result is an LLM call that:
LLMRequest in Python or LlmRequest in Node.js and Rust.Complete one binding Quick Start guide first:
Create a scope for the active request or agent run before adding LLM instrumentation. If you have not done that yet, start with Adding Scopes and Marks.
The request and response payloads must be JSON-compatible. If your provider SDK uses clients, streams, callbacks, or other opaque objects, keep those objects in the provider callback and pass only a serializable request projection into NeMo Relay.
Follow these steps to route the provider invocation through NeMo Relay:
model_name.The examples below wrap a demo provider callback and print emitted events.
Check both behavior and instrumentation:
demo-provider.Native subscriber delivery is asynchronous. Flush subscribers before validating
printed output. In Node.js, also wait one event-loop tick after
flushSubscribers() so JavaScript callbacks can run.
model_name when you provide one.If only the business result appears, the callback ran but instrumentation did not run. Confirm that the call goes through llm.execute, llmCallExecute, or llm_call_execute.
Before deploying to production, ensure the following checklist is completed:
model_name separately when the model should be easy to filter or export.Check these symptoms first when the workflow does not behave as expected.
Use these links to continue from this workflow into the next related task.