Skip to main content

Tripy: A Python Programming Model For TensorRT

Quick Start | Installation | Examples | Notebooks | Contributing | Documentation

Tripy L1

Tripy is a debuggable, Pythonic frontend for TensorRT, a deep learning inference compiler.

What you can expect:

  • High performance by leveraging TensorRT's optimization capabilties.
  • An intuitive API that follows conventions of the ecosystem.
  • Debuggability with features like eager mode to interactively debug mistakes.
  • Excellent error messages that are informative and actionable.
  • Friendly documentation that is comprehensive but concise, with code examples.

Installation

Option 1: Install with pip

python3 -m pip install nvtripy -f https://nvidia.github.io/TensorRT-Incubator/packages.html

Option 2: Use the container image

docker run --pull always --gpus all -it --rm ghcr.io/nvidia/tensorrt-incubator/nvtripy:latest

Quick Start

See the Introduction To Tripy guide for details:

  • Defining a model:

    class Model(tp.Module):
        def __init__(self):
            self.conv = tp.Conv(in_channels=1, out_channels=1, kernel_dims=[3, 3])
    
        def forward(self, x):
            x = self.conv(x)
            x = tp.relu(x)
            return x
    
  • Initializing it:

    model = Model()
    model.load_state_dict(
        {
            "conv.weight": tp.ones((1, 1, 3, 3)),
            "conv.bias": tp.ones((1,)),
        }
    )
    
    dummy_input = tp.ones((1, 1, 4, 4)).eval()
    
  • Executing in eager mode:

    eager_out = model(dummy_input)
    
  • Compiling and executing:

    compiled_model = tp.compile(
        model,
        args=[tp.InputInfo(shape=(1, 1, 4, 4), dtype=tp.float32)],
    )
    
    compiled_out = compiled_model(dummy_input)
    

Building Wheels From Source

For the latest changes, build Tripy wheels from source:

  1. Install build:

    python3 -m pip install build
    
  2. Build a wheel from the tripy root directory:

    python3 -m build . -w
    
  3. Install the wheel from the tripy root directory:

    python3 -m pip install -f https://nvidia.github.io/TensorRT-Incubator/packages.html dist/nvtripy-*.whl
    
  4. [Optional] Sanity check:

    python3 -c "import nvtripy as tp; x = tp.ones((5,), dtype=tp.int32); assert x.tolist() == [1] * 5"
    

Metadata

Release files for nvtripy 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for nvtripy 0.1.7
File Interpreter ABI Platform
nvtripy-0.1.7-py3-none-any.whl Python 3 none any Details

Release files / nvtripy-0.1.7-py3-none-any.whl

Download URL nvtripy-0.1.7-py3-none-any.whl
Size 294.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a9b7e6f64c6c8b36852d282312fc71205522ab34bba5c1d9f48afdd7a077a70
BLAKE2b-256 checksum
How to use checksums
1f491a5abe6cc057cbe3f0c4a0e4b542b9cba3bbacb544fbc1642a9661965c80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.7 This release

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page