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