triton_distributed/
protocols.rs

1// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16use serde::{Deserialize, Serialize};
17
18pub mod annotated;
19
20#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
21pub struct Component {
22    pub name: String,
23    pub namespace: String,
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
27pub struct Endpoint {
28    pub name: String,
29    pub component: String,
30    pub namespace: String,
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
34#[serde(rename_all = "snake_case")]
35pub enum RouterType {
36    PushRoundRobin,
37    PushRandom,
38}
39
40impl Default for RouterType {
41    fn default() -> Self {
42        Self::PushRandom
43    }
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
47pub struct ModelMetaData {
48    pub name: String,
49    pub component: Component,
50    pub router_type: RouterType,
51}