{"record":{"id":"0f6c089b3e03688b","repo":"ruvnet/ruflo","slug":"only-openai-endpoint-type-is-supported-in-this-b","errorCode":null,"errorMessage":"Only 'openai' endpoint type is supported in this build","messagePattern":"Only 'openai' endpoint type is supported in this build","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/server/models.ts","lineNumber":140,"sourceCode":"\t...m,\n\tchatPromptRender: await getChatPromptRender(m),\n\tid: m.id || m.name,\n\tdisplayName: m.displayName || m.name,\n\tpreprompt: m.prepromptUrl ? await fetch(m.prepromptUrl).then((r) => r.text()) : m.preprompt,\n\tparameters: { ...m.parameters, stop_sequences: m.parameters?.stop },\n\tunlisted: m.unlisted ?? false,\n});\n\nconst addEndpoint = (m: Awaited<ReturnType<typeof processModel>>) => ({\n\t...m,\n\tgetEndpoint: async (): Promise<Endpoint> => {\n\t\tif (!m.endpoints || m.endpoints.length === 0) {\n\t\t\tthrow new Error(\"No endpoints configured. This build requires OpenAI-compatible endpoints.\");\n\t\t}\n\t\t// Only support OpenAI-compatible endpoints in this build\n\t\tconst endpoint = m.endpoints[0];\n\t\tif (endpoint.type !== \"openai\") {\n\t\t\tthrow new Error(\"Only 'openai' endpoint type is supported in this build\");\n\t\t}\n\t\treturn await endpoints.openai({ ...endpoint, model: m });\n\t},\n});\n\ntype InternalProcessedModel = Awaited<ReturnType<typeof addEndpoint>> & {\n\tisRouter: boolean;\n\thasInferenceAPI: boolean;\n};\n\nconst inferenceApiIds: string[] = [];\n\nconst getModelOverrides = (): ModelOverride[] => {\n\tconst overridesEnv = (Reflect.get(config, \"MODELS\") as string | undefined) ?? \"\";\n\n\tif (!overridesEnv.trim()) {\n\t\treturn [];\n\t}","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/ruflo/src/ruvocal/src/lib/server/models.ts#L122-L158","documentation":"Thrown by the getEndpoint closure when a model's endpoints[0].type is anything other than 'openai'. This build of chat-ui only implements the OpenAI-compatible endpoint factory (endpoints.openai); legacy endpoint types such as 'tgi', 'aws', 'anthropic', or 'azure' are not wired up and are rejected at call time.","triggerScenarios":"A MODELS override or upstream-sourced model carries endpoints: [{type:'tgi'}] (or 'aws', 'azure', 'anthropic'); the model is selected for a chat completion; getEndpoint reads endpoints[0].type, finds it is not 'openai', and throws.","commonSituations":"Reusing a MODELS config from a prior chat-ui version that supported multiple endpoint types; copy-pasting an example that includes a non-OpenAI type; tooling that auto-generates model configs from a heterogeneous provider catalog.","solutions":["Change the endpoint type to 'openai' and point baseURL at an OpenAI-compatible gateway (e.g. https://router.huggingface.co/v1).","Remove the endpoints override entirely so buildModels injects the default {type:'openai', baseURL: OPENAI_BASE_URL}.","If you require a non-OpenAI backend, use a chat-ui build that includes the corresponding endpoint factory."],"exampleFix":"// before (MODELS env)\n[{\"id\":\"my-model\",\"endpoints\":[{\"type\":\"tgi\",\"host\":\"...\"}]}]\n\n// after\n[{\"id\":\"my-model\",\"endpoints\":[{\"type\":\"openai\",\"baseURL\":\"https://router.huggingface.co/v1\"}]}]","handlingStrategy":"validation","validationCode":"function allModelsOpenAi(models: { endpoints?: { type?: string }[] }[]): boolean {\n  return models.every((m) => !m.endpoints || m.endpoints[0]?.type === \"openai\");\n}\nif (!allModelsOpenAi(parsedModels)) throw new ConfigError(\"non-openai endpoint in MODELS\");","typeGuard":"function isOpenAiModel(m: { endpoints?: { type?: string }[] }): boolean {\n  return !m.endpoints || (m.endpoints.length > 0 && m.endpoints[0]?.type === \"openai\");\n}","tryCatchPattern":"try { const ep = await model.getEndpoint(); }\ncatch (e) {\n  if (e instanceof Error && /Only 'openai' endpoint type/.test(e.message)) {\n    // rewrite to openai or remove model from registry\n    model.endpoints = [{ type: \"openai\", baseURL: openaiBaseUrl }];\n  } else throw e;\n}","preventionTips":["Do not port MODELS configs verbatim from chat-ui versions that supported tgi/aws/anthropic endpoints.","Validate MODELS at deploy time with a schema asserting endpoints[0].type === 'openai'.","Prefer omitting endpoints so buildModels injects the default OpenAI endpoint."],"tags":["models","config","endpoints","openai","legacy"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}