#triton #inference #bindings #server #back-end

triton-rs

Rust bindings to the Triton Inference Server

3 unstable releases

0.2.0 Mar 13, 2024
0.1.1 Oct 5, 2023
0.1.0 Oct 5, 2023

#439 in Machine learning

Download history 2/week @ 2024-02-19 11/week @ 2024-02-26 129/week @ 2024-03-11 7/week @ 2024-03-18 48/week @ 2024-04-01 40/week @ 2024-04-15

88 downloads per month

MIT license

1.5MB
32K SLoC

C++ 31K SLoC // 0.1% comments Python 1K SLoC // 0.3% comments Rust 296 SLoC // 0.0% comments

Rust bindings to the Triton Inference Server

Triton Rust API

See triton_rs documentation.

Implementing a backend

use triton_rs::Backend;

struct ExampleBackend;

impl Backend for ExampleBackend {
    fn model_instance_execute(
        model: triton_rs::Model,
        requests: &[triton_rs::Request],
    ) -> Result<(), triton_rs::Error> {

        for request in requests {
            // Handle inference request here
            todo!();
        }

        Ok(())
    }
}

// Register the backend with Triton
triton_rs::declare_backend!(ExampleBackend);

See example-backend for full example.

Dependencies

~0–1.8MB
~37K SLoC