{"record":{"id":"d1c5e05eac8c4ed2","repo":"FlowiseAI/Flowise","slug":"cannot-use-custom-endpoint-with-model-this-mode","errorCode":null,"errorMessage":"Cannot use custom endpoint with model \"${this.model}\" that includes a provider. Please leave the Endpoint field blank in the UI. Original error: ${error.message}","messagePattern":"Cannot use custom endpoint with model \"(.+?)\" that includes a provider\\. Please leave the Endpoint field blank in the UI\\. Original error: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/chatmodels/ChatHuggingFace/core.ts","lineNumber":121,"sourceCode":"                const token = chunk.choices[0]?.delta?.content || ''\n                if (token) {\n                    yield new GenerationChunk({ text: token, generationInfo: chunk })\n                    await runManager?.handleLLMNewToken(token)\n                }\n                // stream is done when finish_reason is set\n                if (chunk.choices[0]?.finish_reason) {\n                    yield new GenerationChunk({\n                        text: '',\n                        generationInfo: { finished: true }\n                    })\n                    break\n                }\n            }\n        } catch (error: any) {\n            console.error('[ChatHuggingFace] Error in _streamResponseChunks:', error)\n            // Provide more helpful error messages\n            if (error?.message?.includes('endpointUrl') || error?.message?.includes('third-party provider')) {\n                throw new Error(\n                    `Cannot use custom endpoint with model \"${this.model}\" that includes a provider. Please leave the Endpoint field blank in the UI. Original error: ${error.message}`\n                )\n            }\n            throw error\n        }\n    }\n\n    /** @ignore */\n    async _call(prompt: string, options: this['ParsedCallOptions']): Promise<string> {\n        try {\n            const client = await this._prepareHFInference()\n            // Use chatCompletion for chat models (v4 supports conversational models via Inference Providers)\n            const args = {\n                model: this.model,\n                messages: [{ role: 'user', content: prompt }],\n                ...this.invocationParams(options)\n            }\n            const res = await this.caller.callWithOptions({ signal: options.signal }, client.chatCompletion.bind(client), args)","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/chatmodels/ChatHuggingFace/core.ts#L103-L139","documentation":"In the streaming path (_streamResponseChunks), HuggingFace returned an error whose message contains 'endpointUrl' or 'third-party provider'. Flowise re-wraps it to tell the user that a custom Endpoint cannot be combined with a model name that already specifies a provider (e.g. 'provider/model'). This is a configuration conflict, surfaced specifically during streaming.","triggerScenarios":"nodeData.endpoint is set to a custom URL while this.model contains a provider-prefixed identifier (model.includes(':') is true downstream), so HuggingFace's Inference Providers routing rejects the override. The streaming chatCompletion call raises the upstream error and Flowise maps it here.","commonSituations":"User fills both the Endpoint field and a model like 'novita/meta-llama-3' or 'sambanova/...'; migrating from old endpoint-based config to the new Inference Providers flow without clearing Endpoint; copy-pasting a model id from a provider's docs into a chatflow that also has a legacy endpoint.","solutions":["Leave the Endpoint field blank when using a provider-prefixed model — InferenceClient handles routing automatically.","If you must use a custom endpoint, switch to a plain model name with no ':' provider prefix.","Clear nodeData.inputs.endpoint in the node config and retest.","Update FlowiseComponents — older versions did not gate the endpoint override correctly for provider models."],"exampleFix":"// before\nnodeData.inputs.endpoint = 'https://my-proxy/v1/chat/completions'\nnodeData.inputs.model = 'novita/meta-llama/Meta-Llama-3-70B'\n\n// after — pick one\nnodeData.inputs.endpoint = '' // let InferenceClient route\n// OR\nnodeData.inputs.model = 'meta-llama/Meta-Llama-3-70B' // plain name with endpoint","handlingStrategy":"validation","validationCode":"function validateHfEndpointConfig(model, endpointUrl) {\n  if (endpointUrl && model.includes(':')) {\n    throw new Error(`Model '${model}' uses a provider prefix; clear the Endpoint field.`)\n  }\n}\nvalidateHfEndpointConfig(this.model, this.endpointUrl)\nawait model.stream(prompt)","typeGuard":"function isProviderPrefixedModel(model: string): boolean {\n  return typeof model === 'string' && model.includes(':')\n}","tryCatchPattern":"try {\n  for await (const c of model.stream(prompt)) yield c\n} catch (e) {\n  if (e.message.includes('Cannot use custom endpoint')) {\n    model.endpointUrl = ''\n    for await (const c of model.stream(prompt)) yield c\n  } else throw e\n}","preventionTips":["Leave Endpoint blank when using provider-prefixed (Inference Providers) model ids.","Document the conflict clearly in node help text.","Add a UI-level validation that disables Endpoint when the model contains ':'.","After migrating to Inference Providers, sweep existing chatflows for stale Endpoint values."],"tags":["huggingface","inference-providers","endpoint","configuration-conflict","streaming"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}