pub enum LLMModel {
Anthropic(AnthropicModel),
Gemini(GeminiModel),
OpenAI(OpenAIModel),
Custom {
provider: String,
model: 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§
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