Hugging Face · Arazzo Workflow

Hugging Face Grounded Text Generation

Version 1.0.0

Find a text-generation model on the Hub, confirm it, then run hosted text generation.

1 workflow 3 source APIs 1 provider
View Spec View on GitHub ArazzoWorkflows

Provider

hugging-face

Workflows

grounded-text-generation
Discover a text-generation model on the Hub and generate text with it.
Searches the Hub for a text-generation model, verifies it, and runs a hosted text-generation inference request against the selected model.
3 steps inputs: hfToken, maxNewTokens, prompt, search, temperature outputs: generatedText, modelId
1
findModel
Search the Hub for text-generation models matching the query, sorted by downloads, and take the most popular match.
2
confirmModel
Confirm the selected model exists and read its tags before issuing a paid inference request.
3
generateText
Run a hosted text-generation inference request against the confirmed model. A 200 returns the generated text; a 503 indicates the model is still loading and the request may be retried.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Hugging Face Grounded Text Generation
  summary: Find a text-generation model on the Hub, confirm it, then run hosted text generation.
  description: >-
    Combines the Hub API with the hosted Inference API. The workflow searches the
    Hub for text-generation models, confirms the top match exists, and then runs
    a text-generation inference call against that model with tuning parameters.
    The flow handles the model-loading (503) case by documenting it as a known
    response. Every step spells out its request inline so the flow can be read and
    executed without opening the underlying OpenAPI description.
  version: 1.0.0
  x-realizes-capability-ids:
  - BC-610.60
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-610.60
      capability_name: Artificial Intelligence Management
      spec: hugging-face-natural-language-processing-api-openapi.yml
      confidence: 0.8
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: infoApi
  url: ../openapi/hugging-face-info-api-openapi.yml
  type: openapi
- name: modelsApi
  url: ../openapi/hugging-face-models-api-openapi.yml
  type: openapi
- name: naturalLanguageProcessingApi
  url: ../openapi/hugging-face-natural-language-processing-api-openapi.yml
  type: openapi
workflows:
- workflowId: grounded-text-generation
  summary: Discover a text-generation model on the Hub and generate text with it.
  description: >-
    Searches the Hub for a text-generation model, verifies it, and runs a hosted
    text-generation inference request against the selected model.
  inputs:
    type: object
    required:
    - hfToken
    - search
    - prompt
    properties:
      hfToken:
        type: string
        description: Hugging Face access token used as a Bearer credential.
      search:
        type: string
        description: Full-text search query for finding a model on the Hub.
      prompt:
        type: string
        description: The input text prompt to generate from.
      maxNewTokens:
        type: integer
        description: Maximum number of new tokens to generate.
        default: 128
      temperature:
        type: number
        description: Sampling temperature.
        default: 0.7
  steps:
  - stepId: findModel
    description: >-
      Search the Hub for text-generation models matching the query, sorted by
      downloads, and take the most popular match.
    operationId: $sourceDescriptions.infoApi.listModels
    parameters:
    - name: search
      in: query
      value: $inputs.search
    - name: pipeline_tag
      in: query
      value: text-generation
    - name: sort
      in: query
      value: downloads
    - name: limit
      in: query
      value: 5
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      modelId: $response.body#/0/id
    onSuccess:
    - name: haveModel
      type: goto
      stepId: confirmModel
      criteria:
      - context: $response.body
        condition: $.length > 0
        type: jsonpath
  - stepId: confirmModel
    description: >-
      Confirm the selected model exists and read its tags before issuing a paid
      inference request.
    operationId: $sourceDescriptions.modelsApi.getModel
    parameters:
    - name: repo_id
      in: path
      value: $steps.findModel.outputs.modelId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      confirmedModelId: $response.body#/id
  - stepId: generateText
    description: >-
      Run a hosted text-generation inference request against the confirmed model.
      A 200 returns the generated text; a 503 indicates the model is still
      loading and the request may be retried.
    operationId: $sourceDescriptions.naturalLanguageProcessingApi.textGeneration
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.hfToken
    - name: model_id
      in: path
      value: $steps.findModel.outputs.modelId
    requestBody:
      contentType: application/json
      payload:
        inputs: $inputs.prompt
        parameters:
          max_new_tokens: $inputs.maxNewTokens
          temperature: $inputs.temperature
          return_full_text: false
        options:
          use_cache: true
          wait_for_model: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      generatedText: $response.body#/0/generated_text
  outputs:
    modelId: $steps.confirmModel.outputs.confirmedModelId
    generatedText: $steps.generateText.outputs.generatedText

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/hugging-face-grounded-text-generation-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.