pub struct GgufModelConfig {
pub model_id: String,
pub files: Vec<String>,
pub tok_model_id: Option<String>,
pub display_name: String,
pub approx_memory: String,
pub chat_template: Option<String>,
}Expand description
Configuration for loading a GGUF model via mistral.rs.
This is the primary model format for on-device mobile/desktop inference because GGUF files are pre-quantized and load at their compressed size, avoiding the large memory spike of in-situ quantization.
Fields§
§model_id: StringHuggingFace model repository ID, e.g. "bartowski/Qwen2.5-1.5B-Instruct-GGUF".
files: Vec<String>GGUF filename(s) within the repository, e.g. ["Qwen2.5-1.5B-Instruct-Q4_K_M.gguf"].
tok_model_id: Option<String>Optional: explicit tokenizer model ID (required on Android where GGUF embedded tokenizers are not supported by the candle backend).
display_name: StringHuman-friendly display name, e.g. "Qwen 2.5 1.5B".
approx_memory: StringApproximate memory footprint description, e.g. "~941 MB (GGUF Q4_K_M)".
chat_template: Option<String>Optional Jinja chat template string. When set, this overrides the template embedded in the GGUF file (if any). Required for older GGUF files that don’t embed a chat template (e.g. TheBloke models).
Implementations§
Source§impl GgufModelConfig
Convenience constructors for common GGUF model configurations.
impl GgufModelConfig
Convenience constructors for common GGUF model configurations.
These mirror the constants in super::models but return a ready-to-use
GgufModelConfig.
Sourcepub fn from_supported_model_id(model_id: &str) -> Option<GgufModelConfig>
pub fn from_supported_model_id(model_id: &str) -> Option<GgufModelConfig>
Resolve a model-management ID (a Hugging Face repository from
SUPPORTED_MODELS, such as
bartowski/Qwen_Qwen3-4B-Instruct-2507-GGUF) to the same configuration
used by the inference engine. Keeping this mapping in one place prevents
download and load support from drifting apart. None for an ID Onde
doesn’t support.
Sourcepub fn qwen25_0_5b() -> GgufModelConfig
pub fn qwen25_0_5b() -> GgufModelConfig
Qwen 2.5 0.5B Instruct (GGUF Q4_K_M), ~380 MB.
Smallest option. Used on tvOS (Apple TV) where the memory limit is 2 GB.
Sourcepub fn qwen25_1_5b() -> GgufModelConfig
pub fn qwen25_1_5b() -> GgufModelConfig
Qwen 2.5 1.5B Instruct (GGUF Q4_K_M) — ~941 MB.
Lightest option, ideal for iOS and memory-constrained Android devices.
Sourcepub fn qwen25_3b() -> GgufModelConfig
pub fn qwen25_3b() -> GgufModelConfig
Qwen 2.5 3B Instruct (GGUF Q4_K_M) — ~1.93 GB.
Balanced quality/size for macOS desktops and high-RAM Android devices. Not recommended for iOS (OOM on 8 GB devices).
Sourcepub fn qwen25_coder_1_5b() -> GgufModelConfig
pub fn qwen25_coder_1_5b() -> GgufModelConfig
Qwen 2.5 Coder 1.5B Instruct (GGUF Q4_K_M) — ~941 MB.
Dedicated coding model fine-tuned on 5.5T tokens of code and math data.
Same qwen2 GGUF architecture as the general 1.5B — loads via the
existing quantized_qwen.rs path without any mistral.rs changes.
Same memory footprint as the general 1.5B but dramatically better at
code generation, explanation, and debugging.
Preferred default for iOS, Android, and any coding-focused deployment.
Sourcepub fn qwen25_coder_3b() -> GgufModelConfig
pub fn qwen25_coder_3b() -> GgufModelConfig
Qwen 2.5 Coder 3B Instruct (GGUF Q4_K_M) — ~1.93 GB.
Best on-device coding quality for macOS desktop. Fine-tuned on 5.5T
tokens of code and math. Same qwen2 architecture as the general 3B.
Not recommended for iOS due to memory constraints.
Sourcepub fn qwen25_coder_7b() -> GgufModelConfig
pub fn qwen25_coder_7b() -> GgufModelConfig
Qwen 2.5 Coder 7B Instruct (GGUF Q4_K_M) — ~4.4 GB.
Strong coding model with tool/function calling support via the Qwen2.5
chat template. Uses the qwen2 architecture. Requires 8+ GB RAM.
Sourcepub fn qwen3_0_6b() -> GgufModelConfig
pub fn qwen3_0_6b() -> GgufModelConfig
Qwen 3 0.6B (GGUF Q4_K_M) — smallest Qwen 3 variant, ~0.5 GB.
Lightest tool-capable Qwen 3 model; fits tvOS and the most
memory-constrained mobile devices. Extended thinking mode — load with
max_tokens ≥ 4096.
Sourcepub fn qwen3_1_7b() -> GgufModelConfig
pub fn qwen3_1_7b() -> GgufModelConfig
Qwen 3 1.7B (GGUF Q4_K_M) — lightweight tool-calling, ~1.3 GB.
Sourcepub fn qwen3_4b() -> GgufModelConfig
pub fn qwen3_4b() -> GgufModelConfig
Qwen 3 4B (GGUF Q4_K_M) — ~2.7 GB.
Full OpenAI-compatible tool calling with extended thinking mode.
Always load with max_tokens ≥ 4096; the <think>…</think> block can
consume 300–400 tokens before the real response begins.
Sourcepub fn qwen3_8b() -> GgufModelConfig
pub fn qwen3_8b() -> GgufModelConfig
Strong tool-calling model with extended thinking. Best balance of quality and memory for macOS with 24+ GB RAM.
Sourcepub fn qwen3_14b() -> GgufModelConfig
pub fn qwen3_14b() -> GgufModelConfig
Qwen 3 14B (GGUF Q4_K_M) — ~8.4 GB.
Strong reasoning and tool-calling model with extended thinking. Best all-around model for macOS with 16+ GB RAM.
Sourcepub fn qwen3_32b() -> GgufModelConfig
pub fn qwen3_32b() -> GgufModelConfig
Qwen 3 32B (GGUF Q4_K_M) — largest dense Qwen 3, ~19.8 GB.
Highest-quality dense Qwen 3 variant. Requires a high-memory desktop (32+ GB RAM / unified memory). Extended thinking and full tool calling.
Sourcepub fn qwen3_4b_instruct_2507() -> GgufModelConfig
pub fn qwen3_4b_instruct_2507() -> GgufModelConfig
Qwen 3 4B Instruct 2507 (GGUF Q4_K_M) — latest non-thinking 4B, ~2.5 GB.
Updated instruction-tuned checkpoint that does not emit a <think>
block, making it faster and more predictable for chat and tool use.
Recommended general-purpose Qwen 3 model.
Sourcepub fn qwen3_4b_thinking_2507() -> GgufModelConfig
pub fn qwen3_4b_thinking_2507() -> GgufModelConfig
Qwen 3 4B Thinking 2507 (GGUF Q4_K_M) — latest reasoning 4B, ~2.5 GB.
Updated thinking-only checkpoint with stronger reasoning and tool-use
accuracy. Always emits a <think> block — load with max_tokens ≥ 4096.
Sourcepub fn qwen3_30b_a3b_instruct_2507() -> GgufModelConfig
pub fn qwen3_30b_a3b_instruct_2507() -> GgufModelConfig
Qwen 3 30B-A3B Instruct 2507 (GGUF Q4_K_M) — flagship MoE, ~18.6 GB.
Mixture-of-experts model: 30B total parameters, ~3B active per token, so
inference is far cheaper than a 30B dense model while quality rivals it.
Loads via the qwen3moe GGUF architecture. Requires 32+ GB RAM.
Sourcepub fn deepseek_coder_6_7b() -> GgufModelConfig
pub fn deepseek_coder_6_7b() -> GgufModelConfig
DeepSeek Coder v1 6.7B Instruct (GGUF Q4_K_M) — ~3.8 GB.
Strong code generation model using the llama GGUF architecture.
Requires 8+ GB RAM; recommended for macOS desktops and Linux.
Sourcepub fn platform_default() -> GgufModelConfig
pub fn platform_default() -> GgufModelConfig
Return the platform-appropriate default coding model config.
- iOS / Android → Qwen 2.5 Coder 1.5B (~941 MB, fits mobile memory budgets)
- macOS / Windows / Linux → Qwen 2.5 Coder 3B (~1.93 GB, best desktop quality)
Both are dedicated coding models (trained on 5.5T code + math tokens)
and use the qwen2 GGUF architecture supported by mistral.rs.
Trait Implementations§
Source§impl Clone for GgufModelConfig
impl Clone for GgufModelConfig
Source§fn clone(&self) -> GgufModelConfig
fn clone(&self) -> GgufModelConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<UT> ConvertError<UT> for GgufModelConfig
impl<UT> ConvertError<UT> for GgufModelConfig
Source§impl Debug for GgufModelConfig
impl Debug for GgufModelConfig
Source§impl<'de> Deserialize<'de> for GgufModelConfig
impl<'de> Deserialize<'de> for GgufModelConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GgufModelConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GgufModelConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<UT> FfiConverter<UT> for GgufModelConfig
impl<UT> FfiConverter<UT> for GgufModelConfig
Source§const TYPE_ID_META: MetadataBuffer
const TYPE_ID_META: MetadataBuffer
Source§type FfiType = RustBuffer
type FfiType = RustBuffer
Source§fn lower(v: GgufModelConfig) -> RustBuffer
fn lower(v: GgufModelConfig) -> RustBuffer
Source§fn try_lift(buf: RustBuffer) -> Result<GgufModelConfig, Error>
fn try_lift(buf: RustBuffer) -> Result<GgufModelConfig, Error>
Source§impl<UT> Lift<UT> for GgufModelConfig
impl<UT> Lift<UT> for GgufModelConfig
type FfiType = <GgufModelConfig as FfiConverter<UT>>::FfiType
fn try_lift( v: <GgufModelConfig as Lift<UT>>::FfiType, ) -> Result<GgufModelConfig, Error>
fn try_read(buf: &mut &[u8]) -> Result<GgufModelConfig, Error>
Source§fn try_lift_from_rust_buffer(v: RustBuffer) -> Result<Self, Error>
fn try_lift_from_rust_buffer(v: RustBuffer) -> Result<Self, Error>
Source§impl<UT> LiftRef<UT> for GgufModelConfig
impl<UT> LiftRef<UT> for GgufModelConfig
type LiftType = GgufModelConfig
Source§impl<UT> LiftReturn<UT> for GgufModelConfig
impl<UT> LiftReturn<UT> for GgufModelConfig
Source§type ReturnType = <GgufModelConfig as Lift<UT>>::FfiType
type ReturnType = <GgufModelConfig as Lift<UT>>::FfiType
Source§fn try_lift_successful_return(
v: <GgufModelConfig as LiftReturn<UT>>::ReturnType,
) -> Result<GgufModelConfig, Error>
fn try_lift_successful_return( v: <GgufModelConfig as LiftReturn<UT>>::ReturnType, ) -> Result<GgufModelConfig, Error>
Source§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
Source§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
Source§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
Source§impl<UT> Lower<UT> for GgufModelConfig
impl<UT> Lower<UT> for GgufModelConfig
type FfiType = <GgufModelConfig as FfiConverter<UT>>::FfiType
fn lower(obj: GgufModelConfig) -> <GgufModelConfig as Lower<UT>>::FfiType
fn write(obj: GgufModelConfig, buf: &mut Vec<u8>)
Source§fn lower_into_rust_buffer(obj: Self) -> RustBuffer
fn lower_into_rust_buffer(obj: Self) -> RustBuffer
Source§impl<UT> LowerError<UT> for GgufModelConfig
impl<UT> LowerError<UT> for GgufModelConfig
Source§fn lower_error(obj: GgufModelConfig) -> RustBuffer
fn lower_error(obj: GgufModelConfig) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for GgufModelConfig
impl<UT> LowerReturn<UT> for GgufModelConfig
Source§type ReturnType = <GgufModelConfig as Lower<UT>>::FfiType
type ReturnType = <GgufModelConfig as Lower<UT>>::FfiType
Source§fn lower_return(
v: GgufModelConfig,
) -> Result<<GgufModelConfig as LowerReturn<UT>>::ReturnType, RustCallError>
fn lower_return( v: GgufModelConfig, ) -> Result<<GgufModelConfig as LowerReturn<UT>>::ReturnType, RustCallError>
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl Serialize for GgufModelConfig
impl Serialize for GgufModelConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl<UT> TypeId<UT> for GgufModelConfig
impl<UT> TypeId<UT> for GgufModelConfig
Auto Trait Implementations§
impl Freeze for GgufModelConfig
impl RefUnwindSafe for GgufModelConfig
impl Send for GgufModelConfig
impl Sync for GgufModelConfig
impl Unpin for GgufModelConfig
impl UnsafeUnpin for GgufModelConfig
impl UnwindSafe for GgufModelConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for T
impl<T> Downcast for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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> ⓘ
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> ⓘ
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.