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

# Groq

> Using Groq for ultra-fast LLM inference with Upsonic

## Overview

Groq provides ultra-fast inference through their Language Processing Unit (LPU) technology. Access open-source models with industry-leading speed and built-in web search capabilities.

**Model Class:** `GroqModel`

## Authentication

```bash theme={null}
export GROQ_API_KEY="gsk_..."
```

## Examples

```python theme={null}
from upsonic import Agent, Task
from upsonic.models.groq import GroqModel

model = GroqModel(model_name="openai/gpt-oss-120b")
agent = Agent(model=model)

task = Task("Hello, how are you?")
result = agent.do(task)
print(result)
```

## Model Settings

You can set model parameters in two ways: on the model or on the Agent.

**On the model:**

```python theme={null}
from upsonic import Agent, Task
from upsonic.models.groq import GroqModel, GroqModelSettings

model = GroqModel(
    model_name="openai/gpt-oss-120b",
    settings=GroqModelSettings(max_tokens=1024, temperature=0.7)
)
agent = Agent(model=model)
```

**On the Agent:**

```python theme={null}
from upsonic import Agent, Task
from upsonic.models.groq import GroqModelSettings

agent = Agent(
    model="groq/llama-3.3-70b-versatile",
    settings=GroqModelSettings(max_tokens=1024)
)
```

## Parameters

| Parameter | Type | Description | Default | Source |
| - | - | - | - | - |
| `max_tokens` | `int` | Maximum tokens to generate | 1024 | Base |
| `temperature` | `float` | Sampling temperature (0.0-2.0) | 1.0 | Base |
| `top_p` | `float` | Nucleus sampling | 1.0 | Base |
| `seed` | `int` | Random seed | None | Base |
| `stop_sequences` | `list[str]` | Stop sequences | None | Base |
| `presence_penalty` | `float` | Token presence penalty | 0.0 | Base |
| `frequency_penalty` | `float` | Token frequency penalty | 0.0 | Base |
| `parallel_tool_calls` | `bool` | Allow parallel tools | True | Base |
| `timeout` | `float` | Request timeout (seconds) | 600 | Base |
| `groq_reasoning_format` | `'hidden' \| 'raw' \| 'parsed'` | Reasoning output format | None | Specific |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.