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
| Method | Credential kind | Auth kind | Fields | Test request |
|---|---|---|---|---|
| User access token | hugging_face/access_token | bearer | token (secret) | yes |
| OAuth2 (Sign in with Hugging Face) | hugging_face/oauth2 | oauth2_auth_code | client_id, client_secret (secret) | yes |
Actions
Node type connector.hugging_face. Choose a resource and an operation; each operation has its own parameters.
Chat
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Send chat messages | chat.complete | writes | 3 |
Send chat messages
Operation chat.complete. OpenAI-compatible chat completion routed to a provider that serves the model.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
model | resource_locator | yes | Values from lookup chat_models. | ||
routing | options | "default" | Provider selection. One of default, fastest, cheapest, provider. | ||
provider | string | yes | routing = provider | ||
messages | fixed_collection | yes | |||
messages.role | options | "user" | One of system, user, assistant. | ||
messages.content | string | yes | |||
options | collection | ||||
options.temperature | number | ||||
options.max_tokens | number | ||||
options.top_p | number | Top P. | |||
options.seed | number | ||||
options.stop | string | Stop sequences. Comma-separated. | |||
options.frequency_penalty | number | ||||
options.presence_penalty | number | ||||
options.json_schema | json | JSON schema. Structured output (only providers that support it). | |||
simplify | boolean | true | Simplify output. |
Embedding
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Create embeddings | embedding.create | reads | 2 |
Create embeddings
Operation embedding.create. Feature extraction on HF Inference.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
model | resource_locator | "BAAI/bge-small-en-v1.5" | yes | Values from lookup embedding_models. | |
input_mode | options | "single" | Input. One of single, batch. | ||
text | string | yes | input_mode = single | ||
texts | json | yes | input_mode = batch | JSON array of strings. | |
normalize | boolean | true | |||
prompt_name | string | Name of a prompt from the model’s sentence-transformers config, such as query. | |||
truncate | boolean | true | Truncate long inputs. |
Inference
Call any model hosted on HF Inference with a task payload.
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Run a model (JSON input) | inference.run | writes | 2 | |
| Run a model (file input) | inference.run_binary | writes | 1 |
Run a model (JSON input)
Operation inference.run. Sends inputs and task parameters to a model and returns its raw result.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
task | options | "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. | ||
model | resource_locator | yes | Depends on task. Values from lookup models. | ||
inputs | json | yes | A string, or the JSON object the task expects (for example {question, context}). | ||
parameters | json | Task 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.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
task | options | "automatic-speech-recognition" | One of automatic-speech-recognition, audio-classification, image-classification, object-detection, image-segmentation, image-to-text. | ||
model | resource_locator | yes | Depends on task. Values from lookup models. | ||
binary_property | binary_property | "data" | yes | Input binary field. |
Image
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Generate an image | image.generate | writes | 1 |
Generate an image
Operation image.generate. Text-to-image on HF Inference; the image is written to a binary field.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
model | resource_locator | "black-forest-labs/FLUX.1-schnell" | yes | Values from lookup image_models. | |
prompt | string | yes | |||
options | collection | ||||
options.negative_prompt | string | ||||
options.width | number | ||||
options.height | number | ||||
options.num_inference_steps | number | Steps. | |||
options.guidance_scale | number | ||||
options.seed | number | ||||
output_property | string | "data" | Output binary field. |
Hub model
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Search models | model.search | reads | yes | 1 |
| Get a model | model.get | reads | 1 |
Search models
Operation model.search.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
return_all | boolean | false | |||
limit | number | 50 | return_all = false | ||
search | string | Name contains. | |||
author | string | Author or organization. | |||
pipeline_tag | string | Task. | |||
inference_provider | options | "" | Served by. One of ``, all, hf-inference. | ||
sort | options | "trendingScore" | Sort by. One of trendingScore, downloads, likes, lastModified, createdAt. |
Get a model
Operation model.get.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
model | resource_locator | yes | Values from lookup hub_models. | ||
include_providers | boolean | false | Include provider mapping. |
Account
| Operation | ID | Effect | Paginated | Cassette tests |
|---|---|---|---|---|
| Get the current account | user.whoami | reads | 1 |
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.
| Lookup | Depends on | Search | Description |
|---|---|---|---|
chat_models | client-side | {{ (item.providers | map(attribute=‘provider’) | join(’, ’)) if item.providers else ‘’ }} | |
models | task | server-side | |
hub_models | server-side | ||
embedding_models | server-side | ||
image_models | server-side |
Triggers
Node type connector.hugging_face_trigger.
| Trigger | ID | Kind | Deduplication key | Signature | Webhook registration | Cassette tests |
|---|---|---|---|---|---|---|
| On repository event | repo_event | webhook | token | automatic | 0 |
Trigger: On repository event
Registers a Hub webhook and starts the workflow on commits, settings changes, discussions or comments.
| Name | Type | Default | Required | Shown when | Description |
|---|---|---|---|---|---|
watched_type | options | "model" | Watch. One of model, dataset, space, user, org. | ||
watched_name | string | yes | Name. Repository id (owner/name), or a user or organization name. | ||
domains | multi_options | ["repo"] | yes | Event domains. One of repo, discussion. | |
scopes | multi_options | Only these event scopes. Leave empty to receive every event of the chosen domains. One of repo, repo.content, repo.config, discussion, discussion.comment. | |||
secret | string | yes | Webhook 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:
- https://huggingface.co/docs/inference-providers/index
- https://huggingface.co/docs/inference-providers/tasks/index
- https://huggingface.co/docs/inference-providers/tasks/chat-completion
- https://huggingface.co/docs/inference-providers/tasks/feature-extraction
- https://huggingface.co/docs/inference-providers/tasks/text-to-image
- https://huggingface.co/docs/inference-providers/tasks/automatic-speech-recognition
- https://huggingface.co/docs/inference-providers/providers/hf-inference
- https://huggingface.co/docs/inference-providers/hub-api
- https://huggingface.co/docs/hub/api
- https://huggingface.co/docs/hub/oauth
- https://huggingface.co/docs/hub/security-tokens
- https://huggingface.co/docs/hub/webhooks
- https://huggingface.co/docs/huggingface_hub/guides/webhooks
- https://huggingface.co/.well-known/openapi.json