Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Models

In LatchLM, a model is an implementor of the marker trait AiModel. Models serve as unique identifiers for the different variants supported by AI providers.

Implementing a Model

Below is an example of how you can implement a custom model family.

#![allow(unused)]
fn main() {
use latchlm::AiModel;

// Custom AI model variants
pub enum MyModel {
    Fast,
    Advanced,
}

impl AsRef<str> for MyModel {
    fn as_ref(&self) -> &str {
        match self {
            MyModel::Fast => "mymodel-fast",
            MyModel::Advanced => "mymodel-advanced",
        }
    }
}

impl AiModel for MyModel {}
}