Tune LLM routing and prompts

This commit is contained in:
dahyeon committed 2026-04-21 15:24:21 -07:00
1 parent 9c013f7d4f
commit 60f33b8f4b
19 files changed
+736 -803

No files matched your search

+7 -12
View File
@@ -1,8 +1,5 @@
import { loadEnvironmentFromNodeEnv } from "../common/env-loader.js";
import {
getOpenRouterApiUrl,
getOpenRouterEnabled,
} from "../config.js";
import { getOpenRouterApiUrl } from "../config.js";
loadEnvironmentFromNodeEnv();
@@ -131,7 +128,11 @@ async function bootstrap(): Promise<void> {
getRawSecret("LLAMA_SERVER_API_URL"),
process.env["LLAMA_SERVER_API_URL"],
);
const openRouterEndpoints = getOpenRouterEnabled()
const openRouterApiKey = firstNonEmpty(
getRawSecret("OPENROUTER_API_KEY"),
process.env["OPENROUTER_API_KEY"],
);
const openRouterEndpoints = openRouterApiKey
? parseEndpointList(
getRawSecret("OPENROUTER_API_URL"),
process.env["OPENROUTER_API_URL"],
@@ -154,13 +155,7 @@ async function bootstrap(): Promise<void> {
),
],
["llama", llmApiKey],
[
"openrouter",
firstNonEmpty(
getRawSecret("OPENROUTER_API_KEY"),
process.env["OPENROUTER_API_KEY"],
),
],
["openrouter", openRouterApiKey],
].filter((entry): entry is [string, string] => typeof entry[1] === "string"),
) as Partial<Record<"cliproxy" | "llama" | "openrouter", string>>;