- Home
- Resources
- Integrations
- Hugging Face Inference Model
n8n Hugging Face Inference Model nodeConfigure Hugging Face Inference Model in n8n.
Open models get a seat in your workflow the moment this sub-node is wired to a chain. The n8n Hugging Face Inference Model node carries 8 parameters, from the model name down to Top P, and no main input of its own. It feeds text generation to whichever root node holds the Model port.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n Hugging Face Inference Model node actually do?
It is a sub-node, meaning a small node that never runs on its own and only works once it is plugged into the port of a bigger node. Drop it on the canvas, attach it to the Model port of a chain, and every prompt that chain sends goes to a Hugging Face Inference endpoint instead of a hosted commercial model. The node holds the model choice and the sampling settings. The chain above it holds the prompt.
First scenario: summarizing free-text notes. A Google Sheets row arrives with a long customer comment, a chain asks for a three-line summary, and this node produces it with Maximum Number of Tokens capped so the answer stays short. The whole thing runs on a model you picked yourself rather than a default one.
Second scenario: classification before routing. Support messages land from Gmail, a chain asks the model to label each one, and Sampling Temperature sits near zero so the same message gets the same label twice in a row. The label then decides whether the workflow posts to Slack or writes back to a sheet.
Third scenario: drafting on a private endpoint. A team that fine-tuned its own model points Custom Inference Endpoint at that deployment, keeps the rest of the parameters untouched, and gets drafts that sound like their own corpus. Nothing else in the workflow changes.
When should you reach for something else? This node has no tools support, so it will not work with the AI Agent node. An agent that needs to call tools wants a chat model that supports them, which is what the OpenAI and Anthropic model nodes are for. Use Basic LLM Chain here instead, and keep this node for straight completion work.
Two limits worth knowing before you build. The node is at version 1, so the parameter panel you see is the one described here, with no hidden extras. And the provider bills its own API calls under its own terms: n8n adds nothing on top, but a long generation is still a generation you pay for somewhere.
How do you authenticate the node?
- 01
Open the Credentials menu
In n8n, a credential is a saved set of authentication details, stored once and reused by every workflow that needs it. Go to the Credentials menu and start a new Hugging Face credential there, rather than typing anything into the node itself. The same entry will serve every chain you build later, on n8n Cloud or on a self-hosted instance.
- 02
Fill in the Hugging Face credential
Follow the authentication details that n8n documents for Hugging Face and save the credential under a name you will recognize six months from now. Something like
huggingface-prodbeatscredential 1when three people share the same instance and two of them are debugging a failed run at the same time. - 03
Select the credential on the node
Back on the canvas, open the Hugging Face Inference Model node and pick the credential from the dropdown at the top of the panel. Then drag from the node to the Model port of a root node. A sub-node left unconnected sits there quietly and never executes, which is the single most common reason a chain reports that no model was found.
What do you plug this node into?
n8n splits AI work in two: a root node receives the workflow items through its main input, and sub-nodes hang off its ports, one type per port. This node is a sub-node with a single output, so the only wiring question is which root node picks it up.
Output (what it plugs into)
- Model
ai_languageModel
01Model
The Model port is where a root node asks for the language model it should talk to. Drag from this node to that port and the chain stops being an empty shell.
Key parameters
- Required: a root node with a Model port produces nothing until a model sub-node is attached to it.
- Basic LLM Chain: the plain prompt-and-answer root node, and the one the official docs point to for this model.
- Summarization Chain: takes a long input and returns a condensed version of it.
- Question and Answer Chain: answers a question against the content you feed it.
Which parameters matter in the panel?
The Hugging Face Inference Model node has 8 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.
Parameters index
Model
modelWhat you see in n8n
Notes & use cases
Names the model that generates the completion. Everything else in the panel only shapes what that model does, so this is the first field to fill and the one to change when output quality moves in the wrong direction.
Key parameters
- Model: a text field holding the model identifier; set it once for a fixed model, or drive it with an expression like
{{ $json.model }}when an earlier node decides which model to use for each item.
Custom Inference Endpoint
options.endpointUrlWhat you see in n8n
Notes & use cases
Points the node at a custom endpoint URL instead of the default inference service. Leave it empty in normal use and fill it only when the model lives somewhere you control.
Key parameters
- Custom Inference Endpoint: the custom endpoint URL, typed in full or pulled from an earlier node with
{{ $json.endpoint }}when staging and production differ.
Frequency Penalty
options.frequencyPenaltyWhat you see in n8n
Notes & use cases
Positive values penalize new tokens based on how often they already appear in the text, which lowers the model's likelihood of repeating the same line verbatim. Reach for it when generated text starts circling back on itself.
Key parameters
- Frequency Penalty: a number; raise it when a long answer keeps recycling the same phrasing, leave it alone for short factual output where repetition is not a risk.
Maximum Number of Tokens
options.maxTokensWhat you see in n8n
Notes & use cases
Caps how many tokens the completion may use. A token is a chunk of text, roughly a short word or a piece of one, and this setting is what decides whether an answer is a sentence or a page.
Key parameters
- Maximum Number of Tokens: a number bounded by the model's context length, which sits at
2048tokens for most models, with the newest ones supporting considerably more.
Presence Penalty
options.presencePenaltyWhat you see in n8n
Notes & use cases
Positive values penalize tokens based on whether they have appeared at all, which pushes the model toward new topics. Different lever from Frequency Penalty: that one fights repetition, this one fights staying on the same subject.
Key parameters
- Presence Penalty: a number; raise it when brainstorming output keeps orbiting one idea, keep it at rest when the task is to stay strictly on topic.
Sampling Temperature
options.temperatureWhat you see in n8n
Notes & use cases
Controls randomness. Lowering it results in less random completions, and as the temperature approaches zero the model becomes deterministic and repetitive. It is the parameter to touch first when a workflow needs reproducible answers.
Key parameters
- Sampling Temperature: a number; near
0for classification or extraction where the same input must give the same output, higher when the task is to write something new.
Top K
options.topKWhat you see in n8n
Notes & use cases
Controls how many token choices the model considers within the sampling operation when creating new text. Narrowing the pool keeps the output closer to the obvious continuation.
Key parameters
- Top K: a number setting the size of that candidate pool; a small value keeps generation tight, a large one lets less likely tokens back in.
Top P
options.topPWhat you see in n8n
Notes & use cases
Controls diversity through nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. The official guidance is to alter this or the temperature, but not both at once.
Key parameters
- Top P: a number; lower it to ignore the less probable options, and pick between this and Sampling Temperature rather than tuning the two together.
Need help automating Hugging Face Inference Model with n8n?
A person reads every message.
Questions people ask next
01Is the n8n Hugging Face Inference Model node free to use?
02What do you need for the node to work?
03What are the limits of this node?
04What should you connect at minimum, and which sub-node to start with?
05n8n or Make for running open models?
Get our weekly integration tips.
No spam. Unsubscribe anytime.

