feat: wire up localProviders config to TUI

Add LlamaCppClient to imports and handle llamacpp provider in createModelRouter.
Pass localProviders and currentLocalProvider configuration to MinimalTui to enable
the /backend command to access alternate provider configs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
William Valentin
2026-02-05 13:37:26 -08:00
parent f722cf2bf0
commit a2e1f73493
+8 -1
View File
@@ -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]);