From 588e750edefe84ac2de9db8e3615559a1d86ada1 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Tue, 25 Aug 2026 20:22:40 +0700 Subject: [PATCH] fix: switch GMW AI source from omniroute to 9router - Change AI_LLM_BASE_URL default from omniroute.imrnes.team to 9router.asepharyana.my.id - Update AI_LLM_MODEL default from 'text' to 'claude-opus-5' (bare model name compatible with 9router/OpenAI-compatible router) - Update .env.example and inline comments to reflect 9router - discord-gateway config now matches backend (which already uses 9router) --- .env.example | 6 +++--- .../discord-gateway/src/modules/ai-moderation/llmCaller.ts | 2 +- services/discord-gateway/src/shared/config/index.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 4dba8aaa..ef56922b 100644 --- a/.env.example +++ b/.env.example @@ -84,9 +84,9 @@ BACKLOG_SYNC_BATCH_SIZE=100 # Messages per backlog batch, max 100 (d # === AI Analysis === AI_ANALYSIS_ENABLED=false # Enable AI content moderation (default: false) -# AI_LLM_API_KEY= # REQUIRED if AI_ANALYSIS_ENABLED=true. LLM API key -AI_LLM_BASE_URL=http://100.121.180.82:20128/api/v1 # LLM API base URL (omniroute on imrnes; /api/v1 exposes OpenAI-compatible chat+embeddings) -AI_LLM_MODEL=text # LLM text model name (default: text) +AI_LLM_API_KEY= # REQUIRED if AI_ANALYSIS_ENABLED=true. LLM API key +AI_LLM_BASE_URL=https://9router.asepharyana.my.id/v1 # LLM API base URL (9router — OpenAI-compatible router, replaces omniroute) +AI_LLM_MODEL=claude-opus-5 # LLM text model name (default: claude-opus-5) # AI_LLM_VISION_MODEL= # Vision model for image analysis (falls back to AI_LLM_MODEL) # AI_LLM_EMBEDDING_MODEL= # Embedding model for semantic moderation cache (optional; enables near-duplicate text reuse to save LLM calls) # AI_LLM_EMBEDDING_MIN_SIMILARITY=0.97 # Min cosine similarity to reuse a cached verdict (default: 0.97) diff --git a/services/discord-gateway/src/modules/ai-moderation/llmCaller.ts b/services/discord-gateway/src/modules/ai-moderation/llmCaller.ts index a177db22..a2c7df8e 100644 --- a/services/discord-gateway/src/modules/ai-moderation/llmCaller.ts +++ b/services/discord-gateway/src/modules/ai-moderation/llmCaller.ts @@ -83,7 +83,7 @@ export async function callModerationLLM( jsonResponse: { type: "json_object" }, retries: 0, signal, - // Router (9router/omniroute) always streams SSE even when the + // Router (9router / formerly omniroute) always streams SSE even when the // request omits `stream`. In non-stream mode the OpenAI SDK waits // for the FULL body before parsing, so slow/long upstream streams // hit the 30s/60s timeout and abort mid-generation. Streaming mode diff --git a/services/discord-gateway/src/shared/config/index.ts b/services/discord-gateway/src/shared/config/index.ts index df09ee26..95b0b792 100644 --- a/services/discord-gateway/src/shared/config/index.ts +++ b/services/discord-gateway/src/shared/config/index.ts @@ -149,8 +149,8 @@ export const configSchema = z AI_LLM_BASE_URL: z .string() .url() - .default("https://omniroute.imrnes.team/v1"), - AI_LLM_MODEL: z.string().default("text"), + .default("https://9router.asepharyana.my.id/v1"), + AI_LLM_MODEL: z.string().default("claude-opus-5"), // Vision uses the SAME router/base URL as text moderation // (AI_LLM_BASE_URL) but a different model alias. The dedicated NVIDIA // multimodal endpoint was removed.