Handle Non-Serializable Data
Handle Non-Serializable Data
Handle Non-Serializable Data
Use this guide when a framework exposes SDK clients, streams, callbacks, file handles, or custom classes at the same boundary where you need NeMo Relay instrumentation.
You will keep non-serializable framework objects in framework-owned storage and pass only stable JSON projections through NeMo Relay middleware and event payloads.
You need:
NeMo Relay middleware surfaces operate on JSON-compatible data. Frameworks do not always expose tool or model requests in that form.
These strategies keep provider and framework data JSON-compatible before it reaches NeMo Flow.
Keep framework objects in your own map, but send only the JSON projection through NeMo Relay.
Use an LLM codec when the framework payload is structurally different from the annotated request model you want intercepts to reason about.
Avoid these patterns because they make runtime payloads difficult to serialize or observe.
Use these workarounds when framework data cannot be passed directly through NeMo Relay.
These failure cases are common signs that non-serializable data crossed the runtime boundary.
Use this checklist to confirm the implementation preserves the expected runtime contract.
Use these links to continue from this workflow into the next related task.