HuggingFace Inference API
Run inference on a HuggingFace-hosted model via the HuggingFace Inference API, posting an input text and echoing the raw JSON response. The access token is read from a Kubernetes Secret.
Install v1.0.3
Installs the template into your Argo namespace. The URL is pinned to this version.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3/template.yaml
Or with the Argo CLI:
argo template create -n argo https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3/template.yaml
Facts
- Category
- AI
- Tags
- ai curl-jq
- Entrypoint
infer- Template SHA-256
e9cf6d7139564ffea4cf0617ac2fbc54e3017c83871b1f0a72f1a3ee92bd4229- Source
- huggingface-inference at catalog commit 67458f7
- API
- item document, latest template.yaml
Images and provenance
Every image is pinned by digest, so a rebuilt tag can never change what this version runs.
| Repository | Tag | Digest |
|---|---|---|
badouralix/curl-jq | none recorded | sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2 |
Parameters
| Name | Description | Default |
|---|---|---|
input-text required |
The input text to run inference on. | none |
model required |
HuggingFace model repo id. Example distilbert-base-uncased |
none |
token-secret-key |
Key within the Secret that holds the access token. | token |
token-secret-name |
Name of the Kubernetes Secret holding the HuggingFace access token. | huggingface-token |
WorkflowTemplate
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: huggingface-inference
labels:
dagweave.io/catalog-item: huggingface-inference
annotations:
# The catalog semver this manifest was authored at. The dagweave app records
# (catalog-item-id, semver) -> content-hash -> base-vN when it mints the tenant
# cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.
dagweave.io/catalog-version: "1.0.3"
dagweave.io/catalog-category: "AI"
spec:
entrypoint: infer
templates:
- name: infer
inputs:
parameters:
# HuggingFace model repo id, e.g. "distilbert-base-uncased".
- name: model
# The input text to run inference on.
- name: input-text
# Name/key of a Kubernetes Secret holding the HuggingFace access token.
- name: token-secret-name
default: huggingface-token
- name: token-secret-key
default: token
container:
# Pinned by digest per the catalog convention: an image rebuild can never
# silently change the behaviour of an already-released item version.
# badouralix/curl-jq:ubuntu — provides sh, curl and jq.
image: badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2
command: [sh, -c]
# Values are passed as env vars (below), never interpolated into the shell.
# jq assembles the {"inputs": ...} body with --arg so text containing quotes
# or newlines is escaped correctly. The model id is URL-path data; it is
# expanded by curl, not the shell.
args:
- |
set -eu
BODY=$(jq -cn --arg t "${INPUT_TEXT}" '{inputs: $t}')
curl -sSf -X POST \
"https://router.huggingface.co/hf-inference/models/${MODEL}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${HF_TOKEN}" \
--data-raw "${BODY}"
env:
- name: MODEL
value: "{{inputs.parameters.model}}"
- name: INPUT_TEXT
value: "{{inputs.parameters.input-text}}"
- name: HF_TOKEN
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.token-secret-name}}"
key: "{{inputs.parameters.token-secret-key}}"
Version history
Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.
-
1.0.3 latest 2026-09-12
Move to badouralix/curl-jq:ubuntu. The Alpine build this pinned carries two jq advisories on the path this item takes, and its publisher has not rebuilt it since 1 July. The ubuntu tag has neither, and fixable CRITICAL/HIGH drops from 4 to 2. It is Ubuntu 24.04 rather than Alpine, so sh is dash rather than busybox ash, curl goes back from 8.21.0 to 8.5.0 and jq from 1.8.1 to 1.7.1. Still runs as root.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3/template.yamlargo template create -n argo https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3/template.yaml -
1.0.2 2026-08-02
Swap the abandoned dwdraju/alpine-curl-jq, last built 2025-02-21, for badouralix/curl-jq, which is still being rebuilt. Fixable CRITICAL/HIGH drops from 19 to 1. Same Alpine base, same root user, same /bin/sh default command; curl goes 8.12.1 to 8.21.0 and jq 1.7.1 to 1.8.1.
This release is documented, but its manifest is not vendored here, so it has no install command. Version document
-
1.0.1 2026-07-17
Fix inference endpoint: the legacy api-inference.huggingface.co host was retired (no longer resolves). Point at the current router.huggingface.co/hf-inference/models/<model> endpoint.
This release is documented, but its manifest is not vendored here, so it has no install command. Version document
-
1.0.0 2026-07-17
Initial release.
This release is documented, but its manifest is not vendored here, so it has no install command. Version document
Run it once
After installing, from the command line.
argo submit -n argo --from workflowtemplate/huggingface-inference \
-p input-text=... \
-p model=distilbert-base-uncased
Workflow that references it
A Workflow with the required parameters filled from the examples.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: huggingface-inference-
spec:
workflowTemplateRef:
name: huggingface-inference
arguments:
parameters:
- name: input-text
value: "..."
- name: model
value: "distilbert-base-uncased"
As a step of a larger workflow
steps:
- - name: huggingface-inference
templateRef:
name: huggingface-inference
template: infer