model catalog

This commit is contained in:
2026-02-14 21:00:30 -08:00
parent 9bfd0ec1e7
commit cd449a30fa
5 changed files with 327 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ import { requireAdmin } from "./auth.js";
import { env } from "./env.js";
import { runMultiplex } from "./llm/multiplexer.js";
import { runMultiplexStream } from "./llm/streaming.js";
import { getModelCatalogSnapshot } from "./llm/model-catalog.js";
import { exaClient } from "./search/exa.js";
type IncomingChatMessage = {
@@ -135,6 +136,11 @@ export async function registerRoutes(app: FastifyInstance) {
return { authenticated: true, mode: env.ADMIN_TOKEN ? "token" : "open" };
});
app.get("/v1/models", async (req) => {
requireAdmin(req);
return { providers: getModelCatalogSnapshot() };
});
app.get("/v1/chats", async (req) => {
requireAdmin(req);
const chats = await prisma.chat.findMany({