* Get local models converted to the unified Model format. * On Tauri: returns both llama.cpp models AND transformers.js models. * On web: returns only transformers.js models.
()
| 216 | * On web: returns only transformers.js models. |
| 217 | */ |
| 218 | private getLocalModels(): Model[] { |
| 219 | const models: Model[] = []; |
| 220 | |
| 221 | // Skip Model Call — always available, returns empty string |
| 222 | models.push({ |
| 223 | name: 'Skip Model Call', |
| 224 | server: ModelManager.SKIP_MODEL, |
| 225 | multimodal: false, |
| 226 | status: 'loaded', |
| 227 | }); |
| 228 | |
| 229 | // Transformers.js models (available on all platforms) |
| 230 | const gemmaModels = GemmaModelManager.getInstance().listLocalModels(); |
| 231 | for (const entry of gemmaModels) { |
| 232 | models.push({ |
| 233 | name: entry.name, |
| 234 | server: ModelManager.BROWSER_LOCAL, |
| 235 | multimodal: entry.isMultimodal, |
| 236 | status: entry.status, |
| 237 | localModelId: entry.id, |
| 238 | }); |
| 239 | } |
| 240 | |
| 241 | // llama.cpp models (Tauri only) |
| 242 | if (isTauri()) { |
| 243 | const nativeModels = NativeLlmManager.getInstance().listLocalModels(); |
| 244 | for (const entry of nativeModels) { |
| 245 | models.push({ |
| 246 | name: entry.name, |
| 247 | server: ModelManager.LLAMA_CPP_LOCAL, |
| 248 | multimodal: entry.isMultimodal, |
| 249 | status: entry.status, |
| 250 | localModelId: entry.id, |
| 251 | }); |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | return models; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Fetch models from all sources (remote servers + refresh local cache) |
no test coverage detected