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

Method loadLocalModel

app/src/utils/ModelManager.ts:528–536  ·  view source on GitHub ↗

* Load a local model by its ID and server type. * Routes to the appropriate underlying manager based on the server sentinel.

(localModelId: string, server: string)

Source from the content-addressed store, hash-verified

526 * Routes to the appropriate underlying manager based on the server sentinel.
527 */
528 public async loadLocalModel(localModelId: string, server: string): Promise<void> {
529 if (server === ModelManager.BROWSER_LOCAL) {
530 await GemmaModelManager.getInstance().loadModel(localModelId as GemmaModelId);
531 } else if (server === ModelManager.LLAMA_CPP_LOCAL && isTauri()) {
532 await NativeLlmManager.getInstance().loadModel(localModelId);
533 } else {
534 throw new Error(`Cannot load model: unsupported server type "${server}"`);
535 }
536 }
537
538 /**
539 * Unload the currently loaded local model for a given server type.

Callers 1

handleLoadModelFunction · 0.80

Calls 3

isTauriFunction · 0.90
loadModelMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected