83
/// Base model repo used for the HF tokenizer (tokenizer.json + tokenizer_config.json).
84
pub const QWEN25_3B_TOK_MODEL_ID: &str = "Qwen/Qwen2.5-3B-Instruct";
85
86
-/// Pre-quantized Qwen 3 4B Instruct (GGUF Q4_K_M) — full OpenAI-compatible tool calling (~2.7 GB).
86
+// ── Qwen 3 family (GGUF Q4_K_M) ──────────────────────────────────────────────
87
+//
88
+// The Qwen 3 line uses the `qwen3` GGUF architecture (and `qwen3moe` for the
89
+// 30B-A3B mixture-of-experts variant), both supported by mistral.rs's quantized
90
+// loader. Every Qwen 3 model is a hybrid reasoner with an extended thinking mode
91
+// (`<think>…</think>`); always load with `max_tokens ≥ 4096` so the thinking
92
+// block does not exhaust the token budget before the real reply.
93
+//
94
+// bartowski's repos embed the tokenizer and chat template inside the GGUF, so on
95
+// iOS/macOS no separate tokenizer download is needed. On Android the candle GGUF
96
+// backend cannot parse the embedded tokenizer, so each model also declares a
97
+// `TOK_MODEL_ID` pointing at the official Qwen repo for a standalone tokenizer.
98
+
99
+/// Pre-quantized Qwen 3 0.6B (GGUF Q4_K_M) — smallest Qwen 3 variant (~0.5 GB).
100
///
88
-/// Qwen 3 uses an extended thinking mode (`<think>…</think>`) that significantly improves
89
-/// reasoning and tool-use accuracy. Load with `max_tokens ≥ 4096` to avoid empty replies caused
90
-/// by the model exhausting its token budget on thinking before producing a response.
101
+/// Lightest tool-capable Qwen 3 model. Suitable for tvOS and the most
102
+/// memory-constrained mobile devices where even the 1.7B is too large.
103
+pub const BARTOWSKI_QWEN3_0_6B_GGUF: &str = "bartowski/Qwen_Qwen3-0.6B-GGUF";
104
+/// The specific GGUF filename for the bartowski Qwen 3 0.6B repo.
105
+pub const QWEN3_0_6B_GGUF_FILE: &str = "Qwen_Qwen3-0.6B-Q4_K_M.gguf";
106
+/// Base model repo used for the HF tokenizer on Android.
107
+pub const QWEN3_0_6B_TOK_MODEL_ID: &str = "Qwen/Qwen3-0.6B";
108
+
109
+/// Pre-quantized Qwen 3 1.7B (GGUF Q4_K_M) — lightweight tool-calling model (~1.3 GB).
110
+///
111
+/// Smallest Qwen 3 variant with comfortable tool calling. Suitable for mobile
112
+/// devices where the 4B model would be too large.
113
+pub const BARTOWSKI_QWEN3_1_7B_GGUF: &str = "bartowski/Qwen_Qwen3-1.7B-GGUF";
114
+/// The specific GGUF filename for the Qwen3 1.7B repo.
115
+pub const QWEN3_1_7B_GGUF_FILE: &str = "Qwen_Qwen3-1.7B-Q4_K_M.gguf";
116
+/// Base model repo used for the HF tokenizer on Android.
117
+pub const QWEN3_1_7B_TOK_MODEL_ID: &str = "Qwen/Qwen3-1.7B";
118
+
119
+/// Pre-quantized Qwen 3 4B (GGUF Q4_K_M) — full OpenAI-compatible tool calling (~2.7 GB).
120
///
121
/// Recommended model for siGit Code (coding agent with tool calling on macOS/Linux/Windows).
122
pub const BARTOWSKI_QWEN3_4B_GGUF: &str = "bartowski/Qwen_Qwen3-4B-GGUF";
123
/// The specific GGUF filename to download from the bartowski Qwen 3 4B repo.
124
pub const QWEN3_4B_GGUF_FILE: &str = "Qwen_Qwen3-4B-Q4_K_M.gguf";
125
+/// Base model repo used for the HF tokenizer on Android.
126
+pub const QWEN3_4B_TOK_MODEL_ID: &str = "Qwen/Qwen3-4B";
127
128
/// Pre-quantized Qwen 3 8B (GGUF Q4_K_M) — strong tool-calling model (~5 GB).
129
///
131
/// Full tool calling and extended thinking mode support.
132
pub const BARTOWSKI_QWEN3_8B_GGUF: &str = "bartowski/Qwen_Qwen3-8B-GGUF";
133
pub const QWEN3_8B_GGUF_FILE: &str = "Qwen_Qwen3-8B-Q4_K_M.gguf";
134
+/// Base model repo used for the HF tokenizer on Android.
135
+pub const QWEN3_8B_TOK_MODEL_ID: &str = "Qwen/Qwen3-8B";
136
137
/// Pre-quantized Qwen 3 14B (GGUF Q4_K_M) — strong reasoning and tool-calling model (~8.4 GB).
138
///
106
-/// Qwen 3 uses extended thinking mode (`<think>…</think>`) for improved reasoning.
139
/// Best all-around model for macOS with 16+ GB RAM. Full tool calling support.
140
pub const BARTOWSKI_QWEN3_14B_GGUF: &str = "bartowski/Qwen_Qwen3-14B-GGUF";
141
/// The specific GGUF filename.
142
pub const QWEN3_14B_GGUF_FILE: &str = "Qwen_Qwen3-14B-Q4_K_M.gguf";
143
+/// Base model repo used for the HF tokenizer on Android.
144
+pub const QWEN3_14B_TOK_MODEL_ID: &str = "Qwen/Qwen3-14B";
145
112
-/// Pre-quantized Qwen 3 1.7B (GGUF Q4_K_M) — lightweight tool-calling model (~1.3 GB).
146
+/// Pre-quantized Qwen 3 32B (GGUF Q4_K_M) — largest dense Qwen 3 model (~19.8 GB).
147
///
114
-/// Smallest Qwen 3 variant with tool calling support. Suitable for mobile devices
115
-/// where the 4B model would be too large.
116
-pub const BARTOWSKI_QWEN3_1_7B_GGUF: &str = "bartowski/Qwen_Qwen3-1.7B-GGUF";
117
-/// The specific GGUF filename for the Qwen3 1.7B repo.
118
-pub const QWEN3_1_7B_GGUF_FILE: &str = "Qwen_Qwen3-1.7B-Q4_K_M.gguf";
148
+/// Highest-quality dense Qwen 3 variant. Requires a high-memory desktop
149
+/// (32+ GB RAM / unified memory). Full tool calling and extended thinking.
150
+pub const BARTOWSKI_QWEN3_32B_GGUF: &str = "bartowski/Qwen_Qwen3-32B-GGUF";
151
+/// The specific GGUF filename for the bartowski Qwen 3 32B repo.
152
+pub const QWEN3_32B_GGUF_FILE: &str = "Qwen_Qwen3-32B-Q4_K_M.gguf";
153
+/// Base model repo used for the HF tokenizer on Android.
154
+pub const QWEN3_32B_TOK_MODEL_ID: &str = "Qwen/Qwen3-32B";
155
+
156
+// ── Qwen 3 "2507" updated releases ───────────────────────────────────────────
157
+//
158
+// The July/August 2025 refresh split Qwen 3 into dedicated non-thinking
159
+// (`-Instruct-2507`) and thinking-only (`-Thinking-2507`) checkpoints with
160
+// markedly improved instruction following, tool use, and long-context quality.
161
+// These are the latest open Qwen 3 weights available as on-device GGUF.
162
+
163
+/// Pre-quantized Qwen 3 4B Instruct 2507 (GGUF Q4_K_M) — latest non-thinking 4B (~2.5 GB).
164
+///
165
+/// Updated instruction-tuned checkpoint. Unlike the base 4B it does *not* emit a
166
+/// `<think>` block, so it is faster and more predictable for chat and tool use.
167
+pub const BARTOWSKI_QWEN3_4B_INSTRUCT_2507_GGUF: &str =
168
+ "bartowski/Qwen_Qwen3-4B-Instruct-2507-GGUF";
169
+/// The specific GGUF filename for the bartowski Qwen 3 4B Instruct 2507 repo.
170
+pub const QWEN3_4B_INSTRUCT_2507_GGUF_FILE: &str = "Qwen_Qwen3-4B-Instruct-2507-Q4_K_M.gguf";
171
+/// Base model repo used for the HF tokenizer on Android.
172
+pub const QWEN3_4B_INSTRUCT_2507_TOK_MODEL_ID: &str = "Qwen/Qwen3-4B-Instruct-2507";
173
+
174
+/// Pre-quantized Qwen 3 4B Thinking 2507 (GGUF Q4_K_M) — latest reasoning 4B (~2.5 GB).
175
+///
176
+/// Updated thinking-only checkpoint with stronger reasoning and tool-use accuracy.
177
+/// Always emits a `<think>` block — load with `max_tokens ≥ 4096`.
178
+pub const BARTOWSKI_QWEN3_4B_THINKING_2507_GGUF: &str =
179
+ "bartowski/Qwen_Qwen3-4B-Thinking-2507-GGUF";
180
+/// The specific GGUF filename for the bartowski Qwen 3 4B Thinking 2507 repo.
181
+pub const QWEN3_4B_THINKING_2507_GGUF_FILE: &str = "Qwen_Qwen3-4B-Thinking-2507-Q4_K_M.gguf";
182
+/// Base model repo used for the HF tokenizer on Android.
183
+pub const QWEN3_4B_THINKING_2507_TOK_MODEL_ID: &str = "Qwen/Qwen3-4B-Thinking-2507";
184
+
185
+/// Pre-quantized Qwen 3 30B-A3B Instruct 2507 (GGUF Q4_K_M) — flagship MoE (~18.6 GB).
186
+///
187
+/// Mixture-of-experts model: 30B total parameters but only ~3B active per token,
188
+/// so inference is far cheaper than a 30B dense model while quality rivals it.
189
+/// Loads via the `qwen3moe` GGUF architecture in mistral.rs. Requires a
190
+/// high-memory desktop (32+ GB RAM / unified memory).
191
+pub const BARTOWSKI_QWEN3_30B_A3B_INSTRUCT_2507_GGUF: &str =
192
+ "bartowski/Qwen_Qwen3-30B-A3B-Instruct-2507-GGUF";
193
+/// The specific GGUF filename for the bartowski Qwen 3 30B-A3B Instruct 2507 repo.
194
+pub const QWEN3_30B_A3B_INSTRUCT_2507_GGUF_FILE: &str =
195
+ "Qwen_Qwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf";
196
+/// Base model repo used for the HF tokenizer on Android.
197
+pub const QWEN3_30B_A3B_INSTRUCT_2507_TOK_MODEL_ID: &str = "Qwen/Qwen3-30B-A3B-Instruct-2507";
198
199
/// DeepSeek Coder v1 6.7B Instruct (GGUF Q4_K_M) — dedicated code generation model (~3.8 GB).
200
///
215
BARTOWSKI_QWEN25_0_5B_INSTRUCT_GGUF,
216
BARTOWSKI_QWEN25_1_5B_INSTRUCT_GGUF,
217
BARTOWSKI_QWEN25_3B_INSTRUCT_GGUF,
218
+ BARTOWSKI_QWEN3_0_6B_GGUF,
219
+ BARTOWSKI_QWEN3_1_7B_GGUF,
220
BARTOWSKI_QWEN3_4B_GGUF,
221
BARTOWSKI_QWEN3_8B_GGUF,
222
BARTOWSKI_QWEN3_14B_GGUF,
142
- BARTOWSKI_QWEN3_1_7B_GGUF,
223
+ BARTOWSKI_QWEN3_32B_GGUF,
224
+ BARTOWSKI_QWEN3_4B_INSTRUCT_2507_GGUF,
225
+ BARTOWSKI_QWEN3_4B_THINKING_2507_GGUF,
226
+ BARTOWSKI_QWEN3_30B_A3B_INSTRUCT_2507_GGUF,
227
BARTOWSKI_QWEN25_CODER_7B_INSTRUCT_GGUF,
228
THEBLOKE_DEEPSEEK_CODER_6_7B_INSTRUCT_GGUF,
229
];
281
// Exact file size from HuggingFace API siblings[].size.
282
expected_size_bytes: 1_929_903_264,
283
},
284
+ SupportedModelInfo {
285
+ id: BARTOWSKI_QWEN3_0_6B_GGUF,
286
+ name: "Qwen 3 0.6B (GGUF)",
287
+ org: "Qwen / Alibaba",
288
+ description: "Smallest Qwen 3 variant with tool calling (~0.5 GB). \
289
+ Suitable for tvOS and the most memory-constrained mobile devices.",
290
+ // Approximate Q4_K_M size; HF API unreachable at authoring time.
291
+ expected_size_bytes: 483_000_000,
292
+ },
293
+ SupportedModelInfo {
294
+ id: BARTOWSKI_QWEN3_1_7B_GGUF,
295
+ name: "Qwen 3 1.7B (GGUF)",
296
+ org: "Qwen / Alibaba",
297
+ description: "Lightweight tool-calling model for mobile (~1.3 GB). \
298
+ Smallest Qwen 3 variant with comfortable tool calling support.",
299
+ expected_size_bytes: 1_282_439_584,
300
+ },
301
SupportedModelInfo {
302
id: BARTOWSKI_QWEN3_4B_GGUF,
303
name: "Qwen 3 4B (GGUF)",
326
expected_size_bytes: 9_001_753_632,
327
},
328
SupportedModelInfo {
228
- id: BARTOWSKI_QWEN3_1_7B_GGUF,
229
- name: "Qwen 3 1.7B (GGUF)",
329
+ id: BARTOWSKI_QWEN3_32B_GGUF,
330
+ name: "Qwen 3 32B (GGUF)",
331
org: "Qwen / Alibaba",
231
- description: "Lightweight tool-calling model for mobile (~1.3 GB). \
232
- Smallest Qwen 3 variant with tool calling support.",
233
- expected_size_bytes: 1_282_439_584,
332
+ description: "Largest dense Qwen 3 model with extended thinking (~19.8 GB). \
333
+ Highest-quality dense variant; requires 32+ GB RAM.",
334
+ // Approximate Q4_K_M size; HF API unreachable at authoring time.
335
+ expected_size_bytes: 21_260_000_000,
336
+ },
337
+ SupportedModelInfo {
338
+ id: BARTOWSKI_QWEN3_4B_INSTRUCT_2507_GGUF,
339
+ name: "Qwen 3 4B Instruct 2507 (GGUF)",
340
+ org: "Qwen / Alibaba",
341
+ description: "Latest non-thinking 4B checkpoint — faster, predictable chat and \
342
+ tool use (~2.5 GB). Recommended general-purpose Qwen 3 model.",
343
+ // Approximate Q4_K_M size; HF API unreachable at authoring time.
344
+ expected_size_bytes: 2_500_000_000,
345
+ },
346
+ SupportedModelInfo {
347
+ id: BARTOWSKI_QWEN3_4B_THINKING_2507_GGUF,
348
+ name: "Qwen 3 4B Thinking 2507 (GGUF)",
349
+ org: "Qwen / Alibaba",
350
+ description: "Latest reasoning-focused 4B checkpoint with extended thinking (~2.5 GB). \
351
+ Stronger reasoning and tool-use accuracy; load with max_tokens ≥ 4096.",
352
+ // Approximate Q4_K_M size; HF API unreachable at authoring time.
353
+ expected_size_bytes: 2_500_000_000,
354
+ },
355
+ SupportedModelInfo {
356
+ id: BARTOWSKI_QWEN3_30B_A3B_INSTRUCT_2507_GGUF,
357
+ name: "Qwen 3 30B-A3B Instruct 2507 (GGUF)",
358
+ org: "Qwen / Alibaba",
359
+ description: "Flagship mixture-of-experts model: 30B total / ~3B active (~18.6 GB). \
360
+ Near-dense quality at far lower inference cost; requires 32+ GB RAM.",
361
+ // Approximate Q4_K_M size; HF API unreachable at authoring time.
362
+ expected_size_bytes: 19_971_600_000,
363
},
364
SupportedModelInfo {
365
id: BARTOWSKI_QWEN25_CODER_7B_INSTRUCT_GGUF,
393
BARTOWSKI_QWEN25_CODER_1_5B_INSTRUCT_GGUF => Some(QWEN25_CODER_1_5B_TOK_MODEL_ID),
394
BARTOWSKI_QWEN25_CODER_3B_INSTRUCT_GGUF => Some(QWEN25_CODER_3B_TOK_MODEL_ID),
395
BARTOWSKI_QWEN25_CODER_7B_INSTRUCT_GGUF => Some(QWEN25_CODER_7B_TOK_MODEL_ID),
396
+ BARTOWSKI_QWEN3_0_6B_GGUF => Some(QWEN3_0_6B_TOK_MODEL_ID),
397
+ BARTOWSKI_QWEN3_1_7B_GGUF => Some(QWEN3_1_7B_TOK_MODEL_ID),
398
+ BARTOWSKI_QWEN3_4B_GGUF => Some(QWEN3_4B_TOK_MODEL_ID),
399
+ BARTOWSKI_QWEN3_8B_GGUF => Some(QWEN3_8B_TOK_MODEL_ID),
400
+ BARTOWSKI_QWEN3_14B_GGUF => Some(QWEN3_14B_TOK_MODEL_ID),
401
+ BARTOWSKI_QWEN3_32B_GGUF => Some(QWEN3_32B_TOK_MODEL_ID),
402
+ BARTOWSKI_QWEN3_4B_INSTRUCT_2507_GGUF => Some(QWEN3_4B_INSTRUCT_2507_TOK_MODEL_ID),
403
+ BARTOWSKI_QWEN3_4B_THINKING_2507_GGUF => Some(QWEN3_4B_THINKING_2507_TOK_MODEL_ID),
404
+ BARTOWSKI_QWEN3_30B_A3B_INSTRUCT_2507_GGUF => {
405
+ Some(QWEN3_30B_A3B_INSTRUCT_2507_TOK_MODEL_ID)
406
+ }
407
THEBLOKE_DEEPSEEK_CODER_6_7B_INSTRUCT_GGUF => Some(DEEPSEEK_CODER_6_7B_TOK_MODEL_ID),
408
_ => None,
409
}
410
}
411
+
412
+#[cfg(test)]
413
+mod tests {
414
+ use super::*;
415
+
416
+ /// Every supported model must have a corresponding display-metadata entry
417
+ /// so the model-list UI can render it.
418
+ #[test]
419
+ fn every_supported_model_has_info() {
420
+ for id in SUPPORTED_MODELS {
421
+ assert!(
422
+ SUPPORTED_MODEL_INFO.iter().any(|info| info.id == *id),
423
+ "{id} is in SUPPORTED_MODELS but missing from SUPPORTED_MODEL_INFO"
424
+ );
425
+ }
426
+ }
427
+
428
+ /// Every Qwen 3 repo must resolve to an Android tokenizer ID so loading
429
+ /// works on the candle GGUF backend.
430
+ #[test]
431
+ fn qwen3_repos_have_android_tokenizer() {
432
+ let qwen3 = SUPPORTED_MODELS.iter().filter(|id| id.contains("Qwen3"));
433
+ for id in qwen3 {
434
+ assert!(
435
+ tok_model_id_for_repo(id).is_some(),
436
+ "{id} has no Android tokenizer mapping"
437
+ );
438
+ }
439
+ }
440
+}