pub enum Provider {
OpenAI,
Meta,
Mistral,
DeepSeek,
Qwen,
Nvidia,
Google,
AllenAI,
Other,
}Expand description
LLM provider categorization
Only providers with publicly available tokenizers are supported. This ensures accurate token counting for M2M compression optimization.
Variants§
OpenAI
OpenAI models (GPT-5.x, GPT-4.x, o1-o4) - tokenizer available via tiktoken
Meta
Meta Llama models (Llama 4, 3.x)
Mistral
Mistral AI models (Large, Ministral, Devstral, Codestral)
DeepSeek
DeepSeek models (v3.2, R1)
Qwen
Qwen models (3, 2.5, coder)
Nvidia
Nvidia models (Nemotron 3 - Llama-based)
Google Gemma models (open source, NOT Gemini)
AllenAI
Allen AI OLMo models (fully open source)
Other
Other/unknown provider
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn prefix(&self) -> &'static str
pub fn prefix(&self) -> &'static str
Get the abbreviation prefix for this provider
These prefixes are used in model abbreviations:
o= OpenAI (e.g.,og4ofor gpt-4o)m= Meta (e.g.,ml3170ifor llama-3.1-70b-instruct)mi= Mistral (e.g.,mim-lfor mistral-large)d= DeepSeek (e.g.,dv3for deepseek-v3)q= Qwen (e.g.,qq2572for qwen-2.5-72b)n= Nvidia (e.g.,nn70for nemotron-70b)g= Google Gemma (e.g.,gg327for gemma-3-27b)a= Allen AI (e.g.,aolmofor olmo)
Sourcepub fn from_model_id(id: &str) -> Self
pub fn from_model_id(id: &str) -> Self
Parse provider from model ID prefix
§Examples
use m2m::models::Provider;
assert_eq!(Provider::from_model_id("openai/gpt-4o"), Provider::OpenAI);
assert_eq!(Provider::from_model_id("meta-llama/llama-3.1-70b"), Provider::Meta);
assert_eq!(Provider::from_model_id("mistralai/mistral-large"), Provider::Mistral);Trait Implementations§
Source§impl<'de> Deserialize<'de> for Provider
impl<'de> Deserialize<'de> for Provider
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Provider
impl Eq for Provider
impl StructuralPartialEq for Provider
Auto Trait Implementations§
impl Freeze for Provider
impl RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnwindSafe for Provider
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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