pub struct Model {
pub id: String,
pub name: String,
pub api: String,
pub provider: String,
pub base_url: String,
pub reasoning: bool,
pub context_window: u32,
pub max_tokens: u32,
}Expand description
Model descriptor — analogous to the Model
Fields§
§id: String§name: String§api: String§provider: String§base_url: String§reasoning: bool§context_window: u32§max_tokens: u32Implementations§
Source§impl Model
impl Model
Sourcepub fn anthropic_claude_sonnet_4_6() -> Self
pub fn anthropic_claude_sonnet_4_6() -> Self
Anthropic Claude Sonnet 4.6.
pub fn anthropic_claude_opus_4_7() -> Self
pub fn openai_gpt_4o_mini() -> Self
pub fn openai_gpt_4o() -> Self
pub fn gemini_2_0_flash() -> Self
Sourcepub fn openai_compat(
provider: impl Into<String>,
id: impl Into<String>,
base_url: impl Into<String>,
context_window: u32,
max_tokens: u32,
) -> Self
pub fn openai_compat( provider: impl Into<String>, id: impl Into<String>, base_url: impl Into<String>, context_window: u32, max_tokens: u32, ) -> Self
OpenAI-compatible passthrough: any provider whose API matches OpenAI Chat
Completions (OpenRouter, Together, Groq, Cerebras, DeepSeek, Fireworks,
xAI, etc.). Construct via openai_compat("groq", "...", "...", ...)
or by overriding base_url.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more