Struct LlmOptimization Kind

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

1pub struct LlmOptimizationKind(/* private fields */);

Open, forward-compatible optimization classification.

This is intentionally a string-backed newtype rather than a closed enum: third-party optimization kinds must deserialize and round-trip losslessly before Relay knows about them. Standard constants and constructors provide enum-like ergonomics without making new producers wait for a core release.

Implementations

impl LlmOptimizationKind

impl LlmOptimizationKind

INPUT_COMPRESSION

pub const INPUT_COMPRESSION: &'static str = "input_compression"

A request transformation that reduces input tokens.

MODEL_ROUTING

pub const MODEL_ROUTING: &'static str = "model_routing"

A routing decision that changes the model serving a request.

new

pub fn new(value: impl Into<String>) -> LlmOptimizationKind

Preserve an arbitrary producer-defined kind on the wire.

as_str

pub fn as_str(&self) -> &str

Return the exact wire value.

input_compression

pub fn input_compression() -> LlmOptimizationKind

Construct the standard input-compression kind.

model_routing

pub fn model_routing() -> LlmOptimizationKind

Construct the standard model-routing kind.

Trait Implementations

impl Clone for LlmOptimizationKind

impl Clone for LlmOptimizationKind

clone

fn clone(&self) -> LlmOptimizationKind

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for LlmOptimizationKind

impl Debug for LlmOptimizationKind

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

impl<'de> Deserialize<'de> for LlmOptimizationKind

impl<'de> Deserialize<'de> for LlmOptimizationKind

deserialize

fn deserialize<__D>(
    __deserializer: __D,
) -> Result<LlmOptimizationKind, <__D as Deserializer<'de>>::Error>where
    __D: Deserializer<'de>,

impl From<&str> for LlmOptimizationKind

impl From<&str> for LlmOptimizationKind

from

fn from(value: &str) -> LlmOptimizationKind

impl From<String> for LlmOptimizationKind

impl From<String> for LlmOptimizationKind

from

fn from(value: String) -> LlmOptimizationKind

impl Hash for LlmOptimizationKind

impl Hash for LlmOptimizationKind

hash

fn hash<__H>(&self, state: &mut __H)where
    __H: Hasher,

hash_slice

fn hash_slice<H>(data: &[Self], state: &mut H)where
    H: Hasher,
    Self: Sized,

impl Ord for LlmOptimizationKind

impl Ord for LlmOptimizationKind

cmp

fn cmp(&self, other: &LlmOptimizationKind) -> Ordering

max

fn max(self, other: Self) -> Selfwhere
    Self: Sized,

min

fn min(self, other: Self) -> Selfwhere
    Self: Sized,

clamp

fn clamp(self, min: Self, max: Self) -> Selfwhere
    Self: Sized,

impl PartialEq for LlmOptimizationKind

impl PartialEq for LlmOptimizationKind

eq

fn eq(&self, other: &LlmOptimizationKind) -> bool

ne

fn ne(&self, other: &Rhs) -> bool

impl PartialOrd for LlmOptimizationKind

impl PartialOrd for LlmOptimizationKind

partial_cmp

fn partial_cmp(&self, other: &LlmOptimizationKind) -> Option<Ordering>

lt

fn lt(&self, other: &Rhs) -> bool

le

fn le(&self, other: &Rhs) -> bool

gt

fn gt(&self, other: &Rhs) -> bool

ge

fn ge(&self, other: &Rhs) -> bool

impl Serialize for LlmOptimizationKind

impl Serialize for LlmOptimizationKind

serialize

fn serialize<__S>(
    &self,
    __serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
    __S: Serializer,

impl Eq for LlmOptimizationKind

impl Eq for LlmOptimizationKind

impl StructuralPartialEq for LlmOptimizationKind

impl StructuralPartialEq for LlmOptimizationKind