MCPcopy Create free account
hub / github.com/Roy3838/Observer / getLocalModels

Method getLocalModels

app/src/utils/ModelManager.ts:218–256  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

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)

Callers 1

listModelsMethod · 0.95

Calls 4

isTauriFunction · 0.90
pushMethod · 0.80
listLocalModelsMethod · 0.65
getInstanceMethod · 0.45

Tested by

no test coverage detected