{
  "name": "llm-prompt",
  "title": "Prompt an LLM (OpenAI-compatible)",
  "category": "AI",
  "tags": [
    "ai",
    "curl-jq"
  ],
  "version": "1.0.2",
  "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/llm-prompt/1.0.2.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/llm-prompt/1.0.2/template.yaml",
  "entrypoint": "prompt",
  "parameters": [
    {
      "name": "model",
      "title": "Model",
      "description": "Model identifier understood by the target endpoint.",
      "type": "string",
      "required": true,
      "example": "gpt-4o-mini"
    },
    {
      "name": "prompt",
      "title": "Prompt",
      "description": "The user prompt to send.",
      "type": "string",
      "required": true
    },
    {
      "name": "api-key-secret-key",
      "title": "API key secret key",
      "description": "Key within the Secret that holds the API key.",
      "type": "string",
      "required": false,
      "default": "api-key"
    },
    {
      "name": "api-key-secret-name",
      "title": "API key secret name",
      "description": "Name of the Kubernetes Secret holding the API key (sent as a bearer token).",
      "type": "string",
      "required": false,
      "default": "llm-api-key"
    },
    {
      "name": "base-url",
      "title": "Base URL",
      "description": "Base URL of an OpenAI-compatible API. The request goes to \u003cbase-url\u003e/v1/chat/completions.",
      "type": "string",
      "required": false,
      "default": "https://api.openai.com",
      "example": "https://api.openai.com"
    }
  ],
  "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/llm-prompt/1.0.2/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/llm-prompt/1.0.2/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: llm-prompt\n  labels:\n    dagweave.io/catalog-item: llm-prompt\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.2\"\n    dagweave.io/catalog-category: \"AI\"\nspec:\n  entrypoint: prompt\n  templates:\n    - name: prompt\n      inputs:\n        parameters:\n          # Base URL of an OpenAI-compatible API. The item POSTs to\n          # \u003cbase-url\u003e/v1/chat/completions. Point this at any OpenAI-compatible\n          # gateway (OpenAI, Azure OpenAI, vLLM, LiteLLM, OpenRouter, ...).\n          - name: base-url\n            default: https://api.openai.com\n          # Model identifier understood by the target endpoint.\n          - name: model\n          # The user prompt to send.\n          - name: prompt\n          # Name/key of a Kubernetes Secret holding the API key (sent as a bearer).\n          - name: api-key-secret-name\n            default: llm-api-key\n          - name: api-key-secret-key\n            default: api-key\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 chat-completions request body with --arg so a prompt\n        # containing quotes or newlines is escaped correctly, then the raw JSON\n        # response is echoed for a downstream step to consume.\n        args:\n          - |\n            set -eu\n            BODY=$(jq -cn --arg m \"${MODEL}\" --arg p \"${PROMPT}\" \\\n              '{model: $m, messages: [{role: \"user\", content: $p}]}')\n            curl -sSf -X POST \"${BASE_URL}/v1/chat/completions\" \\\n              -H \"Content-Type: application/json\" \\\n              -H \"Authorization: Bearer ${API_KEY}\" \\\n              --data-raw \"${BODY}\"\n        env:\n          - name: BASE_URL\n            value: \"{{inputs.parameters.base-url}}\"\n          - name: MODEL\n            value: \"{{inputs.parameters.model}}\"\n          - name: PROMPT\n            value: \"{{inputs.parameters.prompt}}\"\n          - name: API_KEY\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.api-key-secret-name}}\"\n                key: \"{{inputs.parameters.api-key-secret-key}}\"\n",
  "templateSha256": "e28ff14c2ec4042dfaf5d994473a7c53c80d2a0e7b3fe73f0d0739b414ce3ba0",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/llm-prompt",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
