llmrouter: Namen 42i/marvin-2609:*, Durchreiche unbekannter Namen an LiteLLM

Caddy zeigt llm.lan künftig auf den Router; alles Unbekannte (2608, role/*)
geht unverändert mit dem Client-Key an LiteLLM :4000. Umstellung je Agent =
Modellname, kein base_url-Wechsel (Andreas 2026-09-05). altnamen entfällt,
bis LiteLLM abgeschaltet wird.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-05 08:09:46 +02:00
co-authored by Claude Fable 5.1
parent 4b11a869e6
commit 81ab596897
5 changed files with 80 additions and 70 deletions
+6 -3
View File
@@ -10,7 +10,7 @@
import { readFileSync } from "fs";
import { dirname, resolve } from "path";
export type Upstream = { base: string; keyEnv?: string; maxParallel?: number };
export type Upstream = { base: string; keyEnv?: string; maxParallel?: number; /** Client-Token unveraendert weitergeben (Durchreiche an LiteLLM) */ clientKey?: boolean };
export type Alias =
| { art: "alternative"; referenz: string }
| { art: "schwelle"; index: number; minContext: number }
@@ -23,7 +23,9 @@ export type Config = {
lasttest: boolean;
upstreams: Record<string, Upstream>;
aliases: Record<string, Alias>;
altnamen: Record<string, string>;
altnamen?: Record<string, string>;
/** Unbekannte Modellnamen unveraendert an diesen Upstream (Parallelbetrieb mit LiteLLM). */
fallback?: { upstream: string };
};
export const BASE = resolve(dirname(import.meta.path), "..");
@@ -34,7 +36,8 @@ export function configLaden(): Config {
for (const [name, a] of Object.entries(c.aliases)) {
if (a.art === "fest" && c.upstreams[a.upstream] === undefined) throw new Error(`Alias ${name}: Upstream ${a.upstream} fehlt`);
}
for (const [alt, ziel] of Object.entries(c.altnamen)) {
if (c.fallback !== undefined && c.upstreams[c.fallback.upstream] === undefined) throw new Error(`fallback: Upstream ${c.fallback.upstream} fehlt`);
for (const [alt, ziel] of Object.entries(c.altnamen ?? {})) {
if (c.aliases[ziel] === undefined) throw new Error(`Altname ${alt} zeigt auf unbekannten Alias ${ziel}`);
}
c.logDir = resolve(dirname(CONFIG_PATH), c.logDir);