Generated banner for Nemo Relay Instrument Typed Wrappers
Generated logo for Nemo Relay Instrument Typed Wrappers

Nemo Relay Instrument Typed Wrappers

NVIDIAOfficialCreated by NVIDIA Corporation and Affiliates

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Use this skill when adding NeMo Relay typed wrappers, domain types, or provider codecs while preserving JSON middleware semantics and caller-visible behavior.
— the description by NVIDIA Corporation and Affiliates

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

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/nvidia/nemo-relay-instrument-typed-wrappers/download
  2. Unzip 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, 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

  • nemo-relay-instrument-calls

  • nemo-relay-plugin-observability

  • nemo-relay-debug-runtime-integration

Files

BENCHMARK.md

Evaluation Report

Evaluation of the nemo-relay-instrument-typed-wrappers skill before publication through NVSkills-Eval.

This benchmark summarizes 3-Tier Evaluation from NVSkills-Eval results for the skill. The goal is to document whether the skill is safe, discoverable, effective, and useful for agents before it is published for broader workflow use.

Evaluation Summary

  • Skill: nemo-relay-instrument-typed-wrappers

  • Evaluation date: 2026-07-15

  • NVSkills-Eval profile: external

  • Environment: astra-sandbox

  • Dataset: 4 evaluation tasks

  • Attempts per task: 1

  • Pass threshold: 50%

  • Overall verdict: PASS

Agents Used

  • claude-code

  • codex

Metrics Used

Reported benchmark dimensions:

  • Security: checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access.

  • Correctness: checks whether the agent follows the expected workflow and produces the correct final output.

  • Discoverability: checks whether the agent loads the skill when relevant and avoids using it when irrelevant.

  • Effectiveness: checks whether the agent performs measurably better with the skill than without it.

  • Efficiency: checks whether the agent uses fewer tokens and avoids redundant work.

Underlying evaluation signals used in this run:

  • security (Security): checks for unsafe operations, secret leakage, and unauthorized access.

  • skill_execution (Skill Execution): verifies that the agent loaded the expected skill and workflow.

  • skill_efficiency (Efficiency): checks routing quality, decoy avoidance, and redundant tool usage.

  • accuracy (Accuracy): grades final-answer correctness against the reference answer.

  • goal_accuracy (Goal Accuracy): checks whether the overall user task completed successfully.

  • behavior_check (Behavior Check): verifies expected behavior steps, including safety expectations.

  • token_efficiency (Token Efficiency): compares token usage with and without the skill.

Test Tasks

The benchmark dataset contained 4 evaluation tasks:

  • Positive tasks: 3 tasks where the skill was expected to activate.

  • Negative tasks: 1 tasks where no skill was expected.

  • Unlabeled tasks: 0 tasks where positive/negative intent could not be inferred.

Task composition is derived from the evaluation dataset when possible. Entries with expected_skill set are treated as positive skill-activation cases, while entries with expected_skill: null are treated as negative activation cases.

Results

DimensionNumclaude-codecodex
Security4100% (+0%)100% (+0%)
Correctness4100% (+60%)89% (+16%)
Discoverability4100% (+75%)81% (+32%)
Effectiveness497% (+44%)94% (+18%)
Efficiency495% (+50%)84% (+31%)

Score values show skill-assisted performance. Values in parentheses show uplift versus the no-skill baseline when baseline data is available.

Tier 1: Static Validation Summary

Tier 1 validation passed with observations. NVSkills-Eval ran 1 checks and found 3 total findings.

Top findings:

  • MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Instructions' (skills/nemo-relay-instrument-typed-wrappers/SKILL.md)

  • MEDIUM SCHEMA/body_recommended_section: Missing recommended section: '## Examples' (skills/nemo-relay-instrument-typed-wrappers/SKILL.md)

  • LOW SCHEMA/author_format: Author must be of the form 'Name <email@host>' (skills/nemo-relay-instrument-typed-wrappers/SKILL.md)

Tier 2: Deduplication Summary

This tier was not run or did not produce findings in this report.

Publication Recommendation

The skill is suitable to proceed toward NVSkills-Eval publication based on this benchmark. Skill owners should keep this file with the skill and refresh it when the evaluation dataset, skill behavior, or target agents materially change.

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