Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add NVIDIA/skills --skill nemo-relay-instrument-typed-wrappers -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/nemo-relay-instrument-typed-wrappers/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/nemo-relay-instrument-typed-wrappers/

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

Similar skills

All skills for AI and ML →

From the same set312

The whole set →
nemo-relay-instrument-calls nemo-relay-instrument-calls wraps tool and LLM provider call sites with NeMo Relay execution scopes. Keeps business logic intact while attaching lifecycle events, intercepts, and guardrails. CX Codex +1 224installs nemo-relay-instrument-context-isolation The nemo-relay-instrument-context-isolation skill keeps NeMo Relay scope stacks separate across concurrent work and preserves event ancestry as tasks cross execution boundaries. CX Codex +1 211installs nemotron-asr-finetune nemotron-asr-finetune coordinates domain and language adaptation for NVIDIA Nemotron Speech and Riva ASR, picking the lowest-cost path from word boosting to full fine-tuning. CX Codex +1 210installs nemo-relay-debug-runtime-integration The nemo-relay-debug-runtime-integration skill traces NeMo Relay runtime faults across loading, scopes, events, plugins, and adaptive wiring. Use it when the package is present but app behavior is wrong. CX Codex +1 197installs nemo-relay-plugin-build nemo-relay-plugin-build is a skill for packaging reusable NeMo Relay behavior as config components or dynamic plugins, with validation and rollback for plugins shared across apps or teams. CX Codex +1 181installs nemo-relay-plugin-adaptive-tuning nemo-relay-plugin-adaptive-tuning is a Claude Code skill that configures and evaluates NeMo Relay adaptive behavior from runtime signals, including telemetry, parallelism, hints, and prompt-cache planning. CX Codex +1 178installs nemo-relay-migrate-from-flow nemo-relay-migrate-from-flow — a skill that automates code, documentation, and config migration from NeMo Flow to NeMo Relay. Handles Python, Rust, Node.js, Go, C FFI, CLI, and observability surfaces. CX Codex +1 171installs doca-bench This skill guides doca_bench runs to measure DOCA library performance on a host or BlueField Arm. Use it to check throughput or latency and record a baseline before changing a system. CX Codex +1 166installs

Project sponsors

Companies that keep this analytics open