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

Method loadLocalModel

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

556 * Routes to the appropriate underlying manager based on the server sentinel.
557 */
558 public async loadLocalModel(localModelId: string, server: string): Promise<void> {
559 if (server === ModelManager.BROWSER_LOCAL) {
560 await GemmaModelManager.getInstance().loadModel(localModelId as GemmaModelId);
561 } else if (server === ModelManager.LLAMA_CPP_LOCAL && isTauri()) {
562 await NativeLlmManager.getInstance().loadModel(localModelId);
563 } else {
564 throw new Error(`Cannot load model: unsupported server type "${server}"`);
565 }
566 }
567
568 /**
569 * 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