pub enum LLMModel {
Anthropic(AnthropicModel),
Gemini(GeminiModel),
OpenAI(OpenAIModel),
Custom {
provider: String,
model: String,
name: Option<String>,
},
}Variants§
Anthropic(AnthropicModel)
Gemini(GeminiModel)
OpenAI(OpenAIModel)
Custom
Custom provider with explicit provider name and model.
Used for custom OpenAI-compatible providers like LiteLLM, Ollama, etc.
The provider name matches the key in the providers HashMap config.
§Examples
litellm/claude-opus→provider: "litellm",model: "claude-opus"litellm/anthropic/claude-opus→provider: "litellm",model: "anthropic/claude-opus"ollama/llama3→provider: "ollama",model: "llama3"
Implementations§
Source§impl LLMModel
impl LLMModel
Sourcepub fn provider_name(&self) -> &str
pub fn provider_name(&self) -> &str
Get the provider name for this model
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Get the display name if set (for custom models only)
Trait Implementations§
Source§impl ContextAware for LLMModel
impl ContextAware for LLMModel
Source§fn context_info(&self) -> ModelContextInfo
fn context_info(&self) -> ModelContextInfo
Returns context information for the model
Source§fn model_name(&self) -> String
fn model_name(&self) -> String
Returns the display name of the model
Source§impl From<String> for LLMModel
impl From<String> for LLMModel
Source§fn from(value: String) -> Self
fn from(value: String) -> Self
Parse a model string into an LLMModel.
§Format
provider/model- Explicit provider prefixprovider/nested/model- Provider with nested model path (e.g., for LiteLLM)model-name- Auto-detect provider from model name
§Examples
"litellm/anthropic/claude-opus"→ Custom { provider: “litellm”, model: “anthropic/claude-opus” }"anthropic/claude-opus-4-5"→ Anthropic(Claude45Opus) (built-in provider)"claude-opus-4-5"→ Anthropic(Claude45Opus) (auto-detected)"ollama/llama3"→ Custom { provider: “ollama”, model: “llama3” }
impl StructuralPartialEq for LLMModel
Auto Trait Implementations§
impl Freeze for LLMModel
impl RefUnwindSafe for LLMModel
impl Send for LLMModel
impl Sync for LLMModel
impl Unpin for LLMModel
impl UnwindSafe for LLMModel
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