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

# Groq

> AgentOps provides first class support for Groq

[Groq](https://groq.com) accelerates LLM inference with its ultra-fast Language Processing Unit (LPU) that powers Groq Cloud. Explore the [Groq docs](https://console.groq.com/docs/overview) to get started with their developer console.

## Steps to Integrate Groq with AgentOps

**1. Install the AgentOps SDK**

```bash pip  theme={null}
pip install agentops
```

```bash poetry theme={null}
poetry add agentops
```

**2. Install the Groq SDK**

```bash pip theme={null}
pip install groq
```

```bash poetry theme={null}
poetry add groq
```

**3. Initialize AgentOps and develop with Groq**

> [!NOTE]
>
> Make sure to call `agentops.init` before calling any `openai`, `cohere`, `crew`, etc models.

```python python theme={null}
from groq import Groq
import agentops

agentops.init(<INSERT YOUR API KEY HERE>)
client = Groq(api_key="your_api_key")

# Your code here...

agentops.end_session('Success')
```

> [!TIP]
>
> Set your API key as an `.env` variable for easy access.

```python .env theme={null}
AGENTOPS_API_KEY=<YOUR API KEY>
GROQ_API_KEY=<YOUR OPENAI API KEY>
```

Read more about environment variables in [Advanced Configuration](https://docs.agentops.ai/v1/usage/advanced-configuration.md)

**4. Run your Agent**

Execute your program and visit [app.agentops.ai/drilldown](https://app.agentops.ai/drilldown) to observe your Agent! 🕵️

> [!TIP]
>
> After your run, AgentOps prints a clickable url to console linking directly to your session in the Dashboard

![](https://github.com/AgentOps-AI/agentops/blob/main/docs/images/external/groq/groq_session.png?raw=true)

Clickable link to session

## Full Examples

```python sync theme={null}
from groq import Groq
import agentops

agentops.init(<INSERT YOUR API KEY HERE>)
client = Groq(api_key="your_api_key")

response = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Explain the importance of low latency LLMs",
        }
    ],
    model="llama3-8b-8192",
)

print(response.choices[0].message.content)
agentops.end_session('Success')
```

```python async theme={null}
from groq import AsyncGroq
import agentops
import asyncio

async def main() -> None:
    agentops.init(<INSERT YOUR API KEY HERE>)
    client = AsyncGroq(api_key="your_api_key")

    response = await client.chat.completions.create(
        messages=[
            {
                "role": "user",
                "content": "Explain the importance of low latency LLMs",
            }
        ],
        model="llama3-8b-8192",
    )

    print(response.choices[0].message.content)
    agentops.end_session('Success')

asyncio.run(main())
```

> [card] [Multi Agent Example](https://github.com/AgentOps-AI/agentops/blob/main/examples/multi_agent_groq_example.ipynb)
>
> This notebook demonstrates how to use AgentOps with a multi-agent system using Groq.


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