feat: wire up LlamaCppClient to model router
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+6
-1
@@ -1,7 +1,7 @@
|
||||
import { Bot } from 'grammy';
|
||||
import { Lifecycle } from './lifecycle.js';
|
||||
import type { Config } from '../config/index.js';
|
||||
import { AnthropicClient, OpenAIClient, OllamaClient, ModelRouter } from '../models/index.js';
|
||||
import { AnthropicClient, OpenAIClient, OllamaClient, LlamaCppClient, ModelRouter } from '../models/index.js';
|
||||
import { NativeAgent } from '../backends/index.js';
|
||||
import { createTelegramBot } from '../frontends/telegram/index.js';
|
||||
import { SessionStore, SessionManager } from '../session/index.js';
|
||||
@@ -60,6 +60,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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export { AnthropicClient, type AnthropicClientConfig } from './anthropic.js';
|
||||
export { OpenAIClient, type OpenAIClientConfig } from './openai.js';
|
||||
export { OllamaClient, type OllamaClientConfig } from './local/index.js';
|
||||
export { LlamaCppClient, type LlamaCppClientConfig } from './local/index.js';
|
||||
export { ModelRouter, type ModelRouterConfig, type ModelTier } from './router.js';
|
||||
export type { Message, ChatRequest, ChatResponse, ModelClient } from './types.js';
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export { OllamaClient, type OllamaClientConfig } from './ollama.js';
|
||||
export { LlamaCppClient, type LlamaCppClientConfig } from './llamacpp.js';
|
||||
|
||||
Reference in New Issue
Block a user