mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-05 20:21:19 +02:00
move the ai gateway to its own server
This commit is contained in:
@@ -3,7 +3,6 @@ import * as gerbil from "@server/routers/gerbil";
|
||||
import * as traefik from "@server/routers/traefik";
|
||||
import * as resource from "./resource";
|
||||
import * as badger from "./badger";
|
||||
import * as aiGateway from "@server/routers/aiGateway";
|
||||
import * as auth from "@server/routers/auth";
|
||||
import * as supporterKey from "@server/routers/supporterKey";
|
||||
import * as idp from "@server/routers/idp";
|
||||
@@ -65,9 +64,3 @@ badgerRouter.post("/verify-session", badger.verifyResourceSession);
|
||||
|
||||
badgerRouter.post("/exchange-session", badger.exchangeSession);
|
||||
|
||||
// AI inference gateway - minimal chat-completions proxy for inference-mode
|
||||
// resources/siteResources
|
||||
internalRouter.post(
|
||||
"/ai-gateway/chat/completions",
|
||||
aiGateway.chatCompletions
|
||||
);
|
||||
|
||||
@@ -21,12 +21,10 @@ export async function traefikConfigProvider(
|
||||
const maintenanceHost = config.getRawConfig().server.internal_hostname;
|
||||
const pangolinUIUrl = `http://${maintenanceHost}:${maintenancePort}`;
|
||||
const aiGatewayUrl =
|
||||
`${
|
||||
config.getRawConfig().server.internal_api_override
|
||||
}/ai-gateway` ||
|
||||
config.getRawConfig().server.ai_gateway_override ||
|
||||
`http://${maintenanceHost}:${
|
||||
config.getRawConfig().server.internal_port
|
||||
}/api/v1/ai-gateway`;
|
||||
config.getRawConfig().server.ai_gateway_port
|
||||
}`;
|
||||
|
||||
const traefikConfig = await getTraefikConfig(
|
||||
currentExitNodeId,
|
||||
@@ -45,8 +43,7 @@ export async function traefikConfigProvider(
|
||||
plugin: {
|
||||
[badgerMiddlewareName]: {
|
||||
apiBaseUrl:
|
||||
config.getRawConfig().server
|
||||
.internal_api_override ||
|
||||
config.getRawConfig().server.badger_override ||
|
||||
new URL(
|
||||
"/api/v1",
|
||||
`http://${
|
||||
|
||||
Reference in New Issue
Block a user