nemo-relay-build-plugin

작성자: nvidia

Build and package reusable NeMo Relay runtime behavior as a config-activated plugin with validation and rollback-safe registration

npx skills add https://github.com/nvidia/nemo-relay --skill nemo-relay-build-plugin

Build a Plugin

Use this skill when a user wants to package reusable NeMo Relay runtime behavior behind plugin configuration.

Use This When

Use this skill when the behavior should be activated by shared config and reused across applications, teams, or process startup paths.

Common cases:

  • Register subscribers, guardrails, intercepts, or a small bundle of related runtime behavior.
  • Validate operator-supplied config before changing runtime behavior.
  • Give reusable behavior a stable plugin kind and activation lifecycle.
  • Package behavior that should be enabled, disabled, or rolled out through plugin config rather than repeated application startup code.

Do Not Use This When

Do not build a plugin when a narrower NeMo Relay surface is enough:

  • One request or tenant needs temporary behavior -> use scope-local middleware.
  • The user only needs first-time scopes, tool calls, or LLM calls -> nemo-relay-instrument-calls.
  • The user only needs to choose an exporter path -> nemo-relay-setup-observability.
  • The behavior depends on live callables, provider clients, file handles, credentials, or framework objects inside config.

Embedded Plugin Model

  • Plugins package reusable process-level behavior.
  • A plugin exposes a stable kind string and receives component-local config from a shared plugin document.
  • Plugin config must be JSON-compatible across Rust, Python, Node.js, files, tests, and deployment systems.
  • Validation is deterministic and side-effect free. It inspects config and returns structured diagnostics before runtime behavior changes.
  • Registration runs after validation and installs real behavior through PluginContext, such as subscribers, guardrails, request intercepts, execution intercepts, or stream execution intercepts.
  • PluginContext gives the plugin system enough ownership to qualify runtime names and roll back partial setup when activation fails.
  • Disabled components should still validate when possible so operators can find config problems before rollout.

Default Path

  1. Decide whether a plugin is actually needed. Prefer direct instrumentation or scope-local behavior when the use case is not reusable process-level behavior.
  2. Pick one first runtime surface: subscriber-oriented export, sanitize guardrail, conditional guardrail, request intercept, execution intercept, or stream execution intercept.
  3. Choose a stable plugin kind and the smallest JSON-compatible config shape.
  4. Define diagnostics for missing fields, unsupported values, unknown fields, unsafe config, and invalid field combinations.
  5. Validate config before initialization. Validation must not open network connections, create clients, register middleware, or mutate process state.
  6. Register runtime behavior through PluginContext, not by hand-registering global behavior inside application startup.
  7. Test activation, disabled components, validation failures, and registration failure rollback.
  8. Document how to enable the plugin, what config fields are supported, and how to roll back the component.
  9. For a dynamic plugin that should provide structured fields in nemo-relay plugins edit, declare the config_schema capability and reference a local Draft 7 or Draft 2020-12 JSON Schema file from [config_schema].path in relay-plugin.toml. Schema-less plugins remain editable as raw JSON objects.

Config Shape

The top-level plugin document contains version, components, and policy. Each component supplies the plugin kind, enabled, and component-local config:

{
  "version": 1,
  "components": [
    {
      "kind": "redaction-policy",
      "enabled": true,
      "config": {
        "preset": "strict"
      }
    }
  ],
  "policy": {
    "unknown_component": "warn",
    "unknown_field": "warn",
    "unsupported_value": "error"
  }
}

Keep business logic in plugin code, not in config. Use references to secrets or endpoints rather than embedding sensitive values.

Binding Pointers

  • Python: nemo_relay.plugin
  • Node.js: nemo-relay-node/plugin
  • Rust: nemo_relay::plugin
  • Go and raw FFI are source-first or advanced surfaces.

Use the same canonical snake_case config keys across bindings and files. Node helper functions can be camelCase, but plugin config objects remain snake_case.

Failure Modes To Avoid

  • Do not put callables, clients, credentials, framework objects, file handles, or caches in plugin config.
  • Do not perform runtime registration during validation.
  • Do not skip validation for disabled components.
  • Do not register directly through global startup code when PluginContext should own the runtime behavior.
  • Do not combine unrelated subscribers, request transforms, and policy checks in the first plugin unless one config document clearly owns the bundle.
  • Do not export raw production payloads or secrets. Add telemetry sanitization before data leaves the process.
  • Do not ignore partial activation failures. Roll back or surface a clear diagnostic.

Validation Checklist

  • Stable plugin kind chosen.
  • Config shape is JSON-compatible and uses snake_case.
  • Required fields and unsupported values produce stable diagnostics.
  • Unknown fields follow the configured policy.
  • Disabled components still report config problems where possible.
  • Initialization installs behavior through PluginContext.
  • A forced registration failure does not leave partial runtime behavior active.
  • Docs or examples show how to enable and roll back the plugin.
  • Dynamic plugins that need structured CLI editing package a valid local JSON Schema and declare config_schema in relay-plugin.toml.

Use Another Skill When

  • You only need to wrap direct tool or LLM calls -> nemo-relay-instrument-calls
  • You need to set up traces or exporters without packaging a plugin -> nemo-relay-setup-observability
  • You need to debug plugin activation, missing events, or load failures -> nemo-relay-debug-runtime-integration

Related Skills

  • nemo-relay-instrument-calls
  • nemo-relay-setup-observability
  • nemo-relay-debug-runtime-integration

nvidia의 다른 스킬

compileiq-debug
nvidia
Use when something is wrong: Search() hangs, all evaluations return INVALID_SCORE, scores aren't improving, every config returns the same number, ptxas errors…
official
create-github-pr
nvidia
gh CLI를 사용하여 GitHub 풀 리퀘스트를 생성합니다. 사용자가 새 PR을 만들거나, 코드 리뷰를 제출하거나, 풀 리퀘스트를 열고자 할 때 사용합니다. 트리거 키워드 -…
official
diagnose-perf
nvidia
First-responder performance triage for Isaac Sim and Isaac Lab. Identifies bottleneck category (GPU-bound, CPU-bound, VRAM, loading) using nvidia-smi and…
official
eagle3-review-logs
nvidia
Review EAGLE3 pipeline experiment logs from the launcher's experiments/ directory. Summarizes pass/fail status for all 4 tasks, diagnoses failures with root…
official
nemoclaw-maintainer-cross-issue-sweep
nvidia
다른 열린 이슈들을 스캔하여 주어진 PR이 함께 수정하거나 실수로 망가뜨릴 수 있는 이슈를 찾습니다. 인접 수정 기회와 모순 위험을 file:line…과 함께 출력합니다.
official
karpathy-guidelines
nvidia
일반적인 LLM 코딩 실수를 줄이기 위한 행동 지침입니다. 코드 작성, 검토 또는 리팩토링 시 과도한 복잡성을 피하고 정밀한 변경을 위해 사용하세요.
official
fhir-basics
nvidia
에이전트에게 FHIR R4 API의 작동 방식, 사용 가능한 리소스, 검색 매개변수를 사용한 쿼리 방법, 모든 응답 형식을 올바르게 파싱하는 방법을 가르칩니다…
official
underdeclared-agent
nvidia
A helpful assistant agent
official