mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-01 17:10:24 +08:00
* [Feature] Server side multi-pvorider/model support * copilot suggesition implemented * feat: improve model selector UI and auto-select default server model - Replace emoji headers with Lucide icons (Monitor, User) - Fix transition-all to explicit properties per web guidelines - Use CSS padding instead of hardcoded space indentation - Add ModelSelectorSectionHeader component for section headers - Replace Star icon with "default" text label - Style Configure button with muted text color - Auto-select default server model when page loads - Support AI_MODELS_CONFIG env var for cloud deployments - Support custom apiKeyEnv/baseUrlEnv per provider config * docs: update server-side multi-model configuration documentation - Add AI_MODELS_CONFIG env var option for cloud deployments - Document apiKeyEnv and baseUrlEnv fields for custom env var names - Document default field for auto-selecting default model - Remove deprecated version field from examples - Add field reference table for clarity --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com>
15 lines
480 B
TypeScript
15 lines
480 B
TypeScript
import { NextResponse } from "next/server"
|
|
import { loadFlattenedServerModels } from "@/lib/server-model-config"
|
|
|
|
// Use dynamic rendering to read AI_MODEL/AI_PROVIDER env vars at runtime
|
|
// This ensures Docker users can set these values when starting containers
|
|
export const dynamic = "force-dynamic"
|
|
|
|
export async function GET() {
|
|
const models = await loadFlattenedServerModels()
|
|
return NextResponse.json({
|
|
models,
|
|
hasConfig: models.length > 0,
|
|
})
|
|
}
|