mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-12 20:49:53 +08:00
feat(providers): an OpenAI-compatible preset for any vLLM, LM Studio or gateway URL
Step 8 of the provider refactor plan, a new provider made of one record. 'custom' runs on @ai-sdk/openai-compatible with <think> extraction, merges system messages (open-source chat templates reject several), has no default URL (so a key alone does not count as connected, and the chat endpoint is shown under the URL field) and lists models from its /models. Server side: CUSTOM_API_KEY and CUSTOM_BASE_URL, ADMIN_CUSTOM_* in the admin panel. env.example and the three provider docs gained a section; the picker count in the e2e test is 25 and a new e2e test walks through the preset. The behavior snapshot gained the new provider's 146 rows; its two 'No AI provider configured' rows list CUSTOM_API_KEY now.
This commit is contained in:
@@ -158,6 +158,7 @@ const MATRIX_PROVIDERS: ProviderName[] = [
|
||||
"novita",
|
||||
"mimo",
|
||||
"atlascloud",
|
||||
"custom",
|
||||
]
|
||||
|
||||
/** The model id each provider runs in the matrix (the first suggested one) */
|
||||
@@ -186,6 +187,7 @@ const MATRIX_MODEL_IDS: Record<ProviderName, string> = {
|
||||
novita: "minimax/minimax-m3",
|
||||
mimo: "mimo-v2.5-pro",
|
||||
atlascloud: "qwen/qwen3.5-flash",
|
||||
custom: "test-model",
|
||||
}
|
||||
|
||||
/** Model ids whose providerOptions the snapshot records for openai and google */
|
||||
@@ -449,7 +451,7 @@ describe("provider behavior snapshot", () => {
|
||||
})
|
||||
|
||||
it("matches the recorded behavior", async () => {
|
||||
// The matrix: 24 providers, 16 shapes, 9 environments
|
||||
// The matrix: 25 providers, 16 shapes, 9 environments
|
||||
for (const provider of MATRIX_PROVIDERS) {
|
||||
await matrix(provider, MATRIX_MODEL_IDS[provider])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user