Skip to main content
Technical Preview

Overview

Client-mode REST API connectors for Hugging Face: triage alarms with OpenAI-compatible chat completions through Inference Providers, create embeddings and classify camera snapshots with HF Inference, pause, resume or scale dedicated Inference Endpoints to zero to control cost, call your own anomaly model, and search Hub models, all with a Hugging Face token. This is one of the templates in the Hugging Face Inference Providers and Endpoints REST API app (hugging-face-inference-providers-and-endpoints). Deploy it alongside the other connectors of that app when they depend on each other (for example a token connector plus an API connector).
Not yet verified against the live vendor API: No Hugging Face token on the factory box. Needs a Hugging Face account with a fine-grained user access token (HF_TOKEN) with ‘Make calls to Inference Providers’ (plus credits: free monthly $0.10 or PRO/Team) for ChatCompletion / FeatureExtraction / ImageClassification, and Inference Endpoints read/write + a namespace (user or org with a payment method) for ListEndpoints / GetEndpoint / Pause / Resume / ScaleToZero, ideally one small CPU test endpoint (e.g. aws eu-west-1 intel-spr x1, scale-to-zero) for the dedicated connector. Then run HF_TOKEN=… [HF_NAMESPACE=…] python3 smoke_huggingface.py: WhoAmI GET + ListRouterModels GET + ChatCompletion POST + FeatureExtraction POST (+ ListEndpoints GET) must return 200. Public Hub/router GETs returning 200 without a token do not clear the gate.

Auth

Hugging Face user access token as Authorization: Bearer {value.json.hf_token} on every event. Fine-grained token: ‘Make calls to Inference Providers’ (router chat / task events) + Inference Endpoints read/write (management + dedicated endpoint calls). Hub secret suggested HF_TOKEN + GET SECRET. Public router / Hub GETs answer without a valid token. Never commit tokens. Auth headers used by the template: Authorization: Bearer {value.json.hf_token}.

Template parameters

BASE_ADDRESS default: https://huggingface.co.

Events

Deploy

Get the template card (JSON with template and metadata) from the broker, then deploy the connector:
The deployable connector from the REST API app, with BASE_ADDRESS already filled in:
Deploy it with -addRoute (do not include ADD METADATA).

Usage example

Call WhoAmI by publishing a JSON payload to its request topic, and read the reply on the response topic:
Last modified on October 21, 2026