Skip to content

Python: Adds NVIDIA NIM example#1198

Closed
thegovind wants to merge 6 commits intomicrosoft:mainfrom
thegovind:gok/feat/nvidia
Closed

Python: Adds NVIDIA NIM example#1198
thegovind wants to merge 6 commits intomicrosoft:mainfrom
thegovind:gok/feat/nvidia

Conversation

@thegovind
Copy link

Adds an example demonstrating how to use NVIDIA NIM models with the Agent Framework through Azure AI Foundry.

The example shows how to configure the OpenAI Chat Client to use NVIDIA NIM models deployed on Azure AI Foundry, including both streaming and non-streaming responses with tool calling capabilities.

Copilot AI review requested due to automatic review settings October 5, 2025 00:58
Copy link
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 adds a comprehensive example demonstrating how to use NVIDIA NIM models with the Agent Framework through Azure AI Foundry by configuring the OpenAI Chat Client to point to Azure AI Foundry endpoints.

  • Adds a complete Python example showing both streaming and non-streaming responses with tool calling capabilities
  • Includes detailed setup documentation with prerequisites and environment variable configuration
  • Provides comprehensive README documentation for the NVIDIA examples folder

Reviewed Changes

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

File Description
python/samples/getting_started/agents/nvidia/nvidia_nim_with_openai_chat_client.py Complete example implementation showing NVIDIA NIM integration with OpenAI Chat Client, including tool functions and both streaming/non-streaming usage patterns
python/samples/getting_started/agents/nvidia/README.md Documentation explaining setup prerequisites, environment variables, API compatibility, and available models for NVIDIA NIM integration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Oct 5, 2025
@ekzhu ekzhu enabled auto-merge October 13, 2025 17:00
@ekzhu ekzhu added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@thegovind
Copy link
Author

@ekzhu @markwallace-microsoft @eavanvalkenburg - Please hold off on merging this PR. I have a few updates to make (working with @azeltov) and will push the changes within the next couple of hours

@thegovind
Copy link
Author

thegovind commented Oct 13, 2025

Simplified the abstractions and example. Thanks to @azeltov. We will be adding more to this nvidia subfolder with nemotron family of open models as they become available on AI Foundry. Let's hold off on this PR until the 10/16 due to these new nemotron updates.

@thegovind thegovind marked this pull request as draft October 13, 2025 18:29
@thegovind thegovind marked this pull request as ready for review October 16, 2025 18:40
@thegovind
Copy link
Author

We are good to merge now. Tested and confirmed with @azeltov

Introduces an example demonstrating the integration of NVIDIA NIM models deployed on Azure AI Foundry with the Agent Framework, leveraging the OpenAI Chat Client.

This allows users to interact with NVIDIA NIM models using a familiar OpenAI-compatible API, enabling features like tool calling, streaming responses, and standard chat completion.

Includes setup instructions and environment variable configuration for seamless deployment and usage.
Updates the environment variable names to align with OpenAI naming conventions.

This change ensures consistency and clarity when configuring the NVIDIA NIM with OpenAI Chat Client.
Refactors the NVIDIA NIM agent example to use a custom chat client for handling the specific message format requirements of NVIDIA NIM models.

This change streamlines the example and makes it more focused on demonstrating how to use NVIDIA NIM models with the Agent Framework on Azure AI Foundry.
)


class NVIDIANIMChatClient(OpenAIChatClient):
Copy link
Contributor

Choose a reason for hiding this comment

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

Directed to @eavanvalkenburg: we have other clients based on the OpenAIChatClient, why wouldn't we want to bring this NVIDIANIMChatClient into its own package, instead of it being purely in the samples?

Copy link
Member

Choose a reason for hiding this comment

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

Good question @moonbox3 I've asked Shawn for his opinion

@eavanvalkenburg
Copy link
Member

Closing because this is stale, feel free to reopen, I wouldn't mind having a native NVidia NIM client, but it would require some work with the new structure (raw clients etc.)

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 python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants