> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anotherwrapper.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Groq

> Set up Groq & understand how it's used throughout the app

Groq is all about speed. Their custom LPU hardware runs Llama models at blazing-fast inference speeds, making it perfect for features where your users don't want to wait around. If responsiveness matters to your product, Groq is a great addition.

## Get your API key

<Steps>
  <Step title="Create or sign into your Groq account">
    Head to the [Groq Console](https://console.groq.com/login) and sign up or log in.
  </Step>

  <Step title="Generate an API key">
    Go to the [API keys page](https://console.groq.com/keys) and click **Create API key**.
  </Step>

  <Step title="Add it to your env">
    Paste the key in your `.env.local` file:

    ```env theme={null}
    GROQ_API_KEY=your_groq_api_key
    ```
  </Step>
</Steps>

<Warning>
  Save your API key right away -- you won't be able to see it again after creation.
</Warning>

## Available models

All models are defined in the unified model registry at `lib/ai/models.ts`. Both models support vision capability.

| Model            | ID                                              | Features |
| ---------------- | ----------------------------------------------- | -------- |
| Llama 4 Scout    | `meta-llama/llama-4-scout-17b-16e-instruct`     | Vision   |
| Llama 4 Maverick | `meta-llama/llama-4-maverick-17b-128e-instruct` | Vision   |

<Tip>
  Groq's speed advantage is most noticeable in chat and structured generation tasks. If you're building something that needs fast turnaround, these models deliver.
</Tip>

## Apps using Groq

Groq is integrated through Vercel AI SDK 6.0, with provider routing handled by `lib/ai/ai-utils.ts`.

<CardGroup cols={2}>
  <Card title="Chat" icon="comments" href="/apps/chat">
    Multi-provider chat app -- Groq is available as an LLM provider
  </Card>

  <Card title="Marketing Plan" icon="chart-line" href="/apps/marketing-plan">
    Generate structured marketing plans using Groq models
  </Card>

  <Card title="Launch Simulator" icon="sparkles" href="/apps/launch-simulator">
    Generate Product Hunt launch simulations using Groq models
  </Card>
</CardGroup>

<Note>
  The shipped Audio app does not use Groq today. It uses Replicate Whisper for transcription and OpenAI for summaries.
</Note>

## How it works

The codebase uses Vercel AI SDK 6.0 with a unified model registry -- no direct Groq API calls needed.

Here's the typical flow for an AI request:

1. You select a model from the unified registry
2. The request goes through `getModelInstance()` in `lib/ai/ai-utils.ts`
3. The provider is determined via `getProviderFromModelId()`
4. The model is instantiated with `customModel()`
5. The response is streamed back to you
6. Results are stored in PostgreSQL

<Card title="Structure" icon="folder" href="/setup/structure">
  Understand the full project structure of the codebase.
</Card>
