Skip to content

Conversation

@tgasser-nv
Copy link
Collaborator

@tgasser-nv tgasser-nv commented Aug 15, 2025

Description

Related Issue(s)

Checklist

  • I've read the CONTRIBUTING guidelines.
  • I've updated the documentation if applicable.
  • I've added tests if applicable.
  • @mentions of the person or team responsible for reviewing proposed changes.

@github-actions
Copy link
Contributor

Documentation preview

https://nvidia.github.io/NeMo-Guardrails/review/pr-1337

@tgasser-nv tgasser-nv self-assigned this Aug 18, 2025
@codecov-commenter
Copy link

codecov-commenter commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.68%. Comparing base (3fdd65d) to head (1182843).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1337      +/-   ##
===========================================
+ Coverage    71.59%   71.68%   +0.09%     
===========================================
  Files          168      168              
  Lines        16862    16862              
===========================================
+ Hits         12072    12088      +16     
+ Misses        4790     4774      -16     
Flag Coverage Δ
python 71.68% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tgasser-nv
Copy link
Collaborator Author

Attaching a PDF printout of the notebook to make reviewing easy (cc @cparisien , @Pouyanpi , @miyoungc )
1_tracing_pdf_dump.pdf

Copy link
Collaborator

@Pouyanpi Pouyanpi left a comment

Choose a reason for hiding this comment

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

Thank you @tgasser-nv. This is a valuable addition 👍🏻

Merge plan: Let's ensure this is merged once all pending PRs for 0.16.0 are merged to develop and do a rebase on top of this so that it reflects the latest changes.

Docs build: @miyoungc can you confirm that build_notebook_docs.py is the right path for rendering this notebooks to
https://docs.nvidia.com/nemo/guardrails/latest/getting-started ?

Tutorial usage: right now users can’t follow the docs due to missing configs. Two options, happy with either here:

  • Inline the needed configs in the notebook and instruct users to create a config/ folder (like other tutorials), or
  • Use from_content to avoid file creation entirely.

Nice to haves (follow-ups, separate PR):

  • Create NemoGuard NIMs configs to examples/configs so cloned users can reference them directly.
  • Use the most recent span_format: opentelemetry. (I’ll switch the default in #1331; this PR can keep current unless trivial.) The current default format is considered legacy and we might deprecate it.
  • Show how to toggle parallel/sequential dynamically so we don’t need two folders:
config.rails.input.parallel = True
config.rails.output.parallel = False

!pip install pandas plotly langchain_nvidia_ai_endpoints aiofiles -q

If we pick one of the two config approaches above and rebase after 0.16.0 lands it'd be great.

Copy link
Collaborator

@cparisien cparisien left a comment

Choose a reason for hiding this comment

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

This is looking really good! Needs a little bit of cleanup but it's in pretty good shape already.

@Pouyanpi Pouyanpi added this to the v0.16.0 milestone Aug 20, 2025
@Pouyanpi Pouyanpi added the documentation Improvements or additions to documentation label Aug 20, 2025
@tgasser-nv tgasser-nv force-pushed the feat/tracing-quickstart-notebook branch from 5a46bb5 to 9dd80a4 Compare August 22, 2025 17:28
@tgasser-nv
Copy link
Collaborator Author

Thank you @tgasser-nv. This is a valuable addition 👍🏻

Merge plan: Let's ensure this is merged once all pending PRs for 0.16.0 are merged to develop and do a rebase on top of this so that it reflects the latest changes.

Docs build: @miyoungc can you confirm that build_notebook_docs.py is the right path for rendering this notebooks to https://docs.nvidia.com/nemo/guardrails/latest/getting-started ?

Tutorial usage: right now users can’t follow the docs due to missing configs. Two options, happy with either here:

  • Inline the needed configs in the notebook and instruct users to create a config/ folder (like other tutorials), or
  • Use from_content to avoid file creation entirely.

Nice to haves (follow-ups, separate PR):

  • Create NemoGuard NIMs configs to examples/configs so cloned users can reference them directly.
  • Use the most recent span_format: opentelemetry. (I’ll switch the default in feat: enhance tracing system with OpenTelemetry semantic conventions #1331; this PR can keep current unless trivial.) The current default format is considered legacy and we might deprecate it.
  • Show how to toggle parallel/sequential dynamically so we don’t need two folders:
config.rails.input.parallel = True
config.rails.output.parallel = False
!pip install pandas plotly langchain_nvidia_ai_endpoints aiofiles -q

If we pick one of the two config approaches above and rebase after 0.16.0 lands it'd be great.

Quick update:

  • All the PRs for v0.16 were merged today, I rebased on top of those and did a clean run of the notebook. I can see all the spurious ERROR messages are gone, and the names of rails follow the new guardrails.request format
  • I rewrote all the configs and created them as Python dicts before converting to RailsConfig objects using Pydantic's model_validate() function. The prompts are now loaded from elsewhere in the repo instead of copy-pasting them into new files. The only file in the PR is the notebook.
  • I'm picking up the most recent span format, I updated the clean_trace_dataframe() method to match.
  • Added -q to the pip install

I met with @miyoungc who's looking at the best way to link the notebook from the rest of the docs. Am holding off merging until Monday to give her time to work on this.

tgasser-nv and others added 3 commits August 22, 2025 15:22
Changes links to docs from relative to absolute

Co-authored-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Tim Gasser <200644301+tgasser-nv@users.noreply.github.com>
Copy link
Collaborator

@Pouyanpi Pouyanpi left a comment

Choose a reason for hiding this comment

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

Thank you Tim! It looks good to me. Just a very minor issue that I commented and 2 questions. Please merge it when you are ready 👍🏻

@Pouyanpi Pouyanpi changed the title Initial checkin of first tracing notebook docs: add tracing notebook Aug 26, 2025
@tgasser-nv tgasser-nv merged commit 161c8a3 into develop Aug 26, 2025
24 of 25 checks passed
@tgasser-nv tgasser-nv deleted the feat/tracing-quickstart-notebook branch August 26, 2025 17:02
tgasser-nv added a commit that referenced this pull request Aug 26, 2025
* Initial checkin of first tracing notebook

* Removed unused files

* Finish notebook

* Remove config files, these are created programmatically now

* Rewrote notebook to remove config files, cleared output cells

* Update notebook

* Clean run with latest develop branch

* Remove unsafe prompts from notebook

* Added link to Parallel Rails docs

* Run black linter over notebook

* docs: doc edits for tracing notebook (#1349)

* doc edits for tracing notebook

* more improvs

* last bits of editing

* Add Miyoung's updates

* Apply miyoung's suggested changes

Changes links to docs from relative to absolute

Co-authored-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Tim Gasser <200644301+tgasser-nv@users.noreply.github.com>

* Address Pouyan's comments

---------

Signed-off-by: Tim Gasser <200644301+tgasser-nv@users.noreply.github.com>
Co-authored-by: Miyoung Choi <miyoungc@nvidia.com>
Pouyanpi pushed a commit that referenced this pull request Oct 1, 2025
* Initial checkin of first tracing notebook

* Removed unused files

* Finish notebook

* Remove config files, these are created programmatically now

* Rewrote notebook to remove config files, cleared output cells

* Update notebook

* Clean run with latest develop branch

* Remove unsafe prompts from notebook

* Added link to Parallel Rails docs

* Run black linter over notebook

* docs: doc edits for tracing notebook (#1349)

* doc edits for tracing notebook

* more improvs

* last bits of editing

* Add Miyoung's updates

* Apply miyoung's suggested changes

Changes links to docs from relative to absolute

Co-authored-by: Miyoung Choi <miyoungc@nvidia.com>
Signed-off-by: Tim Gasser <200644301+tgasser-nv@users.noreply.github.com>

* Address Pouyan's comments

---------

Signed-off-by: Tim Gasser <200644301+tgasser-nv@users.noreply.github.com>
Co-authored-by: Miyoung Choi <miyoungc@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants