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:
+8
-1
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user