Skip to main content

Triton Server Support for building Model repository

coverage version licence

This package help building model repository of Triton Server with more easy .yaml file.

⚠️ TO USE THIS LIBRARY, UNDERSTAND TRITON INFERENCE SERVER FIRST. TRITON INFERENCE SERVER TUTORIAL HERE.

👋 Installation

Install trsp package in Python.

pip install trsp

⚡ Quick command

  • Build model repository with config file.
trsp-build -f /path/to/config.yaml
  • Launch Triton Server with Docker.
trsp-run

📃 Configuration file with .yaml or .yml

To start, let's create a config.yaml file.

ONNX Model.

Suppose we have an onnx model named mymodel.onnx. Here is folder structure:

config.yaml
mymodel.onnx

Define model config to config.yaml.

model_repository: name_of_repository

models:
  my_model: # Write your own model name
    engine: onnx
    max_batch_size: 0
    versions:
      - version: 1
        path: mymodel.onnx

This config will create a model repository formated as Triton Inference Server requirements. It's look-like:

build/
  name_of_repository/
    my_model/
      1/
        model.onnx
      config.pbtxt

Python Model.

To create a python model, create a python file my_logic.py to define core logic as bellow:

config.yaml
my_logic.py
import numpy

def my_initialize(args: dict):
    # The args here is a dictionary contains config provided by Triton.
    ...
    return {}

def my_logic(args, inputs: list[np.ndarray]):
    # The args here is any that you return from the above function.
    # The inputs here is a list of numpy array that contain your input data.
    ...
    return (processed_data,) # Return a tuple of processed things.

Write a configuration.

model_repository: name_of_repository

models:
  my_python_model:
    engine: python
    max_batch_size: 0
    versions:
      version: 1
      module:
        path: my_logic.py
        initialize: my_initialize
        execute: my_logic
    # You must define input and output shape and data type of the python model.
    tensor:
      input:
        - dims: [1, 2, 3, 4]
          dtype: float32
      output:
        - dims: [1, 2, 3, 4]
          dtype: float32

# List out the library that you use for your logic for trsp install it when run.
requirements:
  - numpy

Ensemble Model.

Create ensemble model in Triton Server. Define in configuration as below:

model_repository: name_of_repository

models:
  my_ensemble_model:
    engine: ensemble
    max_batch_size: 0
    steps:
      - model: my_model
        version: latest
      - model: my_python_model
        version: latest

😊 Contributors

Metadata

Release files for trsp 0.0.4

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

Source distribution (sdist)

Source distribution for trsp 0.0.4
File Size Uploaded Provenance Actions
trsp-0.0.4.tar.gz 14.5 kB Without provenance Details for trsp-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 37.1 kB

Release files / trsp-0.0.4.tar.gz

Download URL trsp-0.0.4.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
621edc89d334a28648475e75c9fe0d1078ef519f3224e62e95455e9be5ad109f
BLAKE2b-256 checksum
How to use checksums
cda07a0f76ec46086b09e166f1841b40616ecb1f8e13eb87b0e3800332e4eeb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / trsp-0.0.4-py3-none-any.whl

Download URL trsp-0.0.4-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
704844b57a3d9a5d82b6521487b1e7eec80a8665ffcf8318d5368f014d80f9a4
BLAKE2b-256 checksum
How to use checksums
6c657edea93da6aaba422a376eb85f0b487d55de4771e46ffe8ec590f63f5c1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Security for trsp 0.0.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files No provenance

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