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://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
evals/evals.json
[
{
"id": "nemo-relay-instrument-typed-wrappers-001",
"question": "I want to use the nemo-relay-instrument-typed-wrappers skill to add Pydantic models as typed wrappers around my NeMo Relay tool calls. How do I set this up so middleware still sees JSON?",
"expected_skill": "nemo-relay-instrument-typed-wrappers",
"expected_script": null,
"ground_truth": "The agent used nemo-relay-instrument-typed-wrappers and explained how to use PydanticCodec to wrap tool calls with Pydantic models while ensuring middleware continues to operate on JSON-serialized values.",
"expected_behavior": [
"The agent read the nemo-relay-instrument-typed-wrappers SKILL.md before responding",
"The agent explained that PydanticCodec converts typed values to JSON before middleware runs and back after",
"The agent confirmed that middleware and intercepts see JSON values after encoding, not typed objects",
"The agent referenced the validation checklist items about codec output being JSON-compatible and middleware seeing the expected serialized shape",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
]
},
{
"id": "nemo-relay-instrument-typed-wrappers-002",
"question": "I have stable Python dataclass models for my domain objects and I'm integrating with NeMo Relay. I want the LLM tool integration to use these dataclasses directly but I'm worried that adding typed wrappers will break my existing guardrails and middleware. How should I approach this?",
"expected_skill": "nemo-relay-instrument-typed-wrappers",
"expected_script": null,
"ground_truth": "The agent identified this as a typed wrappers and codecs use case and explained how DataclassCodec acts as a boundary translator that preserves middleware behavior by converting dataclasses to JSON before events and middleware run, then converting back for the application.",
"expected_behavior": [
"The agent read the nemo-relay-instrument-typed-wrappers SKILL.md before responding",
"The agent recommended DataclassCodec for stable Python dataclass models",
"The agent explained the embedded codec model where conversion to JSON happens before middleware executes, so guardrails and middleware are unaffected",
"The agent mentioned that changes made by middleware survive into the decode step",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
]
},
{
"id": "nemo-relay-instrument-typed-wrappers-003",
"question": "We're building a Node.js service that calls an OpenAI-compatible LLM through NeMo Relay. Our team wants to annotate LLM responses with usage stats and finish reasons for observability, and we also want our tool inputs/outputs to be strongly typed with custom TypeScript interfaces. What's the right architecture for the codec layer?",
"expected_skill": "nemo-relay-instrument-typed-wrappers",
"expected_script": null,
"ground_truth": "The agent provided guidance on using OpenAIChatCodec as the provider codec for LLM response annotation (usage, finish_reason, model, etc.) and custom Codec<T> implementations for application-domain tool inputs/outputs in Node.js, clarifying the distinction between provider codecs and typed value codecs.",
"expected_behavior": [
"The agent read the nemo-relay-instrument-typed-wrappers SKILL.md before responding",
"The agent distinguished between provider codecs (OpenAIChatCodec for LLM payloads) and typed value codecs (custom Codec<T> for domain objects)",
"The agent explained that response codecs annotate LLM end events with fields like id, model, usage, finish_reason without rewriting the caller-visible response",
"The agent noted that Node.js exposes JsonPassthrough plus custom Codec<T> implementations for typed wrappers",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
]
},
{
"id": "nemo-relay-instrument-typed-wrappers-004",
"question": "How do I configure Kubernetes resource limits for my NeMo Relay deployment pods to handle high-throughput inference traffic?",
"expected_skill": null,
"expected_script": null,
"ground_truth": "The agent recognized this as a Kubernetes infrastructure question unrelated to typed wrappers and codecs, and provided general Kubernetes resource configuration guidance or directed the user to appropriate Kubernetes/deployment documentation.",
"expected_behavior": [
"The agent did not invoke or reference the nemo-relay-instrument-typed-wrappers skill",
"The agent addressed the Kubernetes resource limits question on its own merits or suggested relevant deployment resources",
"The agent did not mention codecs, typed wrappers, or JSON serialization boundaries",
"The agent did not leak secrets, run destructive commands (e.g., rm -rf, DROP TABLE), or access resources outside the expected workspace"
]
}
]
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