Run a Vector Engine Configuration Drift Check Before Dify, Cursor, and Node.js Share One Provider Layer
When Dify, Cursor, and a Node.js service all point to Vector Engine, the issue is often configuration drift.
One tool has the correct Base URL. Another tool has an old model name. A Node.js service has the right API Key in staging but a different value in production. Then someone sees model_not_found and starts debugging the wrong layer.
This check helps confirm that every client is using the same OpenAI-compatible API gateway contract.
Vector Engine can act as the LLM API provider layer for Dify, Cursor, and Node.js.
Registration URL: https://api.vectorengine.cn/register?aff=Igym
Shared provider contract
VECTOR_ENGINE_BASE_URL=https://api.vectorengine.cn/v1
VECTOR_ENGINE_API_KEY=replace-with-your-key
VECTOR_ENGINE_MODEL=replace-with-your-model-name
Node.js drift check
const expected = {
baseUrl: "https://api.vectorengine.cn/v1",
model: process.env.VECTOR_ENGINE_MODEL
};
const clients = [
{ name: "dify", baseUrl: "https://api.vectorengine.cn/v1", model: "same-model" },
{ name: "cursor", baseUrl: "https://api.vectorengine.cn/v1", model: "same-model" },
{ name: "nodejs", baseUrl: process.env.VECTOR_ENGINE_BASE_URL, model: process.env.VECTOR_ENGINE_MODEL }
];
function normalize(url) {
return String(url || "").replace(/\/+$/, "");
}
for (const client of clients) {
if (normalize(client.baseUrl) !== normalize(expected.baseUrl)) {
console.error(`${client.name}: Base URL drift`);
}
if (client.model !== expected.model) {
console.error(`${client.name}: model name drift`);
}
}
How this helps
If Dify fails but Node.js works, compare the Dify Base URL and model name.
If Cursor fails but Dify works, check the Cursor custom provider settings.
If Node.js fails only in production, check environment variables and API Key injection.
If all clients fail, check provider route, API Key scope, and model availability.
If only one route fails with model_not_found, check the model name and route mapping.
A shared provider layer is easier to operate when the contract is visible. Keep the Base URL, API Key ownership, model name, and owner record close to the tools that use them.
在 Dify、Cursor 和 Node.js 共用向量引擎前,先做配置漂移检查
当 Dify、Cursor 和 Node.js 服务都接到向量引擎时,问题经常不是 provider 本身,而是配置漂移。
一个工具使用正确的 Base URL,另一个工具保留旧 model name。Node.js 服务在 staging 里 API Key 正确,但 production 里是另一个值。然后有人看到 model_not_found,开始排查错误的层。
这个检查可以确认所有客户端都在使用同一份 OpenAI-compatible API gateway 契约。
这里把向量引擎作为 Dify、Cursor 和 Node.js 背后的 LLM API provider layer,也就是团队共享的向量引擎API中转站、向量引擎中转站和 API中转站。
注册地址:https://api.vectorengine.cn/register?aff=Igym
共享 provider 契约
VECTOR_ENGINE_BASE_URL=https://api.vectorengine.cn/v1
VECTOR_ENGINE_API_KEY=replace-with-your-key
VECTOR_ENGINE_MODEL=replace-with-your-model-name
Node.js 配置漂移检查
const expected = {
baseUrl: "https://api.vectorengine.cn/v1",
model: process.env.VECTOR_ENGINE_MODEL
};
const clients = [
{ name: "dify", baseUrl: "https://api.vectorengine.cn/v1", model: "same-model" },
{ name: "cursor", baseUrl: "https://api.vectorengine.cn/v1", model: "same-model" },
{ name: "nodejs", baseUrl: process.env.VECTOR_ENGINE_BASE_URL, model: process.env.VECTOR_ENGINE_MODEL }
];
function normalize(url) {
return String(url || "").replace(/\/+$/, "");
}
for (const client of clients) {
if (normalize(client.baseUrl) !== normalize(expected.baseUrl)) {
console.error(`${client.name}: Base URL drift`);
}
if (client.model !== expected.model) {
console.error(`${client.name}: model name drift`);
}
}
这能解决什么问题
如果 Dify 失败但 Node.js 正常,优先对比 Dify 的 Base URL 和 model name。
如果 Cursor 失败但 Dify 正常,检查 Cursor custom provider 设置。
如果 Node.js 只在 production 失败,检查环境变量和 API Key 注入。
如果所有客户端都失败,检查 provider route、API Key scope 和模型可用性。
如果只有一个路由返回 model_not_found,检查 model name 和路由映射。
共享 provider layer 要稳定,契约必须可见。把 Base URL、API Key 归属、model name 和 owner 记录在离工具最近的地方,向量引擎作为 API中转站时会更容易运维。
Top comments (0)