nemo-relay-instrument-typed-wrappers — Claude Code skill
nemo-relay-instrument-typed-wrappers configures NeMo Relay typed wrappers and provider codecs while keeping JSON middleware semantics intact.
Apache-2.0 182 installs ★ 4,106 updated 2026-10-23
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a claude-codeWhat nemo-relay-instrument-typed-wrappers does
This skill guides the implementation of typed value wrappers and LLM provider codecs inside NeMo Relay pipelines. When raw JSON is too loose, Python integrations can use DataclassCodec, PydanticCodec, or BestEffortAnyCodec, while Node.js relies on Codec<T>. In Rust, the pipeline applies codec traits directly.
Provider codecs like OpenAIChatCodec, OpenAIResponsesCodec, and AnthropicMessagesCodec standardize model interactions. They extract tool calls, message structures, and usage metrics without modifying the caller-visible response payload.
NeMo Relay middleware and intercepts always operate on JSON, never on typed objects. Boundary translators must produce valid JSON and preserve unmodeled fields, because missing attributes break downstream execution.
What it helps with
- Enforce Pydantic or dataclass validation at NeMo Relay boundary edges
- Normalize Anthropic and OpenAI payload structures across runtime middleware
- Preserve unmodeled provider fields across request and response intercepts
- Implement custom
Codec<T>boundary handlers in Node.js
Example prompts for the agent
- Add a PydanticCodec boundary for tool inputs in NeMo Relay
- Set up OpenAIChatCodec to surface token usage to subscriber events
- Ensure unmodeled fields survive the response decode step in this middleware
How to install nemo-relay-instrument-typed-wrappers
1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a claude-code2Manually: put the files in place
~/.claude/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/nemo-relay-instrument-typed-wrappers/
1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a codex2Manually: put the files in place
.agents/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a cursor2Manually: put the files in place
.cursor/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install NVIDIA/skills skills/nemo-relay-instrument-typed-wrappers2Manually: put the files in place
.github/skills/nemo-relay-instrument-typed-wrappers/SKILL.md1Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a gemini-cli2Platform CLI
gemini skills install https://github.com/NVIDIA/skills --path skills/nemo-relay-instrument-typed-wrappersManually: put the files in place
.devin/skills/nemo-relay-instrument-typed-wrappers/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about nemo-relay-instrument-typed-wrappers
How to install nemo-relay-instrument-typed-wrappers in Claude Code?
Run npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a claude-code. The file will be placed at ~/.claude/skills/nemo-relay-instrument-typed-wrappers/SKILL.md.
What does nemo-relay-instrument-typed-wrappers do?
It provides conventions for bridging domain schemas into NeMo Relay using value and provider codecs while keeping JSON-based middleware functional.
Do middleware intercepts interact with typed domain objects?
No, intercepts and guardrails only inspect serialized JSON values produced after the encoding stage.
Source text
SKILL.md · Apache-2.0
--- name: nemo-relay-instrument-typed-wrappers description: Use this skill when adding NeMo Relay typed wrappers, domain types, or provider codecs while preserving JSON middleware semantics and caller-visible behavior. license: Apache-2.0 metadata: author: 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`, and `BestEffortAnyCodec`. Node.js exposes `JsonPassthrough` plus custom `Codec<T>` implementations. - Use `BestEffortAnyCodec` only 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`, and `AnthropicMessagesCodec` in 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 `LLMRequest` and optional annotated request; `encode` merges 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 - `JsonPassthrough` for JSON-native values - `DataclassCodec` or `PydanticCodec` in Python when the models already exist - Custom codecs for domain-specific wire shapes - `BestEffortAnyCodec` only 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`/`fromJson` or `decode`/`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 `encode` preserves original provider fields unless an intercept intentionally changes them ## Related Skills - `nemo-relay-instrument-calls` - `nemo-relay-plugin-observability` - `nemo-relay-debug-runtime-integration`
© NVIDIA Corporation and Affiliates · Apache-2.0 · NVIDIA/skills