* 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)
| 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. |
no test coverage detected