Tune LLM routing and prompts
This commit is contained in:
1 parent
9c013f7d4f
commit
60f33b8f4b
19 files changed
+736
-803
No files matched your search
@@ -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>>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user