Use Typed Wrappers And Codecs
SkillDev toolsGuides your agent to add typed wrappers and codecs in NeMo Relay while keeping middleware JSON behavior unchanged.
Then ask your AI: use the Use Typed Wrappers And Codecs skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add it as a step in a pipeline you build on Ahel, or connect Ahel to Claude, ChatGPT, Cursor, Claude Code or Codex and ask your AI to use it.
About this skill
Use this skill when adding NeMo Relay typed wrappers, domain types, or provider codecs while preserving JSON middleware semantics and caller-visible behavior.
What this skill tells your AI
The instructions your AI receives, as published by nvidia/skills in skills/nemo-relay-instrument-typed-wrappers/SKILL.md and read by Ahel’s review.
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 exist- Custom codecs for domain-specific wire shapes
BestEffortAnyCodeconly when broad flexibility is worth the looser contract- Provider 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
Signals
- GitHub stars
- 4k
- Forks
- 434
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
nemo-relay-instrument-typed-wrappers- Source
- github.com/nvidia/skills
Related picks
Skill · thedaviddias
The pick for JavaScriptmodern-javascript-patterns
Skill · sickn33
The pick for JavaScriptdbos-python
Skill · sickn33
The pick for Pythonpython-design-patterns
Skill · wshobson
The pick for Pythonrust-engineer
Skill · jeffallan
The pick for Rustsetup-ts-deep-modules
Skill · mattpocock
The pick for TypeScript