NVIDIA has released a collection of open-source C++ samples, called Do Inference Now (DIN) Deploy, to streamline the creation of local artificial intelligence applications that run with hardware-accelerated performance on NVIDIA GPUs. According to an NVIDIA technical blog, these samples provide a clear workflow for developers on Windows and Linux to take AI models from popular repositories like Hugging Face and embed them into native C++ applications. The architecture achieves this by combining the cross-platform ONNX Runtime with NVIDIA's specialized TensorRT RTX execution provider, establishing a two-stage process that separates Python-based model preparation from high-performance C++ inference deployment.

The Architectural Philosophy: Separating Model Prep from Deployment

The design of the DIN Deploy samples is intentionally divided into two distinct phases: a model export stage handled in Python and an inference deployment stage built in C++. This separation of concerns is a core principle that offers significant practical advantages for developers. It allows teams to leverage the vast and flexible Python ecosystem, including popular libraries and model hubs like Hugging Face, for the complex task of preparing and converting AI models. Once a model is prepared, it is handed off as a standardized artifact to be integrated into a high-performance, native C++ application designed for efficient execution.

This architectural choice reflects the broader philosophy of the NVIDIA TensorRT ecosystem itself. Official NVIDIA documentation explains that the TensorRT workflow is fundamentally broken into two parts: the various methods for converting a trained model into an optimized engine, and the different runtimes that can be used to deploy that engine. The DIN Deploy samples provide a concrete and accessible implementation of this concept. Furthermore, this approach helps isolate vendor-specific code. A summary of the project notes that this design keeps specialized CUDA code confined to optional accelerated paths, allowing the main C++ application to be built on more general APIs for greater portability.

DIN Deploy Workflow: Model Export vs. Inference Deployment

To understand how the DIN Deploy samples function, it is essential to view the process as two separate but connected stages. The first stage uses Python to prepare the AI model, transforming it from its original format into a portable standard. The second stage takes this standardized model and runs it within a native C++ application, leveraging NVIDIA hardware for accelerated performance. This table breaks down the responsibilities and components of each phase.

A breakdown of the two primary stages in the NVIDIA DIN Deploy workflow, detailing the purpose, components, and output of each phase.
Stage Purpose Key Components Output
Model Export (Python) To convert pre-trained model checkpoints from sources like Hugging Face into a standardized, portable format for inference. A Python exporter script and Hugging Face model checkpoints. An optimized ONNX model artifact ready for deployment.
Inference Deployment (C++) To execute the ONNX model with hardware acceleration inside a native application on Windows or Linux systems. A C++ command-line interface, ONNX Runtime, and the NVIDIA TensorRT RTX execution provider. A local, hardware-accelerated AI application performing inference.