{
  "name": "huggingface-inference",
  "title": "HuggingFace Inference API",
  "category": "AI",
  "tags": [
    "ai",
    "curl-jq"
  ],
  "version": "1.0.3",
  "date": "2026-09-12",
  "notes": "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.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3/template.yaml",
  "entrypoint": "infer",
  "parameters": [
    {
      "name": "input-text",
      "title": "Input text",
      "description": "The input text to run inference on.",
      "type": "string",
      "required": true
    },
    {
      "name": "model",
      "title": "Model",
      "description": "HuggingFace model repo id.",
      "type": "string",
      "required": true,
      "example": "distilbert-base-uncased"
    },
    {
      "name": "token-secret-key",
      "title": "Token secret key",
      "description": "Key within the Secret that holds the access token.",
      "type": "string",
      "required": false,
      "default": "token"
    },
    {
      "name": "token-secret-name",
      "title": "Token secret name",
      "description": "Name of the Kubernetes Secret holding the HuggingFace access token.",
      "type": "string",
      "required": false,
      "default": "huggingface-token"
    }
  ],
  "images": [
    {
      "ref": "badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2",
      "repository": "badouralix/curl-jq",
      "digest": "sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/huggingface-inference/1.0.3/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: huggingface-inference\n  labels:\n    dagweave.io/catalog-item: huggingface-inference\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.3\"\n    dagweave.io/catalog-category: \"AI\"\nspec:\n  entrypoint: infer\n  templates:\n    - name: infer\n      inputs:\n        parameters:\n          # HuggingFace model repo id, e.g. \"distilbert-base-uncased\".\n          - name: model\n          # The input text to run inference on.\n          - name: input-text\n          # Name/key of a Kubernetes Secret holding the HuggingFace access token.\n          - name: token-secret-name\n            default: huggingface-token\n          - name: token-secret-key\n            default: token\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # badouralix/curl-jq:ubuntu — provides sh, curl and jq.\n        image: badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2\n        command: [sh, -c]\n        # Values are passed as env vars (below), never interpolated into the shell.\n        # jq assembles the {\"inputs\": ...} body with --arg so text containing quotes\n        # or newlines is escaped correctly. The model id is URL-path data; it is\n        # expanded by curl, not the shell.\n        args:\n          - |\n            set -eu\n            BODY=$(jq -cn --arg t \"${INPUT_TEXT}\" '{inputs: $t}')\n            curl -sSf -X POST \\\n              \"https://router.huggingface.co/hf-inference/models/${MODEL}\" \\\n              -H \"Content-Type: application/json\" \\\n              -H \"Authorization: Bearer ${HF_TOKEN}\" \\\n              --data-raw \"${BODY}\"\n        env:\n          - name: MODEL\n            value: \"{{inputs.parameters.model}}\"\n          - name: INPUT_TEXT\n            value: \"{{inputs.parameters.input-text}}\"\n          - name: HF_TOKEN\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.token-secret-name}}\"\n                key: \"{{inputs.parameters.token-secret-key}}\"\n",
  "templateSha256": "e9cf6d7139564ffea4cf0617ac2fbc54e3017c83871b1f0a72f1a3ee92bd4229",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/huggingface-inference",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
