pub enum ModelArchitecture {
Mistral,
Llama,
Phi,
Phi3,
Qwen,
Gemma,
Gemma2,
}Expand description
Model architecture types supported by RuvLLM.
RuvLLM supports multiple transformer architectures with varying characteristics optimized for different use cases.
§Supported Architectures
| Architecture | Parameter Sizes | Best For |
|---|---|---|
Llama | 1B-70B | General purpose, chat |
Mistral | 7B | Code, instruction following |
Phi | 1.5-3B | Efficient edge deployment |
Phi3 | 3B-14B | Extended context, SuRoPE |
Qwen | 0.5B-72B | Multilingual, reasoning |
Gemma | 2B-7B | Efficient, instruction-tuned |
Gemma2 | 2B-27B | Soft-capping, alternating attention |
§Example
ⓘ
use ruvllm::backends::ModelArchitecture;
let arch = ModelArchitecture::Mistral;
assert_eq!(arch.config_name(), "mistral");
let phi3 = ModelArchitecture::Phi3;
assert_eq!(phi3.config_name(), "phi3");Variants§
Mistral
Mistral architecture (7B, Codestral)
Llama
Llama architecture (1B-70B)
Phi
Phi architecture (1.5, 2)
Phi3
Phi-3 architecture (SuRoPE, SwiGLU, sliding window)
Qwen
Qwen architecture
Gemma
Gemma architecture (original)
Gemma2
Gemma-2 architecture (soft-capping, alternating local/global attention)
Implementations§
Source§impl ModelArchitecture
impl ModelArchitecture
Sourcepub fn config_name(&self) -> &'static str
pub fn config_name(&self) -> &'static str
Get architecture name for HuggingFace model config
Sourcepub fn detect_from_model_id(model_id: &str) -> Option<Self>
pub fn detect_from_model_id(model_id: &str) -> Option<Self>
Detect architecture from model ID string
Sourcepub fn uses_sliding_window(&self) -> bool
pub fn uses_sliding_window(&self) -> bool
Check if this architecture uses sliding window attention
Sourcepub fn default_sliding_window(&self) -> Option<usize>
pub fn default_sliding_window(&self) -> Option<usize>
Get default sliding window size for this architecture
Trait Implementations§
Source§impl Clone for ModelArchitecture
impl Clone for ModelArchitecture
Source§fn clone(&self) -> ModelArchitecture
fn clone(&self) -> ModelArchitecture
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelArchitecture
impl Debug for ModelArchitecture
Source§impl Default for ModelArchitecture
impl Default for ModelArchitecture
Source§impl<'de> Deserialize<'de> for ModelArchitecture
impl<'de> Deserialize<'de> for ModelArchitecture
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
Source§impl Hash for ModelArchitecture
impl Hash for ModelArchitecture
Source§impl PartialEq for ModelArchitecture
impl PartialEq for ModelArchitecture
Source§impl Serialize for ModelArchitecture
impl Serialize for ModelArchitecture
impl Copy for ModelArchitecture
impl Eq for ModelArchitecture
impl StructuralPartialEq for ModelArchitecture
Auto Trait Implementations§
impl Freeze for ModelArchitecture
impl RefUnwindSafe for ModelArchitecture
impl Send for ModelArchitecture
impl Sync for ModelArchitecture
impl Unpin for ModelArchitecture
impl UnwindSafe for ModelArchitecture
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§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