Nemo Relay Instrument Typed Wrappers
NVIDIAOfficialCreated by NVIDIA Corporation and Affiliates
- Skill
- Tool integration
- Software development
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides guidance on implementing typed wrappers, domain types, and provider codecs within the NeMo Relay framework. It focuses on maintaining strict domain types for application logic while ensuring that middleware and LLM provider interfaces continue to operate on predictable JSON structures. The skill covers the use of built-in codecs like Pydantic or Dataclass codecs, as well as provider-specific codecs for normalizing LLM request and response payloads.
What it does
- Defines how to translate application-facing domain objects into JSON for middleware compatibility.
- Provides patterns for using Pydantic, dataclasses, or custom codecs to enforce type safety.
- Explains the distinction between typed value codecs and LLM provider-specific codecs.
- Outlines the lifecycle of request and response codecs during LLM execution.
- Ensures that middleware and guardrails maintain visibility into serialized data shapes.
- Offers a validation checklist to ensure codec integrity and middleware compatibility.
When to use it
- When you need to integrate stronger domain types into a NeMo Relay application.
- When you need to normalize LLM provider-specific request or response payloads.
- When you want to preserve JSON middleware semantics while using typed objects in your application code.
- When you need to ensure that custom domain models survive serialization cycles.
Advantages
- Enables type-safe development without breaking existing JSON-based middleware.
- Supports standard Python and Node.js serialization patterns.
- Maintains consistency across different LLM providers through standardized codecs.
- Allows for flexible integration via BestEffortAnyCodec when schemas are dynamic.
Usage examples
- “How do I add a Pydantic model to my NeMo Relay workflow?”
- Use the PydanticCodec to define a boundary translator that converts your Pydantic model to JSON before middleware processing, ensuring the framework handles the serialization correctly.
- “Which codec should I use for an Anthropic LLM integration?”
- Use the AnthropicMessagesCodec to normalize the provider-specific payload, ensuring that middleware can inspect message fields and tool calls without breaking the underlying call.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/nvidia/nemo-relay-instrument-typed-wrappers/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip nemo-relay-instrument-typed-wrappers.zip -d .agents/skills
Documentation by NVIDIA Corporation and Affiliates
Use Typed Wrappers And Codecs
Use this skill when an application wants stronger domain types than raw JSON for tool or LLM integration. Keep typed boundaries explicit so middleware still sees predictable JSON.
Default Guidance
Prefer plain JSON first for initial adoption.
Reach for typed wrappers when the application already has stable domain models.
Keep in mind that middleware still operates on JSON, not typed objects.
Embedded Codec Model
A typed value codec is a pure boundary translator. It converts application-facing values to JSON before NeMo Relay emits events or runs middleware, then converts JSON back into the framework callback or caller type.
Python exposes
JsonPassthrough,DataclassCodec,PydanticCodec, andBestEffortAnyCodec. Node.js exposesJsonPassthroughplus customCodec<T>implementations.Use
BestEffortAnyCodeconly at boundaries where strict schemas are not available. Prefer dataclass, Pydantic, or explicit Node.js codecs when the framework owns a stable schema.Provider codecs are different from typed value codecs: they normalize provider-specific LLM requests and responses so middleware and subscribers can inspect messages, tools, model names, generation parameters, and response annotations.
Built-in provider codecs include
OpenAIChatCodec,OpenAIResponsesCodec, andAnthropicMessagesCodecin Python, Node.js, and Rust. Choose the codec that matches the actual provider payload shape.Response codecs annotate LLM end events with fields such as
id,model,message,tool_calls,finish_reason,usage, provider-specific data, and extra unmodeled fields. They do not rewrite the caller-visible response.Request codecs run before LLM request intercepts. Intercepts receive both the raw
LLMRequestand optional annotated request;encodemerges annotated edits back before execution intercepts and the provider callback run.
Key Rules
Typed wrappers are currently a first-class path for Python and Node.js; Rust uses codec traits directly
Request/response conversion belongs in codecs
Intercepts and guardrails see JSON values after encoding
Changes made by middleware survive into the decode step
Choose A Codec
JsonPassthroughfor JSON-native valuesDataclassCodecorPydanticCodecin Python when the models already existCustom codecs for domain-specific wire shapes
BestEffortAnyCodeconly when broad flexibility is worth the looser contractProvider codecs for LLM provider payloads, not application domain objects conversion
Validation Checklist
[ ] Codec output is JSON-compatible
[ ] Required fields survive
toJson/fromJsonordecode/encode[ ] Middleware sees the expected serialized shape
[ ] Provider codecs preserve fields they do not understand
[ ] Response codec failures do not break the underlying LLM call
[ ] Request codec
encodepreserves original provider fields unless an intercept intentionally changes them
Related Skills
nemo-relay-instrument-callsnemo-relay-plugin-observabilitynemo-relay-debug-runtime-integration
Files
- ATTRIBUTION.mdAdded by AutoGineer993 B
- BENCHMARK.md3.8 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md3.4 KiB
- evals/evals.json5.0 KiB
- skill-card.md3.9 KiB
- skill.oms.sig4.5 KiB
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- NVIDIA Corporation and Affiliates
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/nemo-relay-instrument-typed-wrappers · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA Corporation and Affiliates or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download nemo-relay-instrument-typed-wrappers.zip