Skip to content

Text Generation

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

Use this page for Assist, AI Tasks, Home Assistant LLM tools, direct response actions, 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 with an explicit Text Generation service_id.
  • Call groq.generate_structured when an automation needs JSON that follows a schema.
  • Use groq.clear_cache with an explicit Groq account config_entry_id when cached text-generation responses need to be cleared.

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, Home Assistant LLM API access, temperature, token limits, streaming, reasoning, structured output, prompt caching, Compound built-in tools, 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. Can use selected Home Assistant LLM APIs on models that support tool calls.
AI Task entity Home Assistant data-generation tasks that can use structured schemas, image attachments, and Home Assistant tools when available.
groq.generate_text Direct text generation from scripts, automations, dashboards, or Developer Tools -> Actions. Requires service_id.
groq.generate_structured Text generation with an optional JSON Schema and strict structured-output mode. Requires service_id.
groq.clear_cache Clear cached text-generation responses for a Groq account. Requires config_entry_id.

Service calls

Basic text generation

action: groq.generate_text
data:
  service_id: Home Summary
  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

The service_id field is required for Text Generation response actions.

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:
  service_id: Home Summary
  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
  • Compound built-in tools for groq/compound and groq/compound-mini
  • 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:
  service_id: Bedtime Writer
  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, structured-output controls, and Home Assistant tool calls are gated by model capability. If an option is unavailable or rejected, choose a model that supports that capability.

Compound built-in tools

Compound built-in tools are opt-in for groq/compound and groq/compound-mini. Leave the option empty to send an explicit empty allow-list and block Groq server-side web search, website visits, browser automation, code execution, and Wolfram Alpha.

Supported built-in tool IDs are:

  • web_search
  • visit_website
  • browser_automation
  • code_interpreter
  • wolfram_alpha

browser_automation requires web_search. Enabling visit_website, browser_automation, or wolfram_alpha requests Groq's latest Compound system version.

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