需先到 NVIDIA API Catalog 申请 API key 并导出环境变量,否则示例无法调用模型;视觉工作流需用 --recurse-submodules 递归克隆,否则子模块目录为空;默认通过 https://localhost:8090/ 访问 Playground,端口被占用时需调整
GenerativeAIExamples
NVIDIAApache-2.0活跃维护提供基于 GPU 加速和微服务架构的生成式 AI 参考工作流,涵盖 RAG、LLM 推理等场景,帮你在 Triton、TensorRT 等基础设施上快速搭建可落地的服务。
Generative AI reference workflows optimized for accelerated infrastructure and microservice architecture.
export NVIDIA_API_KEY=nvapi-...
git clone https://github.com/nvidia/GenerativeAIExamples.git
cd GenerativeAIExamples/RAG/examples/basic_rag/langchain/
docker compose up -d --buildREADME 未说明具体显存要求;示例默认调用 NVIDIA API Catalog 上的 NIM 端点,也可按文档改为本地部署
NVIDIA 官方生成式 AI 参考工作流集合,帮你快速搭建 RAG、Agent 和微调系统
提供基于 GPU 加速和微服务架构的生成式 AI 参考工作流,涵盖 RAG、LLM 推理等场景,帮你在 Triton、TensorRT 等基础设施上快速搭建可落地的服务。
核心能力
- 提供基于 LangChain 和 LlamaIndex 的端到端 RAG 示例
- 用 docker compose 一键启动基础 RAG 流水线与 Playground
- 覆盖多轮对话、多模态、结构化数据、查询分解等进阶 RAG
- 集成 NeMo 微服务做工具调用微调、评估与护栏
- 提供视觉 NIM 工作流,含 VLM 告警与 NV-CLIP 图文检索
容易踩的坑
- v0.8.0最新正式版2024-08-21 · 2024-08-21 03:11 UTC
This release completely refactors the directory structure of the repository for a more seamless and intuitive developer journey. It also adds support to deploy the latest accelerated embedding and reranking models across the cloud, data center, and workstation using NVIDIA NeMo Retriever NIM microservices.
Added
- End-to-end RAG examples enhancements
- Single-command deployment for all the examples using Docker Compose.
- All end to end RAG examples are now more encapsulated with documentation, code and deployment assets residing in dedicated example specific directory.
- Segregated examples into basic and advanced RAG with dedicated READMEs.
- Added reranker model support to multi-turn RAG example.
- Added dedicated prompt configuration file for every example.
- Removed Python dev packages from containers to enhance security.
- Updated to latest version of langchain-nvidia-ai-endpoints.
- Speech support using RAG Playground
- Added support to access RIVA speech models from NVIDIA API Catalog.
- Speech support in RAG Playground is opt-in.
- Documentation enhancements
- Added more comprehensive how-to guides for end to end RAG examples.
- Added example specific architecture diagrams in each example directory.
- Added a new industry specific top level directory
- Added notebooks showcasing new usecases
- Basic langchain based RAG pipeline using latest NVIDIA API Catalog connectors.
- Basic llamaindex based RAG pipeline using latest NVIDIA API Catalog connectors.
- NeMo Guardrails with basic langchain RAG.
- NVIDIA NIM microservices using NeMo Guardrails based RAG.
- Using NeMo Evaluator using Llama 3.1 8B Instruct.
- Agentic RAG pipeline with Nemo Retriever and NIM for LLMs.
- Added new
community(beforeexperimental) example- Create a simple web interface to interact with different selectable NIM endpoints. The provided interface of this project supports designing a system prompt to call the LLM.
Changed
- Major restructuring and reorganisation of the assets within the repository
- Top level
experimentaldirectory has been renamed ascommunity. - Top level
RetrievalAugmentedGenerationdirectory has been renamed as justRAG. - The Docker Compose files inside top level
deploydirectory has been migrated to example-specific directories underRAG/examples. The vector database and on-prem NIM microservices deployment files are underRAG/examples/local_deploy. - Top level
modelshas been renamed tofinetuning. - Top level
notebooksdirectory has been moved to underRAG/notebooksand has been organised framework wise. - Top level
toolsdirectory has been migrated toRAG/tools. - Top level
integrationsdirectory has been moved intoRAG/src. RetreivalAugmentedGeneration/commonis now residing underRAG/src/chain_server.RetreivalAugmentedGeneration/frontendis now residing underRAG/src/rag_playground/default.
- Top level
- End-to-end RAG examples enhancements
- v0.7.02024-06-18 · 2024-06-18 15:52 UTC
查看更新说明
This release switches all examples to use cloud hosted GPU accelerated LLM and embedding models from Nvidia API Catalog as default. It also deprecates support to deploy on-prem models using NeMo Inference Framework Container and adds support to deploy accelerated generative AI models across the cloud, data center, and workstation using latest Nvidia NIM-LLM.
Added
- Added model auto download and caching support for
nemo-retriever-embedding-microserviceandnemo-retriever-reranking-microservice. Updated steps to deploy the services can be found here. - Multimodal RAG Example enhancements
- Moved to the PDF Plumber library for parsing text and images.
- Added
pgvectorvector DB support. - Added support to ingest files with .pptx extension
- Improved accuracy of image parsing by using tesseract-ocr
- Added a new notebook showcasing RAG usecase using accelerated NIM based on-prem deployed models
- Added a new experimental example showcasing how to create a developer-focused RAG chatbot using RAPIDS cuDF source code and API documentation.
- Added a new experimental example demonstrating how NVIDIA Morpheus, NIMs, and RAG pipelines can be integrated to create LLM-based agent pipelines.
Changed
- All examples now use llama3 models from Nvidia API Catalog as default. Summary of updated examples and the model it uses is available here.
- Switched default embedding model of all examples to Snowflake arctic-embed-I model
- Added more verbose logs and support to configure log level for chain server using LOG_LEVEL enviroment variable.
- Bumped up version of
langchain-nvidia-ai-endpoints,sentence-transformerspackage andmilvuscontainers - Updated base containers to use ubuntu 22.04 image
nvcr.io/nvidia/base/ubuntu:22.04_20240212 - Added
llama-index-readers-fileas dependency to avoid runtime package installation within chain server.
Deprecated
- Deprecated support of on-prem LLM model deployment using NeMo Inference Framework Container. Developers can use Nvidia NIM-LLM to deploy TensorRT optimized models on-prem and plug them in with existing examples.
- Deprecated kubernetes operator support.
nvolveqa_40kembedding model was deprecated from Nvidia API Catalog. Updated all notebooks and experimental artifacts to use Nvidia embed-qa-4 model instead.- Removed notebooks numbered 00-04, which used on-prem LLM model deployment using deprecated NeMo Inference Framework Container.
- Added model auto download and caching support for
- v0.6.02024-05-10 · 2024-05-10 17:19 UTC
查看更新说明
This release adds ability to switch between API Catalog models and on-prem models using NIM-LLM and adds documentation on how to build an RAG application from scratch. It also releases a containerized end to end RAG evaluation application integrated with RAG chain-server APIs.
Added
- Ability to switch between API Catalog models to on-prem models using NIM-LLM.
- New API endpoint
/health- Provides a health check for the chain server.
- Containerized evaluation application for RAG pipeline accuracy measurement.
- Observability support for langchain based examples.
- New Notebooks
- Added Chat with NVIDIA financial data notebook.
- Added notebook showcasing langgraph agent handling.
- A simple rag example template showcasing how to build an example from scratch.
Changed
- Renamed example
csv_ragto structured_data_rag - Model Engine name update
nv-ai-foundationandnv-api-catalogllm engine are renamed tonvidia-ai-endpointsnv-ai-foundationembedding engine is renamed tonvidia-ai-endpoints
- Embedding model update
developer_ragexample uses UAE-Large-V1 embedding model.- Using
ai-embed-qa-4for api catalog examples instead ofnvolveqa_40kas embedding model
- Ingested data now persists across multiple sessions.
- Updated langchain-nvidia-endpoints to version 0.0.11, enabling support for models like llama3.
- File extension based validation to throw error for unsupported files.
- The default output token length in the UI has been increased from 250 to 1024 for more comprehensive responses.
- Stricter chain-server API validation support to enhance API security
- Updated version of llama-index, pymilvus.
- Updated pgvector container to
pgvector/pgvector:pg16 - LLM Model Updates
- Multiturn Chatbot now uses
ai-mixtral-8x7b-instructmodel for response generation. - Structured data rag now uses
ai-llama3-70bfor response and code generation.
- Multiturn Chatbot now uses
- v0.5.02024-03-20 · 2024-03-20 18:10 UTC
查看更新说明
This release adds new dedicated RAG examples showcasing state of the art usecases, switches to the latest API catalog endpoints from NVIDIA and also refactors the API interface of chain-server. This release also improves the developer experience by adding github pages based documentation and streamlining the example deployment flow using dedicated compose files.
Added
- Github pages based documentation.
- New examples showcasing
- Support for delete and list APIs in chain-server component
- Streamlined RAG example deployment
- Dedicated new docker compose files for every examples.
- Dedicated docker compose files for launching vector DB solutions.
- New configurations to control top k and confidence score of retrieval pipeline.
- Added a notebook which covers how to train SLMs with various techniques using NeMo Framework.
- Added more experimental examples showcasing new usecases.
- New dedicated notebook showcasing a RAG pipeline using web pages.
Changed
- Switched from NVIDIA AI Foundation to NVIDIA API Catalog endpoints for accessing cloud hosted LLM models.
- Refactored API schema of chain-server component to support runtime allocation of llm parameters like temperature, max tokens, chat history etc.
- Renamed
llm-playgroundservice in compose files torag-playground. - Switched base containers for all components to ubuntu instead of pytorch and optimized container build time as well as container size.
- Deprecated yaml based configuration to avoid confusion, all configurations are now environment variable based.
- Removed requirement of hardcoding
NVIDIA_API_KEYincompose.envfile. - Upgraded all python dependencies for chain-server and rag-playground services.
Fixed
- Fixed a bug causing hallucinated answer when retriever fails to return any documents.
- Fixed some accuracy issues for all the examples.
- v0.4.02024-02-22 · 2024-02-22 20:51 UTC
查看更新说明
This release adds new dedicated notebooks showcasing usage of cloud based NVIDIA AI Foundation models, upgraded milvus container version to enable GPU accelerated vector search and added support for FAISS vector database. Detailed changes are listed below:
Added
- New dedicated notebooks showcasing usage of cloud based Nvidia AI Foundation based models using Langchain connectors as well as local model deployment using Huggingface.
- Upgraded milvus container version to enable GPU accelerated vector search.
- Added support to interact with models behind NeMo Inference Microservices using new model engines
nemo-embedandnemo-infer. - Added support to provide example specific collection name for vector databases using an environment variable named
COLLECTION_NAME. - Added
faissas a generic vector database solution behindutils.py.
Changed
- Upgraded and changed base containers for all components to pytorch
23.12-py3. - Added langchain specific vector database connector in
utils.py. - Changed speech support to use single channel for Riva ASR and TTS.
- Changed
get_llmutility inutils.pyto return Langchain wrapper instead of Llmaindex wrappers.
Fixed
- Fixed a bug causing empty rating in evaluation notebook
- Fixed document search implementation of query decomposition example.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。

NVIDIA Generative AI Examples
This repository is a starting point for developers looking to integrate with the NVIDIA software ecosystem to speed up their generative AI systems. Whether you are building RAG pipelines, agentic workflows, or fine-tuning models, this repository will help you integrate NVIDIA, seamlessly and natively, with your development stack.
Table of Contents
What's New?
Data Flywheel
These tutorials demonstrate Data Flywheel workflows that use NVIDIA NeMo Microservices. They include components such as NVIDIA NeMo Datastore, NeMo Entity Store, NeMo Customizer, NeMo Evaluator, NeMo Guardrails microservices, and NVIDIA NIMs.
- Tool Calling Fine-tuning, Inference, Evaluation, and Guardrailing with NVIDIA NeMo Microservices and NIMs
- Embedding Fine-tuning, Inference, and Evaluation with NVIDIA NeMo Microservices and NIMs
Safer Agentic AI
The following tutorials illustrate how to audit your large language models with NeMo Auditor to identify vulnerabilities to unsafe prompts, and how to run inference with multiple rails in parallel to reduce latency and improve throughput.
Knowledge Graph RAG
This example implements a GPU-accelerated pipeline for creating and querying knowledge graphs using RAG by leveraging NIM microservices and the RAPIDS ecosystem to process large-scale datasets efficiently.
Agentic Workflows with Llama 3.1
- Build an Agentic RAG Pipeline with Llama 3.1 and NVIDIA NeMo Retriever NIM microservices [Blog, Notebook]
- NVIDIA Morpheus, NIM microservices, and RAG pipelines integrated to create LLM-based agent pipelines
RAG with Local NIM Deployment and LangChain
- Tips for Building a RAG Pipeline with NVIDIA AI LangChain AI Endpoints by Amit Bleiweiss. [Blog, Notebook]
For more information, refer to the Generative AI Example releases.
Vision NIM Workflows
A collection of Jupyter notebooks, sample code and reference applications built with Vision NIMs.
To pull the vision NIM workflows, clone this repository recursively:
git clone https://github.com/nvidia/GenerativeAIExamples --recurse-submodules
The workflows will then be located at GenerativeAIExamples/vision_workflows
Follow the links below to learn more:
- Learn how to use VLMs to automatically monitor a video stream for custom events.
- Learn how to search images with natural language using NV-CLIP.
- Learn how to combine VLMs, LLMs and CV models to build a robust text extraction pipeline.
- Learn how to use embeddings with NVDINOv2 and a Milvus VectorDB to build a few shot classification model.
Try it Now!
Experience NVIDIA RAG Pipelines with just a few steps!
-
Get your NVIDIA API key.
- Go to the NVIDIA API Catalog.
- Select any model.
- Click Get API Key.
- Run:
export NVIDIA_API_KEY=nvapi-...
-
Clone the repository.
git clone https://github.com/nvidia/GenerativeAIExamples.git -
Build and run the basic RAG pipeline.
cd GenerativeAIExamples/RAG/examples/basic_rag/langchain/ docker compose up -d --build -
Go to https://localhost:8090/ and submit queries to the sample RAG Playground.
-
Stop containers when done.
docker compose down
Data Flywheel
A Data Flywheel is a self-reinforcing cycle where user interactions generate data that improves AI models or products, leading to better outcomes that attract more users and further enhance data quality. This feedback loop relies on continuous data processing, model refinement, and guardrails to ensure accuracy and compliance while compounding value over time. Real-world applications range from personalized customer experiences to operational systems like inventory management, where improved predictions drive efficiency and growth.
Tool-Calling Notebooks
Tool calling empowers Large Language Models (LLMs) to integrate with external APIs, execute dynamic workflows, and retrieve real-time data beyond their training scope. The NVIDIA NeMo microservices platform offers a modular infrastructure for deploying AI pipelines that includes fine-tuning, evaluation, inference, and guardrail enforcement—across Kubernetes clusters in cloud or on-premises environments.
This end-to-end tutorial demonstrates how to leverage NeMo Microservices to customize Llama-3.2-1B-Instruct by using the xLAM function-calling dataset, assess its accuracy, and implement safety constraints to govern its behavior.
RAG
RAG Notebooks
NVIDIA has first-class support for popular generative AI developer frameworks like LangChain, LlamaIndex, and Haystack. These end-to-end notebooks show how to integrate NIM microservices using your preferred generative AI development framework.
Use these notebooks to learn about the LangChain and LlamaIndex connectors.
LangChain Notebooks
- RAG
- Agents
LlamaIndex Notebooks
RAG Examples
By default, these end-to-end examples use preview NIM endpoints on NVIDIA API Catalog. Alternatively, you can run any of the examples on premises.
Basic RAG Examples
Advanced RAG Examples
RAG Tools
Example tools and tutorials to enhance LLM development and productivity when using NVIDIA RAG pipelines.
RAG Projects
- NVIDIA Tokkio LLM-RAG: Use Tokkio to add avatar animation for RAG responses.
- Hybrid RAG Project on AI Workbench: Run an NVIDIA AI Workbench example project for RAG.
Documentation
Getting Started
How To's
- Changing the Inference or Embedded Model
- Customizing the Vector Database
- Customizing the Chain Server:
- Configuring LLM Parameters at Runtime
- Supporting Multi-Turn Conversations
- Speaking Queries and Listening to Responses with NVIDIA Riva
Reference
- Support Matrix
- Architecture
- Using the Sample Chat Web Application
- RAG Playground Web Application
- Software Component Configuration
Community
We're posting these examples on GitHub to support the NVIDIA LLM community and facilitate feedback. We invite contributions! Open a GitHub issue or pull request! See contributing Check out the community examples and notebooks.