FlowiseAI/Flowise · error · Error

Cannot use custom endpoint with model "${this.model}" that i

Error message

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}

What it means

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.

Source

Thrown at packages/components/nodes/chatmodels/ChatHuggingFace/core.ts:121

                const token = chunk.choices[0]?.delta?.content || ''
                if (token) {
                    yield new GenerationChunk({ text: token, generationInfo: chunk })
                    await runManager?.handleLLMNewToken(token)
                }
                // stream is done when finish_reason is set
                if (chunk.choices[0]?.finish_reason) {
                    yield new GenerationChunk({
                        text: '',
                        generationInfo: { finished: true }
                    })
                    break
                }
            }
        } catch (error: any) {
            console.error('[ChatHuggingFace] Error in _streamResponseChunks:', error)
            // Provide more helpful error messages
            if (error?.message?.includes('endpointUrl') || error?.message?.includes('third-party provider')) {
                throw new Error(
                    `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}`
                )
            }
            throw error
        }
    }

    /** @ignore */
    async _call(prompt: string, options: this['ParsedCallOptions']): Promise<string> {
        try {
            const client = await this._prepareHFInference()
            // Use chatCompletion for chat models (v4 supports conversational models via Inference Providers)
            const args = {
                model: this.model,
                messages: [{ role: 'user', content: prompt }],
                ...this.invocationParams(options)
            }
            const res = await this.caller.callWithOptions({ signal: options.signal }, client.chatCompletion.bind(client), args)

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Leave the Endpoint field blank when using a provider-prefixed model — InferenceClient handles routing automatically.
  2. If you must use a custom endpoint, switch to a plain model name with no ':' provider prefix.
  3. Clear nodeData.inputs.endpoint in the node config and retest.
  4. Update FlowiseComponents — older versions did not gate the endpoint override correctly for provider models.

Example fix

// before
nodeData.inputs.endpoint = 'https://my-proxy/v1/chat/completions'
nodeData.inputs.model = 'novita/meta-llama/Meta-Llama-3-70B'

// after — pick one
nodeData.inputs.endpoint = '' // let InferenceClient route
// OR
nodeData.inputs.model = 'meta-llama/Meta-Llama-3-70B' // plain name with endpoint
Defensive patterns

Strategy: validation

Validate before calling

function validateHfEndpointConfig(model, endpointUrl) {
  if (endpointUrl && model.includes(':')) {
    throw new Error(`Model '${model}' uses a provider prefix; clear the Endpoint field.`)
  }
}
validateHfEndpointConfig(this.model, this.endpointUrl)
await model.stream(prompt)

Type guard

function isProviderPrefixedModel(model: string): boolean {
  return typeof model === 'string' && model.includes(':')
}

Try / catch

try {
  for await (const c of model.stream(prompt)) yield c
} catch (e) {
  if (e.message.includes('Cannot use custom endpoint')) {
    model.endpointUrl = ''
    for await (const c of model.stream(prompt)) yield c
  } else throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/d1c5e05eac8c4ed2. Report an issue: GitHub.