feat: add Relay-backed runtime streaming#109
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughRelay-backed streaming is added to the Python SDK through an SDK-owned ATOF listener, ChangesRelay-backed streaming and typed ATOF sinks
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
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (19)
.agents/skills/contribute-adapter/SKILL.mdREADME.mddocs/about-nemo-fabric/overview.mdxdocs/index.ymldocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/sdk/python.mdxpython/src/nemo_fabric/__init__.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/streaming.pyscripts/generate_api_docs.shskills/nemo-fabric-integrate/SKILL.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdtests/docs/test_python_api_docs.pytests/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.ymlpython/src/nemo_fabric/__init__.pytests/docs/test_python_api_docs.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/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.ymldocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdx
{README.md,docs/index.yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Update
README.mdordocs/index.ymlwhen documentation entry points or example reading paths change.
Files:
docs/index.ymlREADME.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.ymldocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdx
docs/**/*.{md,mdx,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Run
just docswhen the documentation site changes.
Files:
docs/index.ymldocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/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 spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen 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 withNVIDIAon 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.ymlpython/src/nemo_fabric/__init__.pydocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/index.mdscripts/generate_api_docs.shREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdtests/docs/test_python_api_docs.pyskills/nemo-fabric-integrate/SKILL.mddocs/sdk/python.mdxpython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/src/nemo_fabric/runtime.py
docs/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Update Fern documentation under
docs/when public behavior, thenemo-fabricpackage, examples, or supported bindings change.
Files:
docs/index.ymldocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdx
docs/index.yml
📄 CodeRabbit inference engine (AGENTS.md)
Update
docs/index.ymlnavigation when the documentation structure changes.Update
docs/index.ymlwhen 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-ciormaintain-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.ymlscripts/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.ymldocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/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__.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pypython/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__.pytests/docs/test_python_api_docs.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/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__.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pypython/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__.pytests/docs/test_python_api_docs.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/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 injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
**/*.{rs,py,pyi}: Usesnake_casefor Rust and Python functions and variables; usePascalCasefor 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__.pytests/docs/test_python_api_docs.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/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, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.
Files:
python/src/nemo_fabric/__init__.pytests/docs/test_python_api_docs.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/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 inpython/pyproject.toml.
Files:
python/src/nemo_fabric/__init__.pytests/docs/test_python_api_docs.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/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__.pytests/docs/test_python_api_docs.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pytests/python/test_streaming.pypython/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__.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pypython/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.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdskills/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 spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
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 ashereorread 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.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen 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.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdskills/nemo-fabric-integrate/SKILL.mddocs/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.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein 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: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 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.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdskills/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.mddocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/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 nameNVIDIA NeMo Fabricon its first usage, typically in the title or H1; useNeMo Fabricthereafter.
Usefabricby itself only when referring to the CLI tool, and surround those references with backticks.
CapitalizeNVIDIAcorrectly 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 ashere.
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.
Useafterinstead ofoncewhen expressing temporal sequence.
Usecaninstead ofmaywhen 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 docsto regenerate Python and Rust API references and validate Fern configuration.
Files:
docs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdskills/nemo-fabric-integrate/SKILL.mddocs/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.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdskills/nemo-fabric-integrate/SKILL.mddocs/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.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdskills/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 lowercasefabricCLI 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.mddocs/reference/api/python-library-reference/index.mdREADME.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdskills/nemo-fabric-integrate/SKILL.mddocs/sdk/python.mdx
scripts/generate_api_docs.sh
📄 CodeRabbit inference engine (AGENTS.md)
Keep the stable public wrapper
scripts/generate_api_docs.shat thescripts/root and reference it in docs and examples; use namespaced paths underscripts/docs/only for internal maintenance documentation.For Python API reference changes, update
scripts/generate_api_docs.shwhen the generator itself requires changes.
Files:
scripts/generate_api_docs.sh
README.md
📄 CodeRabbit inference engine (AGENTS.md)
Update the root
README.mdwhen public behavior, thenemo-fabricpackage, examples, or supported bindings change.Update the top-level
README.mdwhen changed behavior affects an entry point users would naturally consult.Update the root
README.mdwhen 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/skillsas 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
nameanddescription.
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-apiandvalidate-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.mdxdocs/sdk/python.mdx
skills/**
📄 CodeRabbit inference engine (AGENTS.md)
skills/**: Keep consumer skills underskills/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.mdskills/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.pytests/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.asyncioto tests; async tests are automatically detected and run by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorunittest.mock.AsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files inconftest.py.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a function named<fixture_name>_fixture; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its return value is unused or it does not return a value.
Use the autouserestore_environ_fixturefromtests/conftest.pyto restore environment variables; modify variables withos.environand do not usemonkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
Files:
tests/docs/test_python_api_docs.pytests/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.pytests/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.mdxcurrent 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__.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/streaming.pypython/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!
There was a problem hiding this comment.
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
📒 Files selected for processing (11)
docs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/sdk/python.mdxpython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/streaming.pyscripts/generate_api_docs.shskills/nemo-fabric-integrate/SKILL.mdtests/docs/test_python_api_docs.pytests/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.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/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.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/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.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdx
docs/**/*.{md,mdx,yml}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Run
just docswhen the documentation site changes.
Files:
docs/reference/api/python-library-reference/index.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/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 spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen 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 withNVIDIAon 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.mdscripts/generate_api_docs.shdocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdxtests/docs/test_python_api_docs.pyskills/nemo-fabric-integrate/SKILL.mdpython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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 spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
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 ashereorread 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.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen 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.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdxskills/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.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein 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: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 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.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/nemo-fabric-integrate/SKILL.md
docs/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Update Fern documentation under
docs/when public behavior, thenemo-fabricpackage, examples, or supported bindings change.
Files:
docs/reference/api/python-library-reference/index.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/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.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/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 nameNVIDIA NeMo Fabricon its first usage, typically in the title or H1; useNeMo Fabricthereafter.
Usefabricby itself only when referring to the CLI tool, and surround those references with backticks.
CapitalizeNVIDIAcorrectly 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 ashere.
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.
Useafterinstead ofoncewhen expressing temporal sequence.
Usecaninstead ofmaywhen 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 docsto regenerate Python and Rust API references and validate Fern configuration.
Files:
docs/reference/api/python-library-reference/index.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdxskills/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.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdxskills/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.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mdskills/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.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/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 lowercasefabricCLI 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.mddocs/about-nemo-fabric/overview.mdxdocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/sdk/python.mdxskills/nemo-fabric-integrate/SKILL.md
scripts/generate_api_docs.sh
📄 CodeRabbit inference engine (AGENTS.md)
Keep the stable public wrapper
scripts/generate_api_docs.shat thescripts/root and reference it in docs and examples; use namespaced paths underscripts/docs/only for internal maintenance documentation.For Python API reference changes, update
scripts/generate_api_docs.shwhen 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.mdxdocs/sdk/python.mdx
docs/sdk/python.mdx
📄 CodeRabbit inference engine (AGENTS.md)
Keep
docs/sdk/python.mdxcurrent 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.pypython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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.pypython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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.pypython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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 injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
**/*.{rs,py,pyi}: Usesnake_casefor Rust and Python functions and variables; usePascalCasefor 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.pypython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.
Files:
tests/docs/test_python_api_docs.pypython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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.pytests/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.asyncioto tests; async tests are automatically detected and run by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorunittest.mock.AsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files inconftest.py.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a function named<fixture_name>_fixture; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its return value is unused or it does not return a value.
Use the autouserestore_environ_fixturefromtests/conftest.pyto restore environment variables; modify variables withos.environand do not usemonkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
Files:
tests/docs/test_python_api_docs.pytests/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 inpython/pyproject.toml.
Files:
tests/docs/test_python_api_docs.pypython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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.pypython/src/nemo_fabric/streaming.pypython/src/nemo_fabric/runtime.pytests/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.pytests/python/test_streaming.py
skills/**
📄 CodeRabbit inference engine (AGENTS.md)
skills/**: Keep consumer skills underskills/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.pypython/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.pypython/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.pypython/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.pypython/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, butadd_frontmatteremits{/* ... */}. That violates the required Markdown header syntax and reproduces the existing generated-reference issue. Make the helper select HTML comments for.mdfiles, 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
18e3955 to
598bc65
Compare
|
Fern docs preview: https://nvidia-preview-pull-request-109.docs.buildwithfern.com/nemo/fabric |
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (1)
skills/nemo-fabric-integrate/SKILL.md (1)
176-181:⚠️ Potential issue | 🟡 MinorScope 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
📒 Files selected for processing (52)
.agents/skills/contribute-adapter/SKILL.mdREADME.mdadapters/common/src/nemo_fabric_adapters/common/utils.pyadapters/deepagents/README.mdadapters/deepagents/src/nemo_fabric_adapters/deepagents/adapter.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pycrates/fabric-core/src/config.rsdocs/about-nemo-fabric/overview.mdxdocs/index.ymldocs/reference/api/python-library-reference/index.mddocs/reference/api/python-library-reference/nemo_fabric.client.mddocs/reference/api/python-library-reference/nemo_fabric.models.mddocs/reference/api/python-library-reference/nemo_fabric.runtime.mddocs/reference/api/python-library-reference/nemo_fabric.streaming.mddocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-capabilitykind.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-capabilitytarget.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatifstorageconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofmode.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofsinkconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofstreamfieldnamepolicy.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/enum-relayatofstreamtransport.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/index.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayatofconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relaycomponentconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayconfigpolicy.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayobservabilityconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-relayotlpconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-toolsconfig.mdxdocs/reference/api/rust-library-reference/nemo-fabric-core/config/struct-toolsplan.mdxdocs/sdk/python.mdxexamples/code_review_agent/config.pyexamples/notebooks/02_variations.ipynbpython/src/nemo_fabric/__init__.pypython/src/nemo_fabric/client.pypython/src/nemo_fabric/integrations/harbor/fabric_agent.pypython/src/nemo_fabric/models.pypython/src/nemo_fabric/runtime.pypython/src/nemo_fabric/streaming.pyschemas/agent.schema.jsonschemas/run-plan.schema.jsonscripts/generate_api_docs.shskills/nemo-fabric-integrate/SKILL.mdskills/nemo-fabric-integrate/references/config-mapping.mdskills/nemo-fabric-integrate/references/sdk-api-inventory.mdtests/adapters/test_adapaters_common_utils.pytests/adapters/test_deepagents.pytests/adapters/test_hermes_adapter.pytests/docs/test_python_api_docs.pytests/e2e/test_claude.pytests/python/test_sdk_contract.pytests/python/test_streaming.py
There was a problem hiding this comment.
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 | 🟠 MajorDuplicate: drain the bounded queue before waiting for completion.
_finalize()still awaitsself._taskbefore consuming the bounded queue. If_emit()is blocked inqueue.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
📒 Files selected for processing (6)
adapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pydocs/sdk/python.mdxpython/src/nemo_fabric/streaming.pyskills/nemo-fabric-integrate/SKILL.mdtests/adapters/test_hermes_config_builder.pytests/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.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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 spellNVIDIAin all caps; do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun, because the name begins with an “en” sound.
Do not add a registered trademark symbol afterNVIDIAwhen 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 withNVIDIAon 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.pydocs/sdk/python.mdxadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pyskills/nemo-fabric-integrate/SKILL.mdpython/src/nemo_fabric/streaming.pytests/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}: Usesnake_casefor functions and variables; usePascalCasefor 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.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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 injust test-rustpass and review generated schema diffs.
For schema or public contract changes, run both language suites and review changes underschemas/and generated API references.
Files:
tests/adapters/test_hermes_config_builder.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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 undertests/adapters, then runjust 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, thenjust test-python; rebuild withjust build-pythonwhen native code or packaging changes.
Files:
tests/adapters/test_hermes_config_builder.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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.asyncioto tests; async tests are automatically detected and run by the async runner.
Do not add-> Nonereturn type annotations to test functions.
When mocking a class, useunittest.mock.MagicMockorunittest.mock.AsyncMock, using thespecargument when necessary, rather than defining a new class.
Prefix mocked class names withmock, notfake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; place fixtures needed by multiple test files inconftest.py.
Define fixtures using@pytest.fixture(name="<fixture_name>"[, scope="<scope>"])and a function named<fixture_name>_fixture; specifyscopeonly when it is notfunction.
Preferpytest.mark.parametrizeover separate tests for different input types.
Use@pytest.mark.usefixtureswhen a fixture is needed but its return value is unused or it does not return a value.
Use the autouserestore_environ_fixturefromtests/conftest.pyto restore environment variables; modify variables withos.environand do not usemonkeypatch.setenv.
Avoid defensive programming in tests; access expected data directly so missing data raises a clear failure, such as usingresults["data"]instead ofresults.get("data").
Files:
tests/adapters/test_hermes_config_builder.pytests/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 inpython/pyproject.toml.
Files:
tests/adapters/test_hermes_config_builder.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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.pyadapters/hermes/src/nemo_fabric_adapters/hermes/adapter.pypython/src/nemo_fabric/streaming.pytests/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.pytests/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.pytests/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, runjust docsto 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 docswhen 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 spellNVIDIAin all caps; do not useNvidia,nvidia, orNV.
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 ashereorread 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.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce, and preferrefer tooverseewhen 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.mdxskills/nemo-fabric-integrate/SKILL.md
docs/**/*
📄 CodeRabbit inference engine (AGENTS.md)
Update Fern documentation under
docs/when public behavior, thenemo-fabricpackage, examples, or supported bindings change.
Files:
docs/sdk/python.mdx
docs/sdk/python.mdx
📄 CodeRabbit inference engine (AGENTS.md)
Keep
docs/sdk/python.mdxcurrent 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 nameNVIDIA NeMo Fabricon its first usage, typically in the title or H1; useNeMo Fabricthereafter.
Usefabricby itself only when referring to the CLI tool, and surround those references with backticks.
CapitalizeNVIDIAcorrectly 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 ashere.
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.
Useafterinstead ofoncewhen expressing temporal sequence.
Usecaninstead ofmaywhen 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.mdxskills/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 lowercasefabricCLI command, package/import/crate names, code identifiers, API symbols, configuration keys, file paths, or unrelated generic uses of the word.
Files:
docs/sdk/python.mdxskills/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, usepyproject.toml,uv.lock,src/nemo_fabric_adapters/<name>/adapter.py, andtests/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 orderedstart→invoke*→stop; emit one JSON lifecycle response per request on stdout and diagnostics on stderr.
Return harness-level invoke failures as successful lifecycle responses withresponse: null,failed: true, and structurederrorfields.
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 emittingresponseand 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 treatconfig,capability_plan,telemetry_plan, andruntime_contextas authoritative; reserveharness.settingsfor 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.
Usecanfor possibility and reservemayfor permission; useafterfor temporal order; userefer tofor cross-references; prefer short direct sentences and specific verbs; avoid unnecessarypleasein 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: usefor exampleorsuch asinstead ofe.g.,and so oninstead ofetc.,that isinstead ofi.e.,compared toinstead ofvs., andby,through, orusinginstead ofvia. Use industry-standard terms such as in silico, in vitro, and in vivo when appropriate, and italicize them in running text.
Usethatwithout commas for essential clauses, andwhichwith commas for nonessential clauses.
Format dates and times clearly: spell out months in body text; use forms such asJune 12, 2025; avoid numeric or ordinal dates; capitalize days; use 12-hour time when appropriate; include a space beforea.m.orp.m.; useETandPTfor needed time zones; avoid24/7; and preferfrom 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 underskills/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 CorrectnessVerify the
enable_relay()return contract in the example.Current test usage calls
config.enable_relay(...)and then continues usingconfig. Ifenable_relay()mutates and returnsNone, this assignment makesstreaming_configinvalid andstart_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!
AnuradhaKaruppiah
left a comment
There was a problem hiding this comment.
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.
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>
e8d80f0 to
1ee3e85
Compare
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>
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 runningand keeps the normalized terminal
RunResultout of band. Streaming is opt-in:callers pass
streaming=Truetostart_runtime(...)(with Relay enabled) toprovision 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
streamingparameter — and introduces no breaking API changes or new dependencies.Details
bounded, byte-budgeted record queue (16 MiB total / 1 MiB per record), TCP
backpressure, and a bounded post-turn drain window.
start_runtime(..., streaming=True): a relay-enabledruntime binds the loopback listener and injects the
nemo-fabric-streamATOFsink only when streaming is requested. Requesting
streaming=Truewithout Relayenabled raises
FabricConfigError.Runtime.invoke_stream(),Runtime.supports_streaming,InvokeStream.result(), and explicit early-exit cleanup viaInvokeStream.aclose().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.
RuntimeWarnings: no Relay connectionreached 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.
InvokeStream, and allow amanual
Runtime.stop()to finalize a completed stream afterresult().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.
warnings.simplefilter("error", RuntimeWarning)and assert non-empty records:
tests/e2e/test_deepagents.py(persistent host, mock model).tests/e2e/test_claude.pyandtests/e2e/test_codex.py, validating gateway turn correlation.just docs— passes; generated Python reference pages carry Markdown-safe SPDXheaders that are transformed to MDX at Fern-sync time.
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.pyfor the listener, turncorrelation, and stream lifecycle; then
python/src/nemo_fabric/client.pyfor thestreaming=Trueopt-in gate andpython/src/nemo_fabric/runtime.pyfor eagervalidation and manual shutdown. The focused behavioral coverage is in
tests/python/test_streaming.py, with end-to-end coverage undertests/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
Runtime.invoke_stream()with anInvokeStreamasync iterator of raw ATOF records and a terminalawait stream.result().Runtime.supports_streamingand streaming-aware runtime startup/stop lifecycle handling.Documentation
sinksmodel.Tests