nemo-relay-instrument-typed-wrappers
Skill238 starsChanged 2 months agoApache-2.0View on GitHub
Use this skill when adding NeMo Relay typed wrappers, domain types, or provider codecs while preserving JSON middleware semantics and caller-visible behavior.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- NVIDIA/skillsedited, first seen Oct 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- NVIDIA/skills★ 3.9k98% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-binding-featureSkill
- add-middlewareSkill
- check-release-deploymentsSkill
- contribute-docsSkill
- contribute-integrationSkill
- create-beta-tagSkill
- create-rc-tagSkill
- create-release-tagSkill
- draft-release-notesSkill
- maintain-ciSkill
- maintain-dynamic-pluginsSkill
- maintain-observabilitySkill
- maintain-optimizerSkill
- maintain-packagingSkill
- prepare-code-freezeSkill
- prepare-prSkill
- rename-surfacesSkill
- review-doc-styleSkill
- update-project-versionSkill
- nemo-relay-debug-runtime-integrationSkill
- nemo-relay-get-startedSkill
- nemo-relay-installSkill
- nemo-relay-instrument-callsSkill
- nemo-relay-instrument-context-isolationSkill
- nemo-relay-integrate-upstreamSkill
- nemo-relay-migrate-from-flowSkill
- nemo-relay-plugin-adaptive-tuningSkill
- nemo-relay-plugin-buildSkill
- nemo-relay-plugin-observabilitySkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Use this skill when an application wants stronger domain types than raw JSON for tool or LLM integration.
- Distinctive: line 13
Keep typed boundaries explicit so middleware still sees predictable JSON.
- Distinctive: line 17
Prefer plain JSON first for initial adoption.
- Distinctive: line 19
Keep in mind that middleware still operates on JSON, not typed objects.
- Very specific: line 29
Use BestEffortAnyCodec only at boundaries where strict schemas are not available.
- Very specific: line 48
Use instructions, portable messages and components, and the tagged api_specific request surface for normalized edits.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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. - Built-in request codecs guarantee JSON-value identity for an unchanged annotation. They compare edits with a decoded baseline and patch only changed fields, preserving native representation details and unknown fields.
- Use
instructions, portable messages and components, and the taggedapi_specificrequest surface for normalized edits. Provider-only union members use explicit{ provider, kind, value }native components. Reserve top-levelextrafor unknown future fields. - The
nemo-relaygateway always supplies matching request codecs on Anthropic Messages, OpenAI Chat Completions, and OpenAI Responses generation routes. On those routes, treat rawrequest.contentas read-only and return body edits through the annotated request. Header edits still use the raw request.
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 - Provider-native components belong to the codec's provider surface
- Gateway generation intercepts do not mutate raw
request.content
Related Skills
nemo-relay-instrument-callsnemo-relay-plugin-observabilitynemo-relay-debug-runtime-integration
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

