pub enum LMClient {
OpenAI(CompletionModel),
Gemini(CompletionModel),
Anthropic(CompletionModel),
Groq(CompletionModel<Client>),
OpenRouter(CompletionModel),
Ollama(CompletionModel<Client>),
Azure(CompletionModel<Client>),
XAI(CompletionModel),
Cohere(CompletionModel),
Mistral(CompletionModel),
Together(CompletionModel),
Deepseek(CompletionModel<Client>),
}Variants§
OpenAI(CompletionModel)
Gemini(CompletionModel)
Anthropic(CompletionModel)
Groq(CompletionModel<Client>)
OpenRouter(CompletionModel)
Ollama(CompletionModel<Client>)
Azure(CompletionModel<Client>)
XAI(CompletionModel)
Cohere(CompletionModel)
Mistral(CompletionModel)
Together(CompletionModel)
Deepseek(CompletionModel<Client>)
Implementations§
Source§impl LMClient
impl LMClient
Sourcepub fn from_openai_compatible(
base_url: &str,
api_key: &str,
model: &str,
) -> Result<Self>
pub fn from_openai_compatible( base_url: &str, api_key: &str, model: &str, ) -> Result<Self>
Build case 1: OpenAI-compatible API from base_url + api_key
Sourcepub fn from_local(base_url: &str, model: &str) -> Result<Self>
pub fn from_local(base_url: &str, model: &str) -> Result<Self>
Build case 2: Local OpenAI-compatible model from base_url (vLLM, etc.) Uses a dummy API key since local servers don’t require authentication
Sourcepub fn from_model_string(model_str: &str, api_key: Option<&str>) -> Result<Self>
pub fn from_model_string(model_str: &str, api_key: Option<&str>) -> Result<Self>
Build case 3: From provider via model name (provider:model format)
Sourcepub fn from_custom<T: Into<LMClient>>(client: T) -> Self
pub fn from_custom<T: Into<LMClient>>(client: T) -> Self
Convert a concrete completion model to LMClient
This function accepts concrete types that can be converted to LMClient. The enum_dispatch macro automatically generates From implementations for each variant type, so you can use this with any concrete completion model.
Trait Implementations§
Source§impl CompletionProvider for LMClient
impl CompletionProvider for LMClient
async fn completion( &self, __enum_dispatch_arg_0: CompletionRequest, ) -> Result<CompletionResponse<()>, CompletionError>
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§fn from(v: CompletionModel) -> LMClient
fn from(v: CompletionModel) -> LMClient
Converts to this type from the input type.
Source§impl From<CompletionModel> for LMClient
impl From<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Source§impl TryInto<CompletionModel> for LMClient
impl TryInto<CompletionModel> for LMClient
Auto Trait Implementations§
impl Freeze for LMClient
impl !RefUnwindSafe for LMClient
impl Send for LMClient
impl Sync for LMClient
impl Unpin for LMClient
impl !UnwindSafe for LMClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more