Skip to content

Add EP download progress bar to all samples#621

Merged
bmehta001 merged 4 commits intomainfrom
bhamehta/add-ep-registration-to-samples
Apr 9, 2026
Merged

Add EP download progress bar to all samples#621
bmehta001 merged 4 commits intomainfrom
bhamehta/add-ep-registration-to-samples

Conversation

@bmehta001
Copy link
Copy Markdown
Contributor

All samples now show per-EP download progress with name and percentage, matching the pattern already in native-chat-completions samples.

Changes (38 files across 4 languages):

  • C# (9 samples): Replaced bare \DownloadAndRegisterEpsAsync()\ and \RunWithSpinner\ calls with progress callback
  • JS/TS (12 samples): Replaced bare \downloadAndRegisterEps()\ with progress callback
  • Python (9 samples): Replaced bare \download_and_register_eps()\ with progress callback
  • Rust (8 samples): Replaced \download_and_register_eps(None)\ with \download_and_register_eps_with_progress\

Each callback tracks the current EP name and displays a carriage-return progress line showing EP name (left-aligned 30 chars) and download percentage.

bmehta001 and others added 2 commits April 9, 2026 03:02
Add download_and_register_eps (or language equivalent) to all sample
applications that were missing it. This ensures execution providers
are downloaded and registered before model loading, which is required
for variants like NvTensorRTRTX to appear in the catalog.

Changes across 33 files in 4 languages:
- C# (4 tutorials): await mgr.DownloadAndRegisterEpsAsync()
- Python (9 samples): manager.download_and_register_eps()
- JavaScript/TypeScript (12 samples): await manager.downloadAndRegisterEps()
- Rust (8 samples): manager.download_and_register_eps(None).await?

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All samples now show per-EP download progress with name and percentage,
matching the pattern already in native-chat-completions samples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 9, 2026 15:35
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Apr 9, 2026 5:14pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the multi-language samples to display per–execution provider (EP) download progress (EP name + percent) while running download*AndRegisterEps*, aligning sample UX across C#, JS/TS, Python, and Rust.

Changes:

  • Added per-EP progress callbacks to EP download/registration calls across all samples.
  • Standardized console progress output formatting (carriage-return line with aligned EP name + percentage).
  • Updated one JS Electron sample to serialize SDK initialization via an initPromise.

Reviewed changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
samples/rust/tutorial-voice-to-text/src/main.rs Adds per-EP download progress output before model usage.
samples/rust/tutorial-tool-calling/src/main.rs Adds per-EP download progress output before model selection.
samples/rust/tutorial-document-summarizer/src/main.rs Adds per-EP download progress output before catalog/model usage.
samples/rust/tutorial-chat-assistant/src/main.rs Adds per-EP download progress output during initialization.
samples/rust/tool-calling-foundry-local/src/main.rs Adds per-EP download progress output before model load.
samples/rust/native-chat-completions/src/main.rs Adds per-EP download progress output during manager initialization.
samples/rust/foundry-local-webserver/src/main.rs Adds per-EP download progress output before web service/model setup.
samples/rust/audio-transcription-example/src/main.rs Adds per-EP download progress output before transcription flow.
samples/python/web-server/src/app.py Adds per-EP download progress printing before model/web service usage.
samples/python/tutorial-voice-to-text/src/app.py Adds per-EP download progress printing before transcription flow.
samples/python/tutorial-tool-calling/src/app.py Adds per-EP download progress printing before model/tool flow.
samples/python/tutorial-document-summarizer/src/app.py Adds per-EP download progress printing before summarization flow.
samples/python/tutorial-chat-assistant/src/app.py Adds per-EP download progress printing before chat assistant flow.
samples/python/tool-calling/src/app.py Adds per-EP download progress printing before tool calling flow.
samples/python/native-chat-completions/src/app.py Adds per-EP download progress printing before chat completion flow.
samples/python/langchain-integration/src/app.py Adds per-EP download progress printing before LangChain integration flow.
samples/python/audio-transcription/src/app.py Adds per-EP download progress printing before transcription; adjusts nearby comment.
samples/js/web-server-example/app.js Adds per-EP download progress output prior to model download/load.
samples/js/tutorial-voice-to-text/app.js Adds per-EP download progress output prior to speech model workflow.
samples/js/tutorial-tool-calling/app.js Adds per-EP download progress output prior to tool calling workflow.
samples/js/tutorial-document-summarizer/app.js Adds per-EP download progress output prior to summarization workflow.
samples/js/tutorial-chat-assistant/app.js Adds per-EP download progress output prior to chat assistant workflow.
samples/js/tool-calling-foundry-local/src/app.js Adds per-EP download progress output prior to model setup.
samples/js/langchain-integration-example/app.js Adds per-EP download progress output prior to model setup.
samples/js/electron-chat-application/main.js Serializes SDK init via initPromise and adds per-EP progress output during init.
samples/js/copilot-sdk-foundry-local/src/tool-calling.ts Adds per-EP download progress output before model download/load.
samples/js/copilot-sdk-foundry-local/src/app.ts Adds per-EP download progress output before model download/load.
samples/js/chat-and-audio-foundry-local/src/app.js Adds per-EP download progress output before multi-model setup.
samples/js/audio-transcription-example/app.js Adds per-EP download progress output before transcription flow.
samples/cs/tutorial-voice-to-text/Program.cs Adds per-EP download progress output before catalog/model usage.
samples/cs/tutorial-tool-calling/Program.cs Adds per-EP download progress output before model setup.
samples/cs/tutorial-document-summarizer/Program.cs Adds per-EP download progress output before summarization flow.
samples/cs/tutorial-chat-assistant/Program.cs Adds per-EP download progress output before chat assistant flow.
samples/cs/tool-calling-foundry-local-web-server/Program.cs Replaces spinner EP registration with per-EP progress output.
samples/cs/tool-calling-foundry-local-sdk/Program.cs Replaces spinner EP registration with per-EP progress output.
samples/cs/model-management-example/Program.cs Replaces spinner EP registration with per-EP progress output.
samples/cs/foundry-local-web-server/Program.cs Replaces spinner EP registration with per-EP progress output.
samples/cs/audio-transcription-example/Program.cs Replaces spinner EP registration with per-EP progress output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bmehta001 bmehta001 self-assigned this Apr 9, 2026
Rust: closure passed to download_and_register_eps_with_progress requires
Send + 'static. Move current_ep inside a block expression with move
closure so it owns the state.

Python: fix 'whisper modelfor' -> 'whisper model for' typo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
baijumeswani
baijumeswani previously approved these changes Apr 9, 2026
@baijumeswani baijumeswani requested a review from Copilot April 9, 2026 16:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 38 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

samples/rust/tutorial-voice-to-text/src/main.rs:1

  • Calling .ok() on the flush() result silently discards any I/O error in a way that can look accidental. If the intent is to ignore flush failures in a sample, using an explicit discard (e.g., assigning to _) makes that intent clearer; alternatively, log the error once to stderr if you want troubleshooting hints without failing the sample.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…vel EP callbacks

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bmehta001 bmehta001 merged commit 18c1173 into main Apr 9, 2026
47 checks passed
@bmehta001 bmehta001 deleted the bhamehta/add-ep-registration-to-samples branch April 9, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants