Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hugging Face

connector.hugging_face · connector.hugging_face_trigger · ai

Run open models through Hugging Face Inference Providers, search the Hub, and react to repository events.

Vendor API documentation: https://huggingface.co/docs/inference-providers/index

Authentication

MethodCredential kindAuth kindFieldsTest request
User access tokenhugging_face/access_tokenbearertoken (secret)yes
OAuth2 (Sign in with Hugging Face)hugging_face/oauth2oauth2_auth_codeclient_id, client_secret (secret)yes

Actions

Node type connector.hugging_face. Choose a resource and an operation; each operation has its own parameters.

Chat

OperationIDEffectPaginatedCassette tests
Send chat messageschat.completewrites3

Send chat messages

Operation chat.complete. OpenAI-compatible chat completion routed to a provider that serves the model.

NameTypeDefaultRequiredShown whenDescription
modelresource_locatoryesValues from lookup chat_models.
routingoptions"default"Provider selection. One of default, fastest, cheapest, provider.
providerstringyesrouting = provider
messagesfixed_collectionyes
messages.roleoptions"user"One of system, user, assistant.
messages.contentstringyes
optionscollection
options.temperaturenumber
options.max_tokensnumber
options.top_pnumberTop P.
options.seednumber
options.stopstringStop sequences. Comma-separated.
options.frequency_penaltynumber
options.presence_penaltynumber
options.json_schemajsonJSON schema. Structured output (only providers that support it).
simplifybooleantrueSimplify output.

Embedding

OperationIDEffectPaginatedCassette tests
Create embeddingsembedding.createreads2

Create embeddings

Operation embedding.create. Feature extraction on HF Inference.

NameTypeDefaultRequiredShown whenDescription
modelresource_locator"BAAI/bge-small-en-v1.5"yesValues from lookup embedding_models.
input_modeoptions"single"Input. One of single, batch.
textstringyesinput_mode = single
textsjsonyesinput_mode = batchJSON array of strings.
normalizebooleantrue
prompt_namestringName of a prompt from the model’s sentence-transformers config, such as query.
truncatebooleantrueTruncate long inputs.

Inference

Call any model hosted on HF Inference with a task payload.

OperationIDEffectPaginatedCassette tests
Run a model (JSON input)inference.runwrites2
Run a model (file input)inference.run_binarywrites1

Run a model (JSON input)

Operation inference.run. Sends inputs and task parameters to a model and returns its raw result.

NameTypeDefaultRequiredShown whenDescription
taskoptions"text-classification"Used to filter the model list; the model decides the task. One of text-classification, token-classification, zero-shot-classification, summarization, translation, question-answering, table-question-answering, fill-mask, sentence-similarity, text-generation.
modelresource_locatoryesDepends on task. Values from lookup models.
inputsjsonyesA string, or the JSON object the task expects (for example {question, context}).
parametersjsonTask parameters, for example {candidate_labels: […]}.

Run a model (file input)

Operation inference.run_binary. Sends a binary file (audio or image) to a model, for speech recognition, image classification, object detection and similar tasks.

NameTypeDefaultRequiredShown whenDescription
taskoptions"automatic-speech-recognition"One of automatic-speech-recognition, audio-classification, image-classification, object-detection, image-segmentation, image-to-text.
modelresource_locatoryesDepends on task. Values from lookup models.
binary_propertybinary_property"data"yesInput binary field.

Image

OperationIDEffectPaginatedCassette tests
Generate an imageimage.generatewrites1

Generate an image

Operation image.generate. Text-to-image on HF Inference; the image is written to a binary field.

NameTypeDefaultRequiredShown whenDescription
modelresource_locator"black-forest-labs/FLUX.1-schnell"yesValues from lookup image_models.
promptstringyes
optionscollection
options.negative_promptstring
options.widthnumber
options.heightnumber
options.num_inference_stepsnumberSteps.
options.guidance_scalenumber
options.seednumber
output_propertystring"data"Output binary field.

Hub model

OperationIDEffectPaginatedCassette tests
Search modelsmodel.searchreadsyes1
Get a modelmodel.getreads1

Search models

Operation model.search.

NameTypeDefaultRequiredShown whenDescription
return_allbooleanfalse
limitnumber50return_all = false
searchstringName contains.
authorstringAuthor or organization.
pipeline_tagstringTask.
inference_provideroptions""Served by. One of ``, all, hf-inference.
sortoptions"trendingScore"Sort by. One of trendingScore, downloads, likes, lastModified, createdAt.

Get a model

Operation model.get.

NameTypeDefaultRequiredShown whenDescription
modelresource_locatoryesValues from lookup hub_models.
include_providersbooleanfalseInclude provider mapping.

Account

OperationIDEffectPaginatedCassette tests
Get the current accountuser.whoamireads1

Get the current account

Operation user.whoami.

This node has no parameters.

Lookups

Lookups fill dropdowns and resource pickers in the editor from the vendor API.

LookupDepends onSearchDescription
chat_modelsclient-side{{ (item.providers | map(attribute=‘provider’) | join(’, ’)) if item.providers else ‘’ }}
modelstaskserver-side
hub_modelsserver-side
embedding_modelsserver-side
image_modelsserver-side

Triggers

Node type connector.hugging_face_trigger.

TriggerIDKindDeduplication keySignatureWebhook registrationCassette tests
On repository eventrepo_eventwebhooktokenautomatic0

Trigger: On repository event

Registers a Hub webhook and starts the workflow on commits, settings changes, discussions or comments.

NameTypeDefaultRequiredShown whenDescription
watched_typeoptions"model"Watch. One of model, dataset, space, user, org.
watched_namestringyesName. Repository id (owner/name), or a user or organization name.
domainsmulti_options["repo"]yesEvent domains. One of repo, discussion.
scopesmulti_optionsOnly these event scopes. Leave empty to receive every event of the chosen domains. One of repo, repo.content, repo.config, discussion, discussion.comment.
secretstringyesWebhook secret. Any random string. Hugging Face sends it back in X-Webhook-Secret and requests without it are rejected.

Import

No exported node type imports to this node.

Provenance

Written from the vendor’s documentation: