Skip to content

Text Generation

barneyonline edited this page May 10, 2026 · 4 revisions
Text Generation banner

Use this page for Assist, AI Tasks, direct response services, structured outputs, reasoning-capable models, prompt caching, and Groq Compound models.

Contents

Common tasks

  • Use the generated Conversation entity with Assist.
  • Use the generated AI Task entity for data generation.
  • Call groq.generate_text from scripts and automations.
  • Call groq.generate_structured when an automation needs JSON that follows a schema.
  • Use groq.clear_cache when cached text-generation responses need to be cleared for an account.

Setup

  1. Open the Groq integration page.
  2. Choose Add Text Generation.
  3. Enter a friendly service name.
  4. Select a compatible Groq chat model.
  5. Configure defaults such as system prompt, temperature, token limits, streaming, reasoning, structured output, prompt caching, and free-tier protection.
View Screenshot
Basic Text Generation setup Text Generation setup basic options
Advanced Text Generation setup Text Generation setup advanced options
Generated Conversation and AI Task entities Text Generation entities

Entities and actions

Surface Use it for
Conversation entity Home Assistant Assist conversations backed by the configured Groq service.
AI Task entity Home Assistant data-generation tasks that can use structured schemas when available.
groq.generate_text Direct text generation from scripts, automations, dashboards, or Developer Tools -> Actions.
groq.generate_structured Text generation with an optional JSON Schema and strict structured-output mode.
groq.clear_cache Clear cached text-generation responses for a Groq account.

Service calls

Basic text generation

action: groq.generate_text
data:
  prompt: Summarize the current home status for a dashboard notification.
  model: llama-3.1-8b-instant
  temperature: 0.2
response_variable: groq_text

Select a named service

If you have more than one Groq account or more than one Text Generation service, select the target account or service explicitly.

action: groq.generate_text
data:
  service_id: Home Summary
  prompt: Write a short status update for the hallway dashboard.
response_variable: groq_text

Structured outputs

Use groq.generate_structured when you want the response to follow a JSON Schema.

action: groq.generate_structured
data:
  prompt: Extract the room, device, and requested action from "turn off the kitchen lights".
  model: openai/gpt-oss-20b
  strict: true
  schema_name: home_intent
  schema:
    type: object
    properties:
      room:
        type: string
      device:
        type: string
      action:
        type: string
    required:
      - room
      - device
      - action
    additionalProperties: false
response_variable: groq_structured

Generate text action

Advanced request options

The Text Generation setup flow and services support:

  • model
  • system prompt
  • temperature
  • maximum completion tokens
  • top-p
  • stop sequences
  • seed
  • service tier
  • streaming Assist responses
  • reasoning effort, reasoning format, and include-reasoning for supported models
  • prompt caching for supported models
  • structured outputs for supported models
  • additional request body options

Use request_body_options for Groq chat completion fields that are not exposed as dedicated Home Assistant controls.

action: groq.generate_text
data:
  prompt: Create a short goodnight message.
  model: openai/gpt-oss-20b
  request_body_options:
    user: home-assistant
    metadata:
      workflow: bedtime
response_variable: groq_text

Reasoning, prompt caching, and structured-output controls are gated by model capability. If an option is unavailable or rejected, choose a model that supports that capability.

Built-in fallback models

The setup flow prefers live Groq model discovery. If discovery is unavailable, the integration has built-in fallback model IDs including:

  • llama-3.1-8b-instant
  • llama-3.3-70b-versatile
  • meta-llama/llama-4-scout-17b-16e-instruct
  • openai/gpt-oss-20b
  • openai/gpt-oss-120b
  • openai/gpt-oss-safeguard-20b
  • qwen/qwen3-32b
  • groq/compound
  • groq/compound-mini

Structured output is available only for compatible models. Reasoning and prompt caching options are also only offered for models known to support them.

Related pages

Clone this wiki locally