Skip to main content

System Overview

TensorRT-Model-Connect turns a Hugging Face checkpoint or local model directory into a deployable .bundle bundle, then loads that bundle behind task-oriented C++ APIs.

The most important boundary is the bundle:

  • Python owns source-model diversity and artifact construction.
  • .bundle carries the contract from build time to run time.
  • C++ owns bundle loading, task dispatch, and request execution.

Read the Glossary first if terms such as checkpoint, engine, bundle, DSO, prefill, or KV cache are new to you.

System block diagram

System map from a Hugging Face checkpoint through build routing and a native or optimized bundle to the C++ runtime and typed task result
The bundle is the deployment boundary: native artifacts resolve installed model and backend DSOs, while optimized artifacts carry their exact implementation DSO.

The diagram shows two artifact shapes, not two user-selected public APIs. trtmc build and the Python build() function resolve the model family first. A family-owned native default may claim the request immediately. Otherwise, an exact model/revision/target/options profile may select an optimized adapter; no qualified profile continues to the native builder.

The two bundle paths

ConcernNative bundleOptimized-runtime bundle
Build ownerPython FamilyPlugin and family-local TensorRT buildersFamily-local implementation/profile and isolated adapter
Primary identityruntime_strategyoptimized_runtime.json implementation and profile
Runtime implementationInstalled libtrtmc_model_<owner>.soExact embedded libtrtmc_impl_*.so
TensorRT execution boundaryInstalled backend DSO implementing IBackendDelegated implementation behind its private factory
Fallback behaviorUsed when no optimized profile claims the requestDescriptor presence claims this path; load failures do not fall back to native
EvidenceNative E2E manifest and model-owned testsExact profile qualification plus adapter, bundle, and host evidence

Both shapes still depend on compatible host facilities such as the NVIDIA driver, CUDA, TensorRT, the dynamic loader, and system libraries. A bundle is a deployment artifact, not a complete operating-system or GPU-runtime image.

Design rules

Model knowledge stays model-owned

Checkpoint mapping, graph semantics, runtime state, tokenization, pre/postprocessing, and task behavior stay with the owning model family. Shared code owns stable contracts and genuinely model-independent mechanics.

Dispatch uses artifact identity

The runtime does not choose a pipeline by searching a Hugging Face model name. A native bundle dispatches through its runtime_strategy; an optimized bundle dispatches through its integrity-bound implementation/profile descriptor.

Public APIs are task-oriented

Applications load a bundle and call methods such as generate(), transcribe(), generate_image(), embed(), or solve(). Unsupported methods fail explicitly for that concrete pipeline.

TensorRT ABI details stay behind a boundary

Native pipelines use IBackend and ITrtModule; TensorRT headers and ABI-sensitive calls live behind backend DSOs. Optimized implementations own their delegated execution internally.

Buildability is not qualification

Source, unit tests, model E2E evidence, exact-profile qualification, and performance evidence prove different things. Do not infer model support or parity from the existence of a family package alone.

Where each concern is explained

QuestionCanonical page
Which source unit owns a behavior?Units and Ownership
How does a checkpoint become a bundle?Build Pipeline
What is physically stored in .bundle?Bundle Format
How does a bundle become an IPipeline and serve requests?Runtime Lifecycle
How are native targets, DSOs, and wheels assembled?Build System
Which evidence layer proves which contract?Validation Design

Source-of-truth entry points

BoundaryPrimary implementation
Build CLIpython/tensorrt_model_connect/build_cli.py
Public Python build APIpython/tensorrt_model_connect/engine_builder.py
Family discoverypython/tensorrt_model_connect/families/__init__.py
Optimized selection and packagingpython/tensorrt_model_connect/runtime_provider/
Bundle writer and readerpython/tensorrt_model_connect/bundle_writer.py, src/bundle/
Public task APIinclude/trtmc/pipeline.h
Pipeline creationsrc/runtime/registry/pipeline_factory.cpp
Native plugin loadingsrc/runtime/registry/pipeline_plugin_loader.cpp
Optimized implementation loadingsrc/runtime/providers/optimized_runtime_host.cpp