diff --git a/src/tui.ts b/src/tui.ts index 94491ff..c6d9af2 100644 --- a/src/tui.ts +++ b/src/tui.ts @@ -1,6 +1,6 @@ import { loadConfig } from './config/index.js'; import { SessionStore, SessionManager } from './session/index.js'; -import { AnthropicClient, OpenAIClient, OllamaClient, ModelRouter } from './models/index.js'; +import { AnthropicClient, OpenAIClient, OllamaClient, LlamaCppClient, ModelRouter } from './models/index.js'; import { MinimalTui, startFullscreenTui } from './frontends/tui/index.js'; import type { Config } from './config/index.js'; import { resolve } from 'path'; @@ -49,6 +49,11 @@ function createModelRouter(config: Config): ModelRouter { model: models.local.model, host: models.local.endpoint, }); + } else if (models.local.provider === 'llamacpp') { + localClient = new LlamaCppClient({ + endpoint: models.local.endpoint ?? 'http://localhost:8080', + authToken: models.local.auth_token, + }); } } @@ -124,6 +129,8 @@ async function main() { modelClient: modelRouter, modelRouter, systemPrompt: SYSTEM_PROMPT, + localProviders: config.models.local_providers, + currentLocalProvider: config.models.local?.provider, onTransfer: (target) => { if (target === 'telegram') { const telegramUserId = String(config.telegram.allowed_chat_ids[0]);