Skip to main content
Use Groq models with Hypertic agent.

Installation

Install the Groq package:
pip install hypertic[groq]

Setup

Set your Groq API key as an environment variable:
export GROQ_API_KEY=...

Initialize Model

Create a Groq model instance:
from hypertic.models import Groq

model = Groq(
    model="meta-llama/llama-4-maverick-17b-128e-instruct",
    api_key="your-api-key",
)

Use with Agent

Pass the model to your agent:
from hypertic.agents import Agent
from hypertic.models import Groq
import os

model = Groq(
    model="meta-llama/llama-4-maverick-17b-128e-instruct",
    api_key=os.getenv("GROQ_API_KEY"),
)
agent = Agent(
    model=model,
    tools=[get_weather],
)

response = agent.run("What's the weather in SF?")
print(response.content)

Configuration Options

Supported parameters for Groq models:
from hypertic.models import Groq
import os

model = Groq(
    model="meta-llama/llama-4-maverick-17b-128e-instruct",
    api_key=os.getenv("GROQ_API_KEY"),
    temperature=0.7,
    max_tokens=1000,
)
For the full list of available models and parameters, see the Groq API documentation.