Hugging Face · Arazzo Workflow

Hugging Face TGI Inspect and Generate

Version 1.0.0

Read a TGI server's info, tokenize a prompt to check its length, then generate text.

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

Provider

hugging-face

Workflows

tgi-inspect-and-generate
Inspect a TGI server, tokenize a prompt, and generate text from it.
Reads TGI server info, tokenizes the prompt to measure its token count, and generates text from the prompt against the loaded model.
3 steps inputs: hfToken, maxNewTokens, prompt, temperature outputs: finishReason, generatedText, modelId
1
getServerInfo
Read the TGI server info to learn the loaded model id and its maximum input length before submitting a prompt.
2
tokenizePrompt
Tokenize the prompt to measure how many tokens it consumes against the server's input limit.
3
generateText
Generate text from the prompt using the loaded model with details enabled so the finish reason and token count are returned.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Hugging Face TGI Inspect and Generate
  summary: Read a TGI server's info, tokenize a prompt to check its length, then generate text.
  description: >-
    A self-hosted Text Generation Inference (TGI) flow. The workflow reads the
    TGI server's info to learn the loaded model and its maximum input length,
    tokenizes the prompt to measure how many tokens it consumes, and then runs a
    non-streaming text generation request against the loaded model. The info and
    tokenize steps ground the generation request in the server's real limits.
    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-text-generation-api-openapi.yml
      confidence: 0.7
    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: textGenerationApi
  url: ../openapi/hugging-face-text-generation-api-openapi.yml
  type: openapi
workflows:
- workflowId: tgi-inspect-and-generate
  summary: Inspect a TGI server, tokenize a prompt, and generate text from it.
  description: >-
    Reads TGI server info, tokenizes the prompt to measure its token count, and
    generates text from the prompt against the loaded model.
  inputs:
    type: object
    required:
    - hfToken
    - prompt
    properties:
      hfToken:
        type: string
        description: Hugging Face access token used as a Bearer credential.
      prompt:
        type: string
        description: The input prompt to tokenize and 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: getServerInfo
    description: >-
      Read the TGI server info to learn the loaded model id and its maximum
      input length before submitting a prompt.
    operationId: getInfo
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      modelId: $response.body#/model_id
      maxInputLength: $response.body#/max_input_length
  - stepId: tokenizePrompt
    description: >-
      Tokenize the prompt to measure how many tokens it consumes against the
      server's input limit.
    operationId: tokenize
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.hfToken
    requestBody:
      contentType: application/json
      payload:
        inputs: $inputs.prompt
        add_special_tokens: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstTokenId: $response.body#/0/id
  - stepId: generateText
    description: >-
      Generate text from the prompt using the loaded model with details enabled
      so the finish reason and token count are returned.
    operationId: generate
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.hfToken
    requestBody:
      contentType: application/json
      payload:
        inputs: $inputs.prompt
        parameters:
          max_new_tokens: $inputs.maxNewTokens
          temperature: $inputs.temperature
          details: true
          return_full_text: false
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      generatedText: $response.body#/generated_text
      finishReason: $response.body#/details/finish_reason
      generatedTokens: $response.body#/details/generated_tokens
  outputs:
    modelId: $steps.getServerInfo.outputs.modelId
    generatedText: $steps.generateText.outputs.generatedText
    finishReason: $steps.generateText.outputs.finishReason

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-tgi-inspect-and-generate-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.