Skip to content

feat: add Relay-backed runtime streaming#109

Open
yczhang-nv wants to merge 13 commits into
NVIDIA:mainfrom
yczhang-nv:feat/adapter-streaming
Open

feat: add Relay-backed runtime streaming#109
yczhang-nv wants to merge 13 commits into
NVIDIA:mainfrom
yczhang-nv:feat/adapter-streaming

Conversation

@yczhang-nv

@yczhang-nv yczhang-nv commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Overview

Implements Relay-backed streaming for Fabric runtimes, promoting the streaming
proof of concept from #104 into the supported Python SDK surface.

Runtime.invoke_stream() exposes raw ATOF records while an invocation is running
and keeps the normalized terminal RunResult out of band. Streaming is opt-in:
callers pass streaming=True to start_runtime(...) (with Relay enabled) to
provision it, so relay-enabled runtimes that do not stream pay no additional cost
and keep their existing telemetry shape. The change is additive — a new optional
streaming parameter — and introduces no breaking API changes or new dependencies.

Details

  • Add an SDK-owned loopback HTTP listener for Relay NDJSON/ATOF delivery with a
    bounded, byte-budgeted record queue (16 MiB total / 1 MiB per record), TCP
    backpressure, and a bounded post-turn drain window.
  • Gate provisioning behind start_runtime(..., streaming=True): a relay-enabled
    runtime binds the loopback listener and injects the nemo-fabric-stream ATOF
    sink only when streaming is requested. Requesting streaming=True without Relay
    enabled raises FabricConfigError.
  • Add Runtime.invoke_stream(), Runtime.supports_streaming,
    InvokeStream.result(), and explicit early-exit cleanup via
    InvokeStream.aclose().
  • Correlate records to a single invocation by ATOF scope tree: Deep Agents and
    Hermes stamp a request id on the turn's root scope; gateway harnesses match on
    Relay's turn role and index. The Hermes correlation scope is added only for
    streaming runs, so non-streaming Relay runs keep their prior trajectory shape.
  • Surface otherwise-silent failures as RuntimeWarnings: no Relay connection
    reached the listener, data arrived but no record matched the active turn, or a
    chunked upload was interrupted mid-turn. A clean stream completion does not warn.
  • Validate streaming requests before returning an InvokeStream, and allow a
    manual Runtime.stop() to finalize a completed stream after result().
  • Document the public streaming contract, terminal failure semantics, adapter
    behavior, runnable examples, and the generated Python API reference.

Validation

  • just test-python — full Python suite passes across the CI matrix
    (Python 3.11–3.14 on Linux, macOS, and Windows).
  • tests/python/test_streaming.py — focused listener, turn-correlation,
    byte-budget backpressure, drain, warning, and lifecycle coverage.
  • End-to-end streaming turns run under warnings.simplefilter("error", RuntimeWarning)
    and assert non-empty records:
    • Deep Agents — tests/e2e/test_deepagents.py (persistent host, mock model).
    • Claude and Codex gateways — live tests in tests/e2e/test_claude.py and
      tests/e2e/test_codex.py, validating gateway turn correlation.
  • just docs — passes; generated Python reference pages carry Markdown-safe SPDX
    headers that are transformed to MDX at Fern-sync time.
  • Ruff, pre-commit hooks, and git diff --check.

Rust validation was not run because this change does not modify Rust code or the
PyO3 bridge.

Where should the reviewer start?

Start with python/src/nemo_fabric/streaming.py for the listener, turn
correlation, and stream lifecycle; then python/src/nemo_fabric/client.py for the
streaming=True opt-in gate and python/src/nemo_fabric/runtime.py for eager
validation and manual shutdown. The focused behavioral coverage is in
tests/python/test_streaming.py, with end-to-end coverage under tests/e2e/.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Supersedes the implementation POC in [DO NOT MERGE]feat: add streaming API POC #104

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.

  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Summary by CodeRabbit

  • New Features

    • Added Relay-backed streaming to the Python SDK via Runtime.invoke_stream() with an InvokeStream async iterator of raw ATOF records and a terminal await stream.result().
    • Added Runtime.supports_streaming and streaming-aware runtime startup/stop lifecycle handling.
    • Introduced typed v2 Relay ATOF sink configuration via file/stream sink models.
  • Documentation

    • Added the Streaming API reference and updated Python and integration guides with end-to-end streaming workflows.
    • Updated Relay ATOF examples to use the typed v2 sinks model.
  • Tests

    • Expanded/updated streaming, documentation contract, and adapter configuration tests to match the new streaming and typed sink behavior.

@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Relay-backed streaming is added to the Python SDK through an SDK-owned ATOF listener, Runtime.invoke_stream(), InvokeStream, lifecycle enforcement, typed Relay ATOF sinks, adapter wiring, tests, exports, generated references, and integration guidance.

Changes

Relay-backed streaming and typed ATOF sinks

Layer / File(s) Summary
Typed Relay ATOF contract
crates/fabric-core/src/config.rs, python/src/nemo_fabric/models.py, schemas/*, adapters/common/...
Replaces endpoint-based ATOF configuration with version 2 typed file and stream sinks, updates normalization and artifact collection, and validates the new contract.
Streaming listener and iterator
python/src/nemo_fabric/streaming.py, tests/python/test_streaming.py
Adds InvokeStream, a loopback /atof listener, NDJSON parsing, bounded queueing, lifecycle controls, and stream sink configuration helpers.
Runtime startup and lifecycle integration
python/src/nemo_fabric/client.py, python/src/nemo_fabric/runtime.py, python/src/nemo_fabric/__init__.py
Injects the listener when Relay is enabled, exposes supports_streaming, adds invoke_stream(), enforces active-turn rules, and closes streaming resources during shutdown.
Adapter wiring and validation
adapters/*, tests/adapters/*, tests/python/test_sdk_contract.py
Uses plugin configurations directly, updates sink-based fixtures and examples, and tests adapter, lifecycle, HTTP, and configuration behavior.
Public API and guidance
docs/*, skills/*, README.md, scripts/generate_api_docs.sh
Documents streaming invocation, terminal results, cleanup semantics, typed sinks, navigation, generated references, and adapter stdout rules.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Fabric
  participant Runtime
  participant Relay
  participant InvokeStream
  Client->>Fabric: start_runtime with Relay enabled
  Fabric->>Runtime: create runtime with ATOF listener
  Client->>Runtime: invoke_stream(input or request)
  Runtime->>InvokeStream: create active stream
  Relay->>InvokeStream: deliver raw NDJSON ATOF records
  Client->>InvokeStream: async iterate records
  Client->>InvokeStream: await result()
  InvokeStream-->>Client: terminal RunResult
Loading

Possibly related PRs

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.81% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the main change: Relay-backed runtime streaming.
Description check ✅ Passed The description mostly matches the template with overview, reviewer start, validation, and checkboxes, though the related-issues keyword usage is incomplete.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/about-nemo-fabric/overview.mdx`:
- Line 145: Update the lifecycle description near “Run, start, or stream a
runtime” to distinguish runtime management from invocation streaming: describe
running or starting a runtime through the shared lifecycle contract, then
streaming a single invocation via Runtime.invoke_stream().

In `@docs/reference/api/python-library-reference/index.md`:
- Line 15: Update the nemo_fabric.streaming module description to use “NVIDIA
NeMo Fabric Python SDK” on its first user-facing occurrence, then regenerate the
Python library reference so the generated documentation reflects the corrected
product name.

In `@docs/reference/api/python-library-reference/nemo_fabric.streaming.md`:
- Around line 6-7: Replace the JSX copyright comment emitted for the streaming
API Markdown document with standard Markdown <!-- ... --> syntax. Update
add_frontmatter or the generator responsible for this header, then regenerate
the file so the generated output uses the corrected delimiter rather than being
patched directly.
- Around line 40-55: Update the lazydocs rendering for the streaming methods
aclose and result to preserve their async signatures, rendering them as
awaitable methods consistent with their async def definitions in streaming.py.
Regenerate the Python library reference so the documentation shows await
stream.aclose() and await stream.result().

In `@docs/sdk/python.mdx`:
- Around line 320-328: Make the Python streaming example self-contained by
defining the config object before calling enable_relay() and start_runtime(),
and by defining or importing the render_atof callback used in the async
iteration. Keep the existing Fabric startup and stream consumption flow
unchanged.

In `@python/src/nemo_fabric/runtime.py`:
- Around line 293-297: Parenthesize the mixed boolean condition in the state
guard around _current_task and _current_stream so it explicitly expresses
“_current_task is not None OR (_current_stream is not None AND not
_current_stream._finalized)”. Preserve the existing logic and behavior.

In `@skills/nemo-fabric-integrate/SKILL.md`:
- Around line 174-177: Update the queue ownership statement in the NeMo Fabric
concurrency guidance to say that NeMo Fabric owns no application scheduling
queue, while preserving the existing explanation that the Relay-backed streaming
SDK uses an internal bounded transport queue for one invocation’s records.
- Around line 166-167: Update the streaming example’s async iteration over
stream so it no longer calls the undefined consume_atof helper; replace that
call with a self-contained inline operation or define the helper within the
example, keeping the example directly runnable when copied.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: e9f9e826-e36d-4956-9b09-57769118bafc

📥 Commits

Reviewing files that changed from the base of the PR and between cf3782a and c99f105.

📒 Files selected for processing (19)
  • .agents/skills/contribute-adapter/SKILL.md
  • README.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/index.yml
  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/sdk/python.mdx
  • python/src/nemo_fabric/__init__.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/runtime.py
  • python/src/nemo_fabric/streaming.py
  • scripts/generate_api_docs.sh
  • skills/nemo-fabric-integrate/SKILL.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: Test (Python 3.12, windows-amd64)
  • GitHub Check: Test (Python 3.14, windows-amd64)
  • GitHub Check: Test (Python 3.13, windows-amd64)
  • GitHub Check: Test (Python 3.11, windows-amd64)
🧰 Additional context used
📓 Path-based instructions (41)
**/*.{rs,py,pyi,json,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.

Files:

  • docs/index.yml
  • python/src/nemo_fabric/__init__.py
  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
{README.md,docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repository references, and build commands current in documentation and examples.

Files:

  • docs/index.yml
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
{README.md,docs/index.yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Update README.md or docs/index.yml when documentation entry points or example reading paths change.

Files:

  • docs/index.yml
  • README.md
{docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Update relevant getting-started, reference, adapter, and example documentation when the corresponding examples or adapters change.

Files:

  • docs/index.yml
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
docs/**/*.{md,mdx,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Run just docs when the documentation site changes.

Files:

  • docs/index.yml
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
**/*

📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)

**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.

**/*: Always spell NVIDIA in all caps; do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names with NVIDIA on first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...

Files:

  • docs/index.yml
  • python/src/nemo_fabric/__init__.py
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • scripts/generate_api_docs.sh
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • tests/docs/test_python_api_docs.py
  • skills/nemo-fabric-integrate/SKILL.md
  • docs/sdk/python.mdx
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
docs/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Update Fern documentation under docs/ when public behavior, the nemo-fabric package, examples, or supported bindings change.

Files:

  • docs/index.yml
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
docs/index.yml

📄 CodeRabbit inference engine (AGENTS.md)

Update docs/index.yml navigation when the documentation structure changes.

Update docs/index.yml when changed behavior affects documentation entry points.

Files:

  • docs/index.yml
**/*.{yml,yaml,toml,lock}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

For CI or packaging changes, use maintain-ci or maintain-packaging, then run recipes and checks whose behavior changed.

Files:

  • docs/index.yml
**/*.{toml,yml,yaml,sh,bash}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

TOML, YAML, and shell files must use the specified #-comment SPDX license header.

Files:

  • docs/index.yml
  • scripts/generate_api_docs.sh
{docs/**,README.md,AGENTS.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,AGENTS.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency with generated schemas.

Files:

  • docs/index.yml
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
python/src/nemo_fabric/**

📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)

Ensure the editable maturin build continues to produce the native extension at nemo_fabric._native, with generated artifacts placed where downstream consumers expect.

Files:

  • python/src/nemo_fabric/__init__.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
**/*.{rs,py}

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

For native binding changes, run cargo check -p fabric-python --locked.

Files:

  • python/src/nemo_fabric/__init__.py
  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
python/src/nemo_fabric/**/*.py

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

For Python API reference changes, update source docstrings under python/src/nemo_fabric/ instead of editing generated reference output.

Files:

  • python/src/nemo_fabric/__init__.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If Python code or a Python-facing adapter changes, run just test-python.

Use type annotations for public Python APIs and keep native Python binding declarations synchronized with their Rust implementations.

Files:

  • python/src/nemo_fabric/__init__.py
  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
**/*.{rs,py,pyi}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests in just test-rust pass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes under schemas/ and generated API references.

**/*.{rs,py,pyi}: Use snake_case for Rust and Python functions and variables; use PascalCase for Rust types and Python classes.
Keep native Python binding declarations synchronized with their Rust implementations when public contracts change.

Files:

  • python/src/nemo_fabric/__init__.py
  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
**/*.{py,pyi,rs}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

For Python SDK or PyO3 binding changes, use python-tests, run focused pytest tests first, then just test-python; rebuild with just build-python when native code or packaging changes.

Files:

  • python/src/nemo_fabric/__init__.py
  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
**/*.{rs,py,toml}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

When editing version helpers, verify every nemo-fabric-* workspace package through Cargo metadata and reject a static version in python/pyproject.toml.

Files:

  • python/src/nemo_fabric/__init__.py
  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
**/*.{toml,rs,py}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.

Files:

  • python/src/nemo_fabric/__init__.py
  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
  • python/src/nemo_fabric/runtime.py
python/src/nemo_fabric/**/*

⚙️ CodeRabbit configuration file

python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/src/nemo_fabric/__init__.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
**/*.{md,rst}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Update documentation and examples in the same branch as the public API change.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spell NVIDIA in all caps; do not use Nvidia, nvidia, or NV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such as here or read more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once, and prefer refer to over see when directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.

**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
  • docs/sdk/python.mdx
**/*.{md,rst,txt,adoc}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)

**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Use can for possibility and reserve may for permission; use after for temporal order; use refer to for cross-references; prefer short direct sentences and specific verbs; avoid unnecessary please in technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: use for example or such as instead of e.g., and so on instead of etc., that is instead of i.e., compared to instead of vs., and by, through, or using instead of via. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Use that without commas for essential clauses, and which with commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such as June 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space before a.m. or p.m.; use ET and PT for needed time zones; avoid 24/7; and prefer from 12:30 to 1:00 p.m. for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
docs/reference/api/**

📄 CodeRabbit inference engine (AGENTS.md)

Regenerate or update generated API references under docs/reference/api/ when the public API changes.

Treat all files under docs/reference/api/ as generated output and do not modify them directly.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
**/*.{md,mdx}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

**/*.{md,mdx}: Use the full product name NVIDIA NeMo Fabric on its first usage, typically in the title or H1; use NeMo Fabric thereafter.
Use fabric by itself only when referring to the CLI tool, and surround those references with backticks.
Capitalize NVIDIA correctly in public documentation.
Format commands, code elements, expressions, file names, paths, and filenames as inline code where needed.
Use title case consistently for headings in technical documentation.
Introduce code blocks, tables, and lists with complete lead-in sentences.
Use descriptive anchor text instead of raw URLs or generic link text such as here.
Prefer active voice, present tense, short sentences, and plain English.
Use consistent terminology for the same concept throughout a document.
Write procedures as imperative, parallel, easy-to-scan steps, and split long sequences into smaller tasks.
Use after instead of once when expressing temporal sequence.
Use can instead of may when the intended meaning is possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
Introduce examples' code blocks with full sentences and ensure examples match current APIs and build commands.

For documentation-site changes, run just docs to regenerate Python and Rust API references and validate Fern configuration.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
  • docs/sdk/python.mdx
**/{README.md,*.md,*.mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant SDK, API, adapter, example, integration, and embedded documentation when public behavior or the corresponding surface changes.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
  • docs/sdk/python.mdx
**/*.{html,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

HTML and Markdown files must use the specified HTML comment form for SPDX license headers.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
{*.md,**/*.md,**/*.mdx,**/*.ipynb}

⚙️ CodeRabbit configuration file

{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercase fabric CLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.

Files:

  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/index.md
  • README.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
  • docs/sdk/python.mdx
scripts/generate_api_docs.sh

📄 CodeRabbit inference engine (AGENTS.md)

Keep the stable public wrapper scripts/generate_api_docs.sh at the scripts/ root and reference it in docs and examples; use namespaced paths under scripts/docs/ only for internal maintenance documentation.

For Python API reference changes, update scripts/generate_api_docs.sh when the generator itself requires changes.

Files:

  • scripts/generate_api_docs.sh
README.md

📄 CodeRabbit inference engine (AGENTS.md)

Update the root README.md when public behavior, the nemo-fabric package, examples, or supported bindings change.

Update the top-level README.md when changed behavior affects an entry point users would naturally consult.

Update the root README.md when workspace structure, supported adapters, or top-level documentation changes.

Files:

  • README.md
**/README.md

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

Update relevant package, crate, adapter, and integration README files when public behavior or entry-point documentation changes.

Files:

  • README.md
.agents/skills/**

📄 CodeRabbit inference engine (AGENTS.md)

Keep maintainer skills under .agents/skills/ focused on repository contribution work, including API, documentation, testing, CI, packaging, release, and PR preparation; do not add consumer integration guidance.

Maintainer skills are auto-discovered from .agents/skills/; Claude Code uses .claude/skills as a symlink to the same directory rather than a separate skill set.

Files:

  • .agents/skills/contribute-adapter/SKILL.md
.agents/skills/**/SKILL.md

📄 CodeRabbit inference engine (.agents/skills/README.md)

Each maintainer skill file must begin with YAML frontmatter containing at least name and description.

Files:

  • .agents/skills/contribute-adapter/SKILL.md
.agents/skills/*/

📄 CodeRabbit inference engine (.agents/skills/README.md)

Use descriptive, task-based names for maintainer skill directories, such as contribute-api and validate-change.

Files:

  • .agents/skills/contribute-adapter/SKILL.md
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

In MDX files, use JSX comment delimiters ({/* and */}) for top-of-file comments, including SPDX headers; do not use HTML comments.

Use {/* ... */} delimiters for top-of-file MDX SPDX comments, not HTML comment delimiters.

MDX files must use a JSX comment for the SPDX license header.

Files:

  • docs/about-nemo-fabric/overview.mdx
  • docs/sdk/python.mdx
skills/**

📄 CodeRabbit inference engine (AGENTS.md)

skills/**: Keep consumer skills under skills/ self-contained and dependent only on supported public Python SDK contracts and published documentation; do not add repository-internal contribution guidance.
Keep consumer skills in parity with the public SDK guide, model, and type details when the Python/Rust binding contract changes.

Files:

  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • skills/nemo-fabric-integrate/SKILL.md
tests/**/*.{rs,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the corresponding Rust crate or the relevant area under tests/.

Files:

  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)

tests/**/*.py: Use Pytest to run Python tests.
Do not add @pytest.mark.asyncio to tests; async tests are automatically detected and run by the async runner.
Do not add -> None return type annotations to test functions.
When mocking a class, use unittest.mock.MagicMock or unittest.mock.AsyncMock, using the spec argument when necessary, rather than defining a new class.
Prefix mocked class names with mock, not fake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files in conftest.py.
Define fixtures using @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and a function named <fixture_name>_fixture; specify scope only when it is not function.
Prefer pytest.mark.parametrize over separate tests for different input types.
Use @pytest.mark.usefixtures when a fixture is needed but its return value is unused or it does not return a value.
Use the autouse restore_environ_fixture from tests/conftest.py to restore environment variables; modify variables with os.environ and do not use monkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as using results["data"] instead of results.get("data").

Files:

  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
{tests/**,python/tests/**}

⚙️ CodeRabbit configuration file

{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.

Files:

  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
**/SKILL.md

⚙️ CodeRabbit configuration file

**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
docs/sdk/python.mdx

📄 CodeRabbit inference engine (AGENTS.md)

Keep docs/sdk/python.mdx current when the public Python API changes.

Files:

  • docs/sdk/python.mdx
🧠 Learnings (1)
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.

Applied to files:

  • python/src/nemo_fabric/__init__.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
🪛 ast-grep (0.44.1)
python/src/nemo_fabric/streaming.py

[warning] 144-144: Do not make http calls without encryption
Context: f"http://{self._host}:{self._bound_port}/atof"
Note: [CWE-319] Cleartext Transmission of Sensitive Information.

(requests-http)

tests/python/test_streaming.py

[info] 107-109: use jsonify instead of json.dumps for JSON output
Context: json.dumps(
_plan(json.loads(config_json))
)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 110-110: use jsonify instead of json.dumps for JSON output
Context: json.dumps(_runtime())
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 112-114: use jsonify instead of json.dumps for JSON output
Context: json.dumps(
_result(json.loads(request_json), json.loads(runtime_json))
)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 140-140: use jsonify instead of json.dumps for JSON output
Context: json.dumps(record)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[info] 272-272: use jsonify instead of json.dumps for JSON output
Context: json.dumps(_result(json.loads(request_json), json.loads(runtime_json)))
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[warning] 130-130: Do not make http calls without encryption
Context: "http://"
Note: [CWE-319] Cleartext Transmission of Sensitive Information.

(requests-http)

🪛 markdownlint-cli2 (0.23.0)
docs/reference/api/python-library-reference/nemo_fabric.streaming.md

[warning] 6-6: Spaces inside emphasis markers

(MD037, no-space-in-emphasis)


[warning] 7-7: Spaces inside emphasis markers

(MD037, no-space-in-emphasis)


[warning] 9-9: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 17-17: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🪛 Ruff (0.15.21)
python/src/nemo_fabric/streaming.py

[error] 105-106: try-except-pass detected, consider logging the exception

(S110)


[warning] 105-105: Do not catch blind exception: Exception

(BLE001)


[warning] 144-144: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 169-169: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 256-256: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 265-265: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 353-353: Avoid specifying long messages outside the exception class

(TRY003)

tests/python/test_streaming.py

[warning] 108-108: Unused lambda argument: base_dir

(ARG005)


[warning] 113-113: Unused lambda argument: plan_json

(ARG005)


[warning] 151-151: Async function definition with a timeout parameter

(ASYNC109)


[warning] 154-155: Use asyncio.Event instead of awaiting asyncio.sleep in a while loop

(ASYNC110)


[warning] 270-270: Unused function argument: plan_json

(ARG001)

python/src/nemo_fabric/runtime.py

[warning] 145-148: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 151-151: Too many branches (13 > 12)

(PLR0912)


[warning] 151-151: Too many statements (55 > 50)

(PLR0915)


[error] 154-154: Function argument input is shadowing a Python builtin

(A002)


[warning] 154-154: Dynamically typed expressions (typing.Any) are disallowed in input

(ANN401)


[error] 233-233: Function argument input is shadowing a Python builtin

(A002)


[warning] 233-233: Dynamically typed expressions (typing.Any) are disallowed in input

(ANN401)


[warning] 249-254: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 256-259: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 270-270: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 272-274: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 276-276: Avoid specifying long messages outside the exception class

(TRY003)


[warning] 295-296: Parenthesize a and b expressions when chaining and and or together, to make the precedence clear

Parenthesize the and subexpression

(RUF021)

🪛 SkillSpector (2.3.11)
.agents/skills/contribute-adapter/SKILL.md

[error] 170: [RA1] Self-Modification: Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Remediation: Prevent the skill from modifying its own code, SKILL.md, or configuration files. Treat skill files as read-only at runtime.

(Rogue Agent (RA1))

🔇 Additional comments (16)
tests/docs/test_python_api_docs.py (1)

24-24: LGTM!

Also applies to: 112-112

docs/reference/api/python-library-reference/nemo_fabric.client.md (1)

4-4: LGTM!

Also applies to: 154-154

docs/reference/api/python-library-reference/nemo_fabric.models.md (1)

4-4: LGTM!

docs/reference/api/python-library-reference/nemo_fabric.runtime.md (1)

67-72: LGTM!

Also applies to: 112-134

.agents/skills/contribute-adapter/SKILL.md (1)

86-90: LGTM!

skills/nemo-fabric-integrate/SKILL.md (1)

126-131: LGTM!

Also applies to: 264-264, 283-283

skills/nemo-fabric-integrate/references/sdk-api-inventory.md (1)

13-13: LGTM!

Also applies to: 40-43, 63-63

docs/index.yml (1)

45-46: LGTM!

scripts/generate_api_docs.sh (1)

26-26: LGTM!

Also applies to: 78-82

docs/about-nemo-fabric/overview.mdx (1)

121-130: LGTM!

Also applies to: 164-169

README.md (1)

149-152: LGTM!

python/src/nemo_fabric/streaming.py (1)

28-371: LGTM!

python/src/nemo_fabric/client.py (1)

28-32: LGTM!

Also applies to: 196-198, 218-281

python/src/nemo_fabric/runtime.py (1)

61-76: LGTM!

Also applies to: 109-113, 144-157, 230-277, 331-332, 350-366

python/src/nemo_fabric/__init__.py (1)

39-39: LGTM!

Also applies to: 70-70

tests/python/test_streaming.py (1)

1-303: LGTM!

Comment thread docs/about-nemo-fabric/overview.mdx Outdated
Comment thread docs/reference/api/python-library-reference/index.md Outdated
Comment thread docs/reference/api/python-library-reference/nemo_fabric.streaming.md Outdated
Comment thread docs/sdk/python.mdx Outdated
Comment thread python/src/nemo_fabric/runtime.py Outdated
Comment thread skills/nemo-fabric-integrate/SKILL.md Outdated
Comment thread skills/nemo-fabric-integrate/SKILL.md Outdated
@yczhang-nv yczhang-nv changed the title feat: add Relay-backed adapter streaming feat: add Relay-backed runtime streaming Jul 23, 2026
@yczhang-nv
yczhang-nv marked this pull request as ready for review July 23, 2026 21:54
@yczhang-nv
yczhang-nv requested review from a team as code owners July 23, 2026 21:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/nemo-fabric-integrate/SKILL.md`:
- Around line 176-177: Revise the concurrency statement near “NeMo Fabric owns
no application scheduling queue” to distinguish the absence of global or
consumer-level scheduling, retry, and concurrency policies from the existing
per-Runtime restriction. Explicitly state that each Runtime accepts only one
active invocation and rejects overlapping calls, directing parallel work to
independent runtimes.

In `@tests/docs/test_python_api_docs.py`:
- Line 92: Remove the -> None return annotation from
test_streaming_reference_hides_constructor_and_preserves_async_methods, leaving
the test function name and body unchanged.

In `@tests/python/test_streaming.py`:
- Around line 165-177: The request construction in the streaming test helper
must send headers without payload first, then await the `100 Continue` response
when `expect_continue` is enabled before writing and draining the body. Update
the helper’s writer flow while preserving the existing final `200 OK` assertion
and non-expect flow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: ea50b447-40b7-4bc9-9d2b-ad6eb32ddf6f

📥 Commits

Reviewing files that changed from the base of the PR and between c99f105 and 18e3955.

📒 Files selected for processing (11)
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/sdk/python.mdx
  • python/src/nemo_fabric/runtime.py
  • python/src/nemo_fabric/streaming.py
  • scripts/generate_api_docs.sh
  • skills/nemo-fabric-integrate/SKILL.md
  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: Test (Python 3.11, windows-amd64)
  • GitHub Check: Test (Python 3.12, windows-amd64)
  • GitHub Check: Test (Python 3.13, windows-amd64)
  • GitHub Check: Test (Python 3.14, windows-amd64)
🧰 Additional context used
📓 Path-based instructions (33)
**/*.{md,rst}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Update documentation and examples in the same branch as the public API change.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/SKILL.md
{README.md,docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repository references, and build commands current in documentation and examples.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
{docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Update relevant getting-started, reference, adapter, and example documentation when the corresponding examples or adapters change.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
docs/**/*.{md,mdx,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Run just docs when the documentation site changes.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
**/*

📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)

**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.

**/*: Always spell NVIDIA in all caps; do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names with NVIDIA on first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...

Files:

  • docs/reference/api/python-library-reference/index.md
  • scripts/generate_api_docs.sh
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
  • tests/docs/test_python_api_docs.py
  • skills/nemo-fabric-integrate/SKILL.md
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spell NVIDIA in all caps; do not use Nvidia, nvidia, or NV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such as here or read more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once, and prefer refer to over see when directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.

**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
  • skills/nemo-fabric-integrate/SKILL.md
**/*.{md,rst,txt,adoc}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)

**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Use can for possibility and reserve may for permission; use after for temporal order; use refer to for cross-references; prefer short direct sentences and specific verbs; avoid unnecessary please in technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: use for example or such as instead of e.g., and so on instead of etc., that is instead of i.e., compared to instead of vs., and by, through, or using instead of via. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Use that without commas for essential clauses, and which with commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such as June 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space before a.m. or p.m.; use ET and PT for needed time zones; avoid 24/7; and prefer from 12:30 to 1:00 p.m. for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/SKILL.md
docs/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Update Fern documentation under docs/ when public behavior, the nemo-fabric package, examples, or supported bindings change.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
docs/reference/api/**

📄 CodeRabbit inference engine (AGENTS.md)

Regenerate or update generated API references under docs/reference/api/ when the public API changes.

Treat all files under docs/reference/api/ as generated output and do not modify them directly.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
**/*.{md,mdx}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

**/*.{md,mdx}: Use the full product name NVIDIA NeMo Fabric on its first usage, typically in the title or H1; use NeMo Fabric thereafter.
Use fabric by itself only when referring to the CLI tool, and surround those references with backticks.
Capitalize NVIDIA correctly in public documentation.
Format commands, code elements, expressions, file names, paths, and filenames as inline code where needed.
Use title case consistently for headings in technical documentation.
Introduce code blocks, tables, and lists with complete lead-in sentences.
Use descriptive anchor text instead of raw URLs or generic link text such as here.
Prefer active voice, present tense, short sentences, and plain English.
Use consistent terminology for the same concept throughout a document.
Write procedures as imperative, parallel, easy-to-scan steps, and split long sequences into smaller tasks.
Use after instead of once when expressing temporal sequence.
Use can instead of may when the intended meaning is possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
Introduce examples' code blocks with full sentences and ensure examples match current APIs and build commands.

For documentation-site changes, run just docs to regenerate Python and Rust API references and validate Fern configuration.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
  • skills/nemo-fabric-integrate/SKILL.md
**/{README.md,*.md,*.mdx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update relevant SDK, API, adapter, example, integration, and embedded documentation when public behavior or the corresponding surface changes.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
  • skills/nemo-fabric-integrate/SKILL.md
**/*.{html,md}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

HTML and Markdown files must use the specified HTML comment form for SPDX license headers.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • skills/nemo-fabric-integrate/SKILL.md
{docs/**,README.md,AGENTS.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,AGENTS.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency with generated schemas.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
{*.md,**/*.md,**/*.mdx,**/*.ipynb}

⚙️ CodeRabbit configuration file

{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercase fabric CLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.

Files:

  • docs/reference/api/python-library-reference/index.md
  • docs/about-nemo-fabric/overview.mdx
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/sdk/python.mdx
  • skills/nemo-fabric-integrate/SKILL.md
scripts/generate_api_docs.sh

📄 CodeRabbit inference engine (AGENTS.md)

Keep the stable public wrapper scripts/generate_api_docs.sh at the scripts/ root and reference it in docs and examples; use namespaced paths under scripts/docs/ only for internal maintenance documentation.

For Python API reference changes, update scripts/generate_api_docs.sh when the generator itself requires changes.

Files:

  • scripts/generate_api_docs.sh
**/*.{toml,yml,yaml,sh,bash}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

TOML, YAML, and shell files must use the specified #-comment SPDX license header.

Files:

  • scripts/generate_api_docs.sh
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

In MDX files, use JSX comment delimiters ({/* and */}) for top-of-file comments, including SPDX headers; do not use HTML comments.

Use {/* ... */} delimiters for top-of-file MDX SPDX comments, not HTML comment delimiters.

MDX files must use a JSX comment for the SPDX license header.

Files:

  • docs/about-nemo-fabric/overview.mdx
  • docs/sdk/python.mdx
docs/sdk/python.mdx

📄 CodeRabbit inference engine (AGENTS.md)

Keep docs/sdk/python.mdx current when the public Python API changes.

Files:

  • docs/sdk/python.mdx
**/*.{rs,py,pyi,json,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.

Files:

  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
**/*.{rs,py}

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

For native binding changes, run cargo check -p fabric-python --locked.

Files:

  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If Python code or a Python-facing adapter changes, run just test-python.

Use type annotations for public Python APIs and keep native Python binding declarations synchronized with their Rust implementations.

Files:

  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
**/*.{rs,py,pyi}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests in just test-rust pass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes under schemas/ and generated API references.

**/*.{rs,py,pyi}: Use snake_case for Rust and Python functions and variables; use PascalCase for Rust types and Python classes.
Keep native Python binding declarations synchronized with their Rust implementations when public contracts change.

Files:

  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
**/*.{py,pyi,rs}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

For Python SDK or PyO3 binding changes, use python-tests, run focused pytest tests first, then just test-python; rebuild with just build-python when native code or packaging changes.

Files:

  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
tests/**/*.{rs,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the corresponding Rust crate or the relevant area under tests/.

Files:

  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)

tests/**/*.py: Use Pytest to run Python tests.
Do not add @pytest.mark.asyncio to tests; async tests are automatically detected and run by the async runner.
Do not add -> None return type annotations to test functions.
When mocking a class, use unittest.mock.MagicMock or unittest.mock.AsyncMock, using the spec argument when necessary, rather than defining a new class.
Prefix mocked class names with mock, not fake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files in conftest.py.
Define fixtures using @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and a function named <fixture_name>_fixture; specify scope only when it is not function.
Prefer pytest.mark.parametrize over separate tests for different input types.
Use @pytest.mark.usefixtures when a fixture is needed but its return value is unused or it does not return a value.
Use the autouse restore_environ_fixture from tests/conftest.py to restore environment variables; modify variables with os.environ and do not use monkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as using results["data"] instead of results.get("data").

Files:

  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
**/*.{rs,py,toml}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

When editing version helpers, verify every nemo-fabric-* workspace package through Cargo metadata and reject a static version in python/pyproject.toml.

Files:

  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
**/*.{toml,rs,py}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.

Files:

  • tests/docs/test_python_api_docs.py
  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
  • tests/python/test_streaming.py
{tests/**,python/tests/**}

⚙️ CodeRabbit configuration file

{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.

Files:

  • tests/docs/test_python_api_docs.py
  • tests/python/test_streaming.py
skills/**

📄 CodeRabbit inference engine (AGENTS.md)

skills/**: Keep consumer skills under skills/ self-contained and dependent only on supported public Python SDK contracts and published documentation; do not add repository-internal contribution guidance.
Keep consumer skills in parity with the public SDK guide, model, and type details when the Python/Rust binding contract changes.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
**/SKILL.md

⚙️ CodeRabbit configuration file

**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
python/src/nemo_fabric/**

📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)

Ensure the editable maturin build continues to produce the native extension at nemo_fabric._native, with generated artifacts placed where downstream consumers expect.

Files:

  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
python/src/nemo_fabric/**/*.py

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

For Python API reference changes, update source docstrings under python/src/nemo_fabric/ instead of editing generated reference output.

Files:

  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
python/src/nemo_fabric/**/*

⚙️ CodeRabbit configuration file

python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
🧠 Learnings (1)
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.

Applied to files:

  • python/src/nemo_fabric/streaming.py
  • python/src/nemo_fabric/runtime.py
🪛 ast-grep (0.44.1)
tests/python/test_streaming.py

[info] 162-162: use jsonify instead of json.dumps for JSON output
Context: json.dumps(record)
Note: [CWE-116] Improper Encoding or Escaping of Output.

(use-jsonify)


[warning] 159-159: Do not make http calls without encryption
Context: "http://"
Note: [CWE-319] Cleartext Transmission of Sensitive Information.

(requests-http)


[warning] 182-182: Do not make http calls without encryption
Context: "http://"
Note: [CWE-319] Cleartext Transmission of Sensitive Information.

(requests-http)

🪛 Ruff (0.15.21)
python/src/nemo_fabric/runtime.py

[warning] 153-153: Too many branches (13 > 12)

(PLR0912)


[warning] 153-153: Too many statements (54 > 50)

(PLR0915)


[warning] 294-297: Avoid specifying long messages outside the exception class

(TRY003)

🔇 Additional comments (12)
python/src/nemo_fabric/streaming.py (1)

4-4: LGTM!

Also applies to: 40-40, 109-118, 344-350

python/src/nemo_fabric/runtime.py (1)

61-61: LGTM!

Also applies to: 75-76, 109-114, 149-155, 241-242, 259-261, 292-299, 333-334, 359-368

tests/python/test_streaming.py (1)

20-28: LGTM!

Also applies to: 44-47, 182-191, 227-247, 301-327, 380-384, 404-441

scripts/generate_api_docs.sh (2)

81-85: Use the Markdown SPDX delimiter for the new generated page.

This new call generates nemo_fabric.streaming.md, but add_frontmatter emits {/* ... */}. That violates the required Markdown header syntax and reproduces the existing generated-reference issue. Make the helper select HTML comments for .md files, then regenerate the reference.

As per coding guidelines, Markdown SPDX headers must use <!-- ... -->; JSX delimiters are reserved for MDX.

Source: Coding guidelines


26-26: LGTM!

Also applies to: 45-47

docs/reference/api/python-library-reference/index.md (1)

15-15: LGTM!

Also applies to: 25-25

docs/reference/api/python-library-reference/nemo_fabric.runtime.md (1)

67-72: LGTM!

Also applies to: 112-135

docs/reference/api/python-library-reference/nemo_fabric.streaming.md (1)

9-10: LGTM!

Also applies to: 17-21, 28-36, 39-50, 52-52

docs/about-nemo-fabric/overview.mdx (1)

145-146: LGTM!

docs/sdk/python.mdx (1)

248-248: LGTM!

Also applies to: 311-393

tests/docs/test_python_api_docs.py (1)

21-27: LGTM!

Also applies to: 93-99, 117-120

skills/nemo-fabric-integrate/SKILL.md (1)

126-133: LGTM!

Also applies to: 164-175, 178-181, 265-265, 284-284

Comment thread skills/nemo-fabric-integrate/SKILL.md Outdated
Comment thread tests/docs/test_python_api_docs.py Outdated
Comment thread tests/python/test_streaming.py
@github-actions

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (1)
skills/nemo-fabric-integrate/SKILL.md (1)

176-181: ⚠️ Potential issue | 🟡 Minor

Scope the concurrency statement to match the per-runtime contract.

Line 124 says each runtime accepts one active invocation and rejects overlap, but Lines 176-177 still say NeMo Fabric owns no “concurrency limit.” State that there is no global or consumer-level concurrency policy while retaining the per-runtime restriction.

As per path instructions, documentation must match current API behavior. This repeats the prior review finding on the same wording.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/nemo-fabric-integrate/SKILL.md` around lines 176 - 181, Update the
concurrency wording near the Relay-backed streaming guidance to state that NeMo
Fabric has no global or consumer-level concurrency policy, while explicitly
preserving the per-runtime contract that each runtime accepts only one active
invocation and rejects overlapping work. Keep the existing transport-queue and
backpressure descriptions unchanged.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/reference/api/python-library-reference/nemo_fabric.models.md`:
- Line 671: Update the generator or source documentation for the
RelayAtofFileSinkConfig and RelayAtofStreamSinkConfig headings so each heading
is surrounded by blank lines, then regenerate the Python library reference. Do
not edit the generated Markdown output directly.

In
`@docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayconfigpolicy.mdx`:
- Line 5: Update the source navigation metadata that generates the position
frontmatter for RelayConfigPolicy, RelayObservabilityConfig, RelayOtlpConfig,
ToolsConfig, and ToolsPlan, then run the documentation generation command so all
five generated references are refreshed. Do not edit any files under
docs/reference/api directly; affected files are
docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayconfigpolicy.mdx:5,
struct-relayobservabilityconfig.mdx:5, struct-relayotlpconfig.mdx:5,
struct-toolsconfig.mdx:5, and struct-toolsplan.mdx:5.

In `@python/src/nemo_fabric/models.py`:
- Around line 258-259: Update the Python dependency constraints in
pyproject.toml to require Pydantic 2.12 or newer, matching the exclude_if usage
in the headers and header_env fields of the relevant model. Keep these Field
definitions unchanged so empty mappings continue to be omitted during
serialization.

In `@python/src/nemo_fabric/streaming.py`:
- Around line 97-122: The _finalize method waits on self._task before draining
self._listener.records, allowing a producer blocked in _emit to deadlock
shutdown. Reorder the finalization flow to drain the bounded queue before
waiting for the invocation task, or run queue draining concurrently with the
shielded task wait, while preserving the existing drain deadline and
finalization behavior.

In `@scripts/generate_api_docs.sh`:
- Around line 81-85: Update add_frontmatter to select the SPDX comment delimiter
from the target file extension, emitting HTML comments for .md files while
preserving JSX comments for JSX-compatible targets. Ensure the
nemo_fabric.streaming.md invocation produces valid Markdown frontmatter
comments.

---

Duplicate comments:
In `@skills/nemo-fabric-integrate/SKILL.md`:
- Around line 176-181: Update the concurrency wording near the Relay-backed
streaming guidance to state that NeMo Fabric has no global or consumer-level
concurrency policy, while explicitly preserving the per-runtime contract that
each runtime accepts only one active invocation and rejects overlapping work.
Keep the existing transport-queue and backpressure descriptions unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: b447f4ef-f49c-44ff-b464-960ee026737e

📥 Commits

Reviewing files that changed from the base of the PR and between 18e3955 and 598bc65.

📒 Files selected for processing (52)
  • .agents/skills/contribute-adapter/SKILL.md
  • README.md
  • adapters/common/src/nemo_fabric_adapters/common/utils.py
  • adapters/deepagents/README.md
  • adapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • crates/fabric-core/src/config.rs
  • docs/about-nemo-fabric/overview.mdx
  • docs/index.yml
  • docs/reference/api/python-library-reference/index.md
  • docs/reference/api/python-library-reference/nemo_fabric.client.md
  • docs/reference/api/python-library-reference/nemo_fabric.models.md
  • docs/reference/api/python-library-reference/nemo_fabric.runtime.md
  • docs/reference/api/python-library-reference/nemo_fabric.streaming.md
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-capabilitykind.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-capabilitytarget.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatifstorageconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofmode.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofsinkconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofstreamfieldnamepolicy.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofstreamtransport.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/index.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayatofconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relaycomponentconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayconfigpolicy.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayobservabilityconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayotlpconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-toolsconfig.mdx
  • docs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-toolsplan.mdx
  • docs/sdk/python.mdx
  • examples/code_review_agent/config.py
  • examples/notebooks/02_variations.ipynb
  • python/src/nemo_fabric/__init__.py
  • python/src/nemo_fabric/client.py
  • python/src/nemo_fabric/integrations/harbor/fabric_agent.py
  • python/src/nemo_fabric/models.py
  • python/src/nemo_fabric/runtime.py
  • python/src/nemo_fabric/streaming.py
  • schemas/agent.schema.json
  • schemas/run-plan.schema.json
  • scripts/generate_api_docs.sh
  • skills/nemo-fabric-integrate/SKILL.md
  • skills/nemo-fabric-integrate/references/config-mapping.md
  • skills/nemo-fabric-integrate/references/sdk-api-inventory.md
  • tests/adapters/test_adapaters_common_utils.py
  • tests/adapters/test_deepagents.py
  • tests/adapters/test_hermes_adapter.py
  • tests/docs/test_python_api_docs.py
  • tests/e2e/test_claude.py
  • tests/python/test_sdk_contract.py
  • tests/python/test_streaming.py

Comment thread docs/reference/api/python-library-reference/nemo_fabric.models.md
Comment thread python/src/nemo_fabric/models.py Outdated
Comment thread python/src/nemo_fabric/streaming.py Outdated
Comment thread scripts/generate_api_docs.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
python/src/nemo_fabric/streaming.py (1)

99-128: ⚠️ Potential issue | 🟠 Major

Duplicate: drain the bounded queue before waiting for completion.

_finalize() still awaits self._task before consuming the bounded queue. If _emit() is blocked in queue.put() because the queue is full, aclose() or shutdown waits on a task that cannot finish, so the drain deadline is never reached. Drain concurrently with the task wait, or drain before awaiting the task.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/src/nemo_fabric/streaming.py` around lines 99 - 128, Update _finalize
so it drains the bounded listener queue before or concurrently with awaiting
self._task. Ensure a producer blocked in queue.put() can make progress and that
the existing drain deadline and completion tracking remain intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/sdk/python.mdx`:
- Around line 414-418: Update the warning description in the SDK listener
documentation to state that the RuntimeWarning is emitted only when async
iteration reaches the post-turn drain timeout without a Relay connection.
Clarify that callers using only stream.result() still receive the terminal
result and do not necessarily receive this warning; preserve the
network-namespace limitation.

In `@python/src/nemo_fabric/streaming.py`:
- Around line 345-347: Update the _sink_name helper’s sink parameter to use the
project’s supported concrete sink model union, typed mapping, or narrow protocol
instead of Any, while preserving its existing name extraction behavior for
mapping and attribute-based sinks.

---

Outside diff comments:
In `@python/src/nemo_fabric/streaming.py`:
- Around line 99-128: Update _finalize so it drains the bounded listener queue
before or concurrently with awaiting self._task. Ensure a producer blocked in
queue.put() can make progress and that the existing drain deadline and
completion tracking remain intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: a0b66970-0c06-4ccc-95c9-4460abd0770e

📥 Commits

Reviewing files that changed from the base of the PR and between 598bc65 and 501873b.

📒 Files selected for processing (6)
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • docs/sdk/python.mdx
  • python/src/nemo_fabric/streaming.py
  • skills/nemo-fabric-integrate/SKILL.md
  • tests/adapters/test_hermes_config_builder.py
  • tests/python/test_streaming.py
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: Test (Python 3.12, windows-amd64)
  • GitHub Check: Pre-commit
🧰 Additional context used
📓 Path-based instructions (37)
**/*.{rs,py,pyi,json,yaml,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Determine and update every affected public surface, including the CLI, PyO3 bindings, Python SDK, type stubs, schemas, and adapter contract, so they remain in parity.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
**/*

📄 CodeRabbit inference engine (.agents/skills/karpathy-guidelines/SKILL.md)

**/*: Before implementing, explicitly state assumptions, surface ambiguity and tradeoffs, present multiple interpretations when relevant, and ask for clarification rather than silently deciding or proceeding when requirements are unclear.
Prefer the minimum code needed to solve the requested problem: avoid speculative features, unnecessary abstractions, unrequested flexibility, and handling of impossible scenarios; simplify overcomplicated solutions.
When editing existing code, make surgical changes only: do not modify unrelated code, comments, formatting, or pre-existing dead code; match the existing style, and remove only unused imports, variables, or functions introduced by your changes.
Define verifiable success criteria for each task, such as writing regression tests for bugs and invalid-input tests for validation, then verify the implementation against those criteria. For multi-step work, state a brief plan with a verification check for each step.

**/*: Always spell NVIDIA in all caps; do not use Nvidia, nvidia, nVidia, nVIDIA, or NV.
Use an NVIDIA before a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol after NVIDIA when referring to the company; use trademark symbols with product names only when required by the document type or legal guidance.
Verify official capitalization, spacing, hyphenation, and spelling for NVIDIA and third-party product names; do not rewrite official product names for grammar or title-case rules.
Precede NVIDIA product names with NVIDIA on first mention when natural and accurate, and link the first mention when the destination helps the reader.
On first use, include the company name and full model qualifier when it helps identify the model; preserve official capitalization and punctuation, and use shorter family names only after establishing the full name.
For learning-oriented and developer content, do not force trademark symbols unless explicitly required; for press, ...

Files:

  • tests/adapters/test_hermes_config_builder.py
  • docs/sdk/python.mdx
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • skills/nemo-fabric-integrate/SKILL.md
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
**/*.{rs,py}

📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)

For native binding changes, run cargo check -p fabric-python --locked.

**/*.{rs,py}: Use snake_case for functions and variables; use PascalCase for Rust types and Python classes.
Run tests for every affected language surface; changes to the Rust core or public schemas require both Rust and Python test suites.
Keep native Python binding declarations synchronized with their Rust implementations when public contracts change.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
**/*.{py,pyi}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If Python code or a Python-facing adapter changes, run just test-python.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
**/*.{rs,py,pyi}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*.{rs,py,pyi}: If public configuration types change, confirm schema snapshot tests in just test-rust pass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes under schemas/ and generated API references.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
tests/adapters/**/*.py

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

tests/adapters/**/*.py: If an adapter or integration changes, run its focused tests.
For adapter behavior changes, run focused adapter tests under tests/adapters, then run just test-python.

Files:

  • tests/adapters/test_hermes_config_builder.py
**/*.{py,pyi,rs}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

For Python SDK or PyO3 binding changes, use python-tests, run focused pytest tests first, then just test-python; rebuild with just build-python when native code or packaging changes.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/python-tests/SKILL.md)

tests/**/*.py: Use Pytest to run Python tests.
Do not add @pytest.mark.asyncio to tests; async tests are automatically detected and run by the async runner.
Do not add -> None return type annotations to test functions.
When mocking a class, use unittest.mock.MagicMock or unittest.mock.AsyncMock, using the spec argument when necessary, rather than defining a new class.
Prefix mocked class names with mock, not fake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files in conftest.py.
Define fixtures using @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and a function named <fixture_name>_fixture; specify scope only when it is not function.
Prefer pytest.mark.parametrize over separate tests for different input types.
Use @pytest.mark.usefixtures when a fixture is needed but its return value is unused or it does not return a value.
Use the autouse restore_environ_fixture from tests/conftest.py to restore environment variables; modify variables with os.environ and do not use monkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as using results["data"] instead of results.get("data").

Files:

  • tests/adapters/test_hermes_config_builder.py
  • tests/python/test_streaming.py
**/*.{rs,py,toml}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

When editing version helpers, verify every nemo-fabric-* workspace package through Cargo metadata and reject a static version in python/pyproject.toml.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
**/*.{toml,rs,py}

📄 CodeRabbit inference engine (.agents/skills/update-project-version/SKILL.md)

Avoid blind repository-wide replacement of version-like strings; distinguish package-version references from examples and unrelated dependency versions.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.py: Use type annotations for public Python APIs and keep native binding declarations synchronized with their Rust implementations.
Python files must use the specified Python # SPDX header format.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
  • python/src/nemo_fabric/streaming.py
  • tests/python/test_streaming.py
**/tests/**/*.{rs,py}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

When adding functionality, include tests in the corresponding Rust crate or relevant tests/ area.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • tests/python/test_streaming.py
tests/adapters/**/*test*.py

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

Include a subprocess test of the packaged entry point covering stdout, exit code, interpreter, descriptor discovery, and package data.

Files:

  • tests/adapters/test_hermes_config_builder.py
{tests/**,python/tests/**}

⚙️ CodeRabbit configuration file

{tests/**,python/tests/**}: Tests should cover the behavior promised by the changed API surface, including error paths, lifecycle cleanup, and SDK/native parity where relevant.

Files:

  • tests/adapters/test_hermes_config_builder.py
  • tests/python/test_streaming.py
{README.md,docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Keep package names, repository references, and build commands current in documentation and examples.

Files:

  • docs/sdk/python.mdx
{docs/**/*.{md,mdx,yml},examples/**/*.{md,mdx,yml}}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Update relevant getting-started, reference, adapter, and example documentation when the corresponding examples or adapters change.

Files:

  • docs/sdk/python.mdx
**/*.mdx

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

In MDX files, use JSX comment delimiters ({/* and */}) for top-of-file comments, including SPDX headers; do not use HTML comments.

Use {/* ... */} delimiters for top-of-file MDX SPDX comments, not HTML comment delimiters.

**/*.mdx: For documentation-site changes, run just docs to regenerate Python and Rust API references and validate Fern configuration.
MDX files must use the specified JSX-comment SPDX header format.

Files:

  • docs/sdk/python.mdx
docs/**/*.{md,mdx,yml}

📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)

Run just docs when the documentation site changes.

Files:

  • docs/sdk/python.mdx
**/*.{md,mdx,rst}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)

**/*.{md,mdx,rst}: For NeMo Fabric documentation, verify technical claims against the current repository, public API, or documented command before reviewing style.
Always spell NVIDIA in all caps; do not use Nvidia, nvidia, or NV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text; avoid raw URLs and weak anchors such as here or read more.
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative, parallel steps; split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English while preserving necessary technical precision.
Use can for possibility and reserve may for permission.
Use after for temporal relationships instead of once, and prefer refer to over see when directing readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values; use numerals for 10 or greater and commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not replace precise technical terms with simpler words when doing so would lose precision.
Do not flag passive voice when the actor is unknown or the action is the important part.
Do not rewrite API names, package names, command flags, or code literals for style.

**/*.{md,mdx,rst}: Use consistent title case for technical-document headings and table headers; avoid quotation marks, ampersands, and exclamation marks in headings, while preserving official product, event, research, and whitepaper title ...

Files:

  • docs/sdk/python.mdx
  • skills/nemo-fabric-integrate/SKILL.md
docs/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Update Fern documentation under docs/ when public behavior, the nemo-fabric package, examples, or supported bindings change.

Files:

  • docs/sdk/python.mdx
docs/sdk/python.mdx

📄 CodeRabbit inference engine (AGENTS.md)

Keep docs/sdk/python.mdx current when the public Python API changes.

Files:

  • docs/sdk/python.mdx
**/*.{md,mdx}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

**/*.{md,mdx}: Use the full product name NVIDIA NeMo Fabric on its first usage, typically in the title or H1; use NeMo Fabric thereafter.
Use fabric by itself only when referring to the CLI tool, and surround those references with backticks.
Capitalize NVIDIA correctly in public documentation.
Format commands, code elements, expressions, file names, paths, and filenames as inline code where needed.
Use title case consistently for headings in technical documentation.
Introduce code blocks, tables, and lists with complete lead-in sentences.
Use descriptive anchor text instead of raw URLs or generic link text such as here.
Prefer active voice, present tense, short sentences, and plain English.
Use consistent terminology for the same concept throughout a document.
Write procedures as imperative, parallel, easy-to-scan steps, and split long sequences into smaller tasks.
Use after instead of once when expressing temporal sequence.
Use can instead of may when the intended meaning is possibility rather than permission.
Avoid ambiguous numeric dates and ordinal dates in body text.
For learning-oriented documentation, do not force trademark symbols unless the source document explicitly requires them.
Introduce examples' code blocks with full sentences and ensure examples match current APIs and build commands.

Update corresponding documentation when public behavior, adapters, examples, or workspace structure changes.

Files:

  • docs/sdk/python.mdx
  • skills/nemo-fabric-integrate/SKILL.md
{docs/**,README.md,AGENTS.md}

⚙️ CodeRabbit configuration file

{docs/**,README.md,AGENTS.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency with generated schemas.

Files:

  • docs/sdk/python.mdx
{*.md,**/*.md,**/*.mdx,**/*.ipynb}

⚙️ CodeRabbit configuration file

{*.md,**/*.md,**/*.mdx,**/*.ipynb}: Enforce the product name in user-facing prose: use "NVIDIA NeMo Fabric" on first use and "NeMo Fabric" thereafter. Flag standalone capitalized "Fabric" when it refers to the product. Do not flag the lowercase fabric CLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.

Files:

  • docs/sdk/python.mdx
  • skills/nemo-fabric-integrate/SKILL.md
adapters/**

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

Place repository adapters under adapters/<name>, with the required license, README, descriptor, native package files, source entry point, and focused tests.

Files:

  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
adapters/**/*.py

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

adapters/**/*.py: For Python adapters, use pyproject.toml, uv.lock, src/nemo_fabric_adapters/<name>/adapter.py, and tests/adapters/test_<name>*.py.
Apply configuration precedence in this order: normalized config, Fabric-resolved plans and runtime context, harness-specific settings, then descriptor and adapter defaults.
Reject conflicting duplicate declarations or unsupported behavior with actionable errors naming the field and supported alternatives; never silently drop configuration.
Never expose credential values in output, errors, events, logs, or fixtures.
Forward only required system variables, selected credential variables, telemetry variables, and documented harness-specific environment; never forward or log unrelated environment values.
Keep one local adapter host alive for ordered startinvoke*stop; emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invoke failures as successful lifecycle responses with response: null, failed: true, and structured error fields.
Do not emit stream records on adapter stdout; relay-backed streaming must still return exactly one terminal lifecycle response.
Scope workspace, generated configuration, state, sessions, and artifacts to the resolved runtime context, and isolate stateful adapters by Fabric runtime ID.
Keep stdout stable by emitting response and adapter-specific extensions only; Fabric supplies top-level identity, lifecycle, artifact, telemetry, and metadata fields.

Files:

  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
adapters/**/*.{py,json}

📄 CodeRabbit inference engine (.agents/skills/contribute-adapter/SKILL.md)

adapters/**/*.{py,json}: Use the complete Fabric invocation and treat config, capability_plan, telemetry_plan, and runtime_context as authoritative; reserve harness.settings for harness-specific behavior.
Declare fixed dependencies in descriptor requirements and validate selected versions, hooks, and credentials before invoking the harness.
Claim capabilities only when they are implemented and tested end to end; reject unsupported providers, transports, fields, or unenforceable policies.

Files:

  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
{adapters/**,examples/**}

⚙️ CodeRabbit configuration file

{adapters/**,examples/**}: Review adapter and example changes for command correctness, config/schema consistency, artifact handling, and compatibility with the public NeMo Fabric contracts.

Files:

  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
**/*.{md,rst}

📄 CodeRabbit inference engine (.agents/skills/contribute-api/SKILL.md)

Update documentation and examples in the same branch as the public API change.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
**/*.{md,rst,txt,adoc}

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-language-mechanics.md)

**/*.{md,rst,txt,adoc}: For technical documentation, use professional, active, conversational, engaging, precise, and plain-English prose. Prefer active voice, present tense, short sentences, and scannable paragraphs. Avoid casual or imprecise language, swearing, threats, insults, jokes, puns, culture-specific idioms, marketing exaggeration, and unsupported third-party comparisons.
Use can for possibility and reserve may for permission; use after for temporal order; use refer to for cross-references; prefer short direct sentences and specific verbs; avoid unnecessary please in technical documentation.
Prefer active voice when the actor matters. Passive voice is acceptable when the actor is unknown or irrelevant, when the action or result is the focus, or in programmer documentation.
Use natural contractions in conversational technical prose, but do not force them in formal legal copy, API references, or generated text.
Prefer simpler English over Latinisms: use for example or such as instead of e.g., and so on instead of etc., that is instead of i.e., compared to instead of vs., and by, through, or using instead of via. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Use that without commas for essential clauses, and which with commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such as June 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space before a.m. or p.m.; use ET and PT for needed time zones; avoid 24/7; and prefer from 12:30 to 1:00 p.m. for prose ranges.
Format numbers consistently: spell out zero through nine in body text, use numerals for 10 or greater and for technical values, use commas in thousands, do not begin a sentence with a numeral, spell out ordinals, and use numerals consistently within a category wh...

Files:

  • skills/nemo-fabric-integrate/SKILL.md
skills/**

📄 CodeRabbit inference engine (AGENTS.md)

skills/**: Keep consumer skills under skills/ self-contained and dependent only on supported public Python SDK contracts and published documentation; do not add repository-internal contribution guidance.
Keep consumer skills in parity with the public SDK guide, model, and type details when the Python/Rust binding contract changes.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

HTML/Markdown source files must use the specified HTML-comment SPDX header format.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
**/skills/**/SKILL.md

📄 CodeRabbit inference engine (.agents/skills/README.md)

Keep consumer-facing integration guidance in the top-level skills/ directory and out of the maintainer skill set.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
**/SKILL.md

⚙️ CodeRabbit configuration file

**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.

Files:

  • skills/nemo-fabric-integrate/SKILL.md
python/src/nemo_fabric/**

📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)

Ensure the editable maturin build continues to produce the native extension at nemo_fabric._native, with generated artifacts placed where downstream consumers expect.

Files:

  • python/src/nemo_fabric/streaming.py
python/src/nemo_fabric/**/*.py

📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)

For Python API reference changes, update source docstrings under python/src/nemo_fabric/ instead of editing generated reference output.

Files:

  • python/src/nemo_fabric/streaming.py
python/src/nemo_fabric/**/*

⚙️ CodeRabbit configuration file

python/src/nemo_fabric/**/*: Review Python SDK changes for typed API consistency, import-time dependency neutrality, async/session behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.

Files:

  • python/src/nemo_fabric/streaming.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-24T04:18:38.517Z
Learning: Use the closest existing adapter only for harness-specific patterns, not as the authority for the core contract.
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-24T04:18:38.517Z
Learning: Run the applicable validation commands, including adapter tests, package and lockfile checks, language-specific tests, formatting, documentation generation, pre-commit checks, and `git diff --check`.
Learnt from: CR
Repo: NVIDIA/NeMo-Fabric

Timestamp: 2026-07-24T04:18:38.517Z
Learning: Wire public adapter packages into language-native installation, descriptors, build, catalog, CI, and generated artifact surfaces.
📚 Learning: 2026-07-09T22:28:51.689Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 43
File: adapters/claude-sdk/src/nemo_fabric_adapters/claude_sdk/adapter.py:164-168
Timestamp: 2026-07-09T22:28:51.689Z
Learning: In the NeMo-Fabric adapters, treat path values used in Fabric adapter configuration (including logic like `_resolve_path` in adapter.py) as config-root-relative. Do not apply `Path.expanduser()` (or otherwise apply `~`/home or shell-style expansion), because it will make the resolved paths normalize inconsistently across adapters. Also, do not rely on or add any resolution behavior that uses `harness.settings.cwd` as an override point for these adapter paths—`harness.settings.cwd` is explicitly unsupported in this adapter context.

Applied to files:

  • adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py
📚 Learning: 2026-06-28T04:03:32.877Z
Learnt from: AjayThorve
Repo: NVIDIA/NeMo-Fabric PR: 26
File: python/tests/smoke_typed_config.py:163-177
Timestamp: 2026-06-28T04:03:32.877Z
Learning: In NVIDIA NeMo Fabric Python SDK serialization of `RuntimeCapabilities` (to satisfy the “parity contract” with Rust core and the CLI), do not emit metadata keys when the corresponding metadata is absent. Instead, omit those fields entirely so the produced JSON matches the Rust/CLI output (e.g., avoid `null`, empty objects, or placeholder metadata). During review, verify the serializer/builders follow this omission rule and that Python outputs/parity tests reflect the same shape.

Applied to files:

  • python/src/nemo_fabric/streaming.py
🪛 Ruff (0.15.21)
python/src/nemo_fabric/streaming.py

[warning] 345-345: Dynamically typed expressions (typing.Any) are disallowed in sink

(ANN401)

🔇 Additional comments (7)
skills/nemo-fabric-integrate/SKILL.md (3)

180-182: Duplicate: scope the concurrency claim to global scheduling.

Line 124 already states that each runtime accepts only one active invocation, so “no ... concurrency limit” is contradictory. Clarify that there is no global or application-level concurrency policy while retaining the per-runtime restriction.

Source: Path instructions


169-169: 🎯 Functional Correctness

Verify the enable_relay() return contract in the example.

Current test usage calls config.enable_relay(...) and then continues using config. If enable_relay() mutates and returns None, this assignment makes streaming_config invalid and start_runtime() fails. Prefer the unambiguous form:

Proposed fix
-    streaming_config = config.model_copy(deep=True).enable_relay()
+    streaming_config = config.model_copy(deep=True)
+    streaming_config.enable_relay()

As per path instructions, documentation must match current API behavior.

Source: Path instructions


126-137: LGTM!

Also applies to: 269-269, 288-288

python/src/nemo_fabric/streaming.py (1)

10-10: LGTM!

Also applies to: 27-27, 30-98, 147-148, 192-205, 235-238, 350-386

tests/python/test_streaming.py (1)

37-55: LGTM!

Also applies to: 207-232, 235-271, 325-377

adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.py (1)

34-35: LGTM!

Also applies to: 66-87, 138-145, 245-249

tests/adapters/test_hermes_config_builder.py (1)

1-30: LGTM!

Comment thread docs/sdk/python.mdx Outdated
Comment thread python/src/nemo_fabric/streaming.py Outdated

@AnuradhaKaruppiah AnuradhaKaruppiah left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Four focused review notes: one documentation clarification about the intentionally deferred native harness-output contract, plus three robustness questions around backpressure, turn isolation, and memory bounds.

Comment thread docs/sdk/python.mdx Outdated
Comment thread python/src/nemo_fabric/streaming.py
Comment thread python/src/nemo_fabric/streaming.py
Comment thread python/src/nemo_fabric/streaming.py Outdated
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
@yczhang-nv
yczhang-nv force-pushed the feat/adapter-streaming branch from e8d80f0 to 1ee3e85 Compare July 24, 2026 16:52
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Signed-off-by: Yuchen Zhang <yuchenz@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants