fix: use MODEL_ROUTES directly for Anthropic proxy routing

Remove the ANTHROPIC_MODEL_MAP layer — /v1/messages now uses the
same model names as /v1/chat/completions (deepseek-v4-flash-free,
gpt-5.4-mini-no-login, deepseek/deepseek-v4-flash). This way users
send the original model name and it routes to the correct backend.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
MythEclipse
2026-06-11 00:42:21 +07:00
co-authored by Claude Fable 5
parent 2fca9febe4
commit 2fead57d0f
4 changed files with 11 additions and 44 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ import { checkBodySize } from "./middleware/body-limiter";
import { createRateLimiter } from "./middleware/rate-limiter";
import { logRelayEvent } from "./middleware/logger";
import { handleChatCompletion, listModels } from "./lib/ai-proxy";
import { handleAnthropicMessages, listAnthropicModels } from "./lib/anthropic-proxy";
import { handleAnthropicMessages } from "./lib/anthropic-proxy";
// ─── Types ───────────────────────────────────────────────────────────────────────
@@ -424,7 +424,7 @@ export default {
// Models list
if (url.pathname === "/v1/models" && req.method === "GET") {
const models = [...listModels(), ...listAnthropicModels()].map((id) => ({
const models = listModels().map((id) => ({
id,
object: "model",
created: Math.floor(Date.now() / 1000),