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

Method getLocalModels

app/src/utils/ModelManager.ts:230–270  ·  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

228 * On web: returns only transformers.js models.
229 */
230 private getLocalModels(): Model[] {
231 const models: Model[] = [];
232
233 // Skip Model Call — always available, returns empty string
234 models.push({
235 name: 'Skip Model Call',
236 server: ModelManager.SKIP_MODEL,
237 multimodal: false,
238 status: 'loaded',
239 });
240
241 // Transformers.js models (available on all platforms)
242 const gemmaModels = GemmaModelManager.getInstance().listLocalModels();
243 for (const entry of gemmaModels) {
244 models.push({
245 name: entry.name,
246 server: ModelManager.BROWSER_LOCAL,
247 multimodal: entry.isMultimodal,
248 status: entry.status,
249 localModelId: entry.id,
250 decision: entry.isDecision,
251 });
252 }
253
254 // llama.cpp models (Tauri only)
255 if (isTauri()) {
256 const nativeModels = NativeLlmManager.getInstance().listLocalModels();
257 for (const entry of nativeModels) {
258 models.push({
259 name: entry.name,
260 server: ModelManager.LLAMA_CPP_LOCAL,
261 multimodal: entry.isMultimodal,
262 status: entry.status,
263 localModelId: entry.id,
264 decision: entry.isDecision,
265 });
266 }
267 }
268
269 return models;
270 }
271
272 /**
273 * 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