GROQ_API_KEY in your environment and override the base URL to https://api.groq.com/openai/v1 — Groq's API is OpenAI-compatible, which simplifies config.llama-3.1-70b-versatile, mixtral-8x7b-32768, and gemma2-9b-it — all open-source models hosted on Groq hardware.Most AI agent slowness is not a model problem — it is an inference hardware problem. Claude Sonnet generates tokens at roughly 60 tokens per second on Anthropic's GPU cluster. Groq's LPU generates the same Llama 70B tokens at 300+ per second on custom silicon. That is not a small difference. For a voice agent waiting on a response, or a chat interface where users expect sub-second replies, the gap between providers is the difference between a product that feels alive and one that feels broken.
What Groq Actually Is (Not a Model Company)
This distinction matters before you write a single line of config. Groq does not build AI models. They build chips — specifically the Language Processing Unit (LPU), a custom ASIC designed from the ground up for transformer inference workloads.
They then license open-source models — Llama, Mixtral, Gemma — and host them on their LPU hardware, making them available through a cloud API. When you call Groq, you are running Meta's Llama model on Groq's silicon. You are not using a "Groq model" in the same sense that Claude is Anthropic's model.
Why does this matter? Because it tells you exactly what you are optimizing for when you choose Groq: raw inference speed on capable open-source models, not proprietary training advantages. If you need the specific reasoning quality of Claude or GPT-4, Groq cannot replicate that. If you need those same capable models to respond five times faster, Groq is your answer.
provider: openai with a base URL override rather than a custom provider field. This means any OpenAI-compatible tooling in your pipeline also works with Groq without modification.GROQ_API_KEY Setup
Get your key from console.groq.com. Navigate to API Keys, generate a new key, and copy it. The key prefix is gsk_ — that prefix confirms you have a Groq key, not an OpenAI or Anthropic key mistakenly pasted here.
# .env file
GROQ_API_KEY=gsk_your-key-here
# or export directly
export GROQ_API_KEY="gsk_your-key-here"
OpenClaw reads GROQ_API_KEY from the environment when you set provider: openai with Groq's base URL. There is no separate Groq provider type in OpenClaw — the OpenAI-compatible interface handles it.
Supported Models on Groq
Model availability on Groq changes more frequently than on Anthropic or OpenAI — they add and retire models based on LPU capacity and licensing. As of early 2025, these are the primary models available through OpenClaw:
| Model ID | Parameters | Context | Best For |
|---|---|---|---|
| llama-3.1-70b-versatile | 70B | 128K tokens | General reasoning, agent tasks |
| llama-3.1-8b-instant | 8B | 128K tokens | Ultra-fast classification, routing |
| mixtral-8x7b-32768 | 47B MoE | 32K tokens | Code, structured outputs |
| gemma2-9b-it | 9B | 8K tokens | Instruction following, low latency |
The llama-3.1-70b-versatile model is the default recommendation for most OpenClaw agent tasks. It has the broadest capability profile and the longest context window at 128K tokens. Always verify against console.groq.com before finalizing your model choice — availability shifts.
Speed Benchmarks: What You Actually Get
These numbers come from community testing across multiple OpenClaw deployments in January 2025. Your results will vary based on request size and time of day, but the relative ratios are consistent.
| Provider + Model | Tokens/sec (output) | Time to first token | 200-token response time |
|---|---|---|---|
| Groq — Llama 3.1 70B | 280–380 tok/s | ~180ms | ~0.7s |
| Groq — Llama 3.1 8B | 700–900 tok/s | ~80ms | ~0.3s |
| Groq — Mixtral 8x7B | 400–500 tok/s | ~150ms | ~0.5s |
| Anthropic — Claude Sonnet | 55–80 tok/s | ~400ms | ~3–4s |
| OpenAI — GPT-4 Turbo | 40–60 tok/s | ~600ms | ~4–5s |
The gap is not marginal. For a 200-token reply — roughly a paragraph of text — Groq's Llama 70B responds in under one second. Claude takes three to four seconds. For most web applications, that is the difference between "instant" and "loading state."
openclaw.yaml Configuration
Here is the complete working configuration for Groq inside OpenClaw. The key detail is using the openai provider type with a base URL override — do not try to create a custom provider named groq.
model:
provider: openai
model_id: llama-3.1-70b-versatile
base_url: https://api.groq.com/openai/v1
api_key_env: GROQ_API_KEY
max_tokens: 4096
temperature: 0.7
stream: true
Setting stream: true matters significantly for user-facing agents. Groq's streaming implementation is fast enough that users see the first tokens almost immediately, which dramatically improves perceived responsiveness even before the full response arrives.
For the fastest possible responses at the cost of some capability, swap to llama-3.1-8b-instant:
model:
provider: openai
model_id: llama-3.1-8b-instant
base_url: https://api.groq.com/openai/v1
api_key_env: GROQ_API_KEY
max_tokens: 2048
temperature: 0.5
stream: true
When Raw Speed Beats Everything Else
Speed is not always the most important property. Claude outperforms Groq-hosted models on complex reasoning, nuanced instruction following, and tool ecosystem breadth. So when should you actually choose Groq?
- Real-time chat interfaces — where users expect responses under one second and anything slower breaks the conversational feel
- Voice agents — where text-to-speech latency compounds with model latency, making sub-500ms inference non-negotiable
- Rapid agent iteration — during development when you are running the same prompt hundreds of times to test variations
- High-volume classification steps — routing tasks at the start of a pipeline where you call the model thousands of times per hour
- Cost-sensitive deployments — Groq's per-token pricing for Llama models is lower than Claude or GPT-4, and speed means fewer tokens spent on padding
Sound familiar? If you have built a chat agent and the most common complaint is "it feels slow," switch the model provider to Groq and run a side-by-side test before changing anything else. The results are often dramatic.
Limitations You Need to Know
Groq is fast. It is not a drop-in replacement for everything Claude does.
- No fine-tuning. You get base open-source models as-is. No custom adapter layers, no domain-specific training on your data.
- Smaller model selection. Groq hosts a curated set of popular open-source models. If you need a specific model variant (like Llama-3 fine-tuned for code), Groq probably does not have it.
- No native tool ecosystem. OpenClaw's built-in tool registry has deeper integration testing against Claude and OpenAI. Groq-hosted models support function calling, but edge cases in tool use may require extra testing.
- Context size limits. Mixtral tops out at 32K tokens. For long-document tasks requiring 100K+ context, use Llama 70B or switch providers entirely.
- Response quality variance. Open-source models like Llama and Mixtral have more variability in output quality compared to Claude on nuanced tasks. Set lower temperature values for more predictable outputs.
Free Tier Limits
Groq's free tier is generous for development and testing. Here is what you get as of early 2025:
- 30 requests per minute across all models
- 6,000 tokens per minute for Llama 70B
- 14,400 tokens per minute for Llama 8B (faster model, higher throughput allowance)
- No credit card required to start
- No time limit on the free tier
Here is where most people stop. Do not build a production feature on the free tier. One moderate user load spike will exhaust the request limit and your agent will return 429 errors to real users. Upgrade before you deploy publicly — even the basic paid tier removes the most painful constraints.
Frequently Asked Questions
What exactly is Groq and how is it different from other AI providers?
Groq is a hardware company, not a model company. They built a custom Language Processing Unit (LPU) chip designed specifically for transformer inference. They license and host open-source models like Llama and Mixtral on their hardware, delivering 5–10x faster token generation than GPU-based providers. You are getting better speed on existing models, not a different model.
Which models does Groq support in OpenClaw?
As of early 2025, Groq supports llama-3.1-70b-versatile, llama-3.1-8b-instant, mixtral-8x7b-32768, and gemma2-9b-it through OpenClaw. Model availability changes frequently — verify at console.groq.com before finalizing your production model choice.
How fast is Groq compared to Claude or GPT-4 in real usage?
Groq LPU inference consistently delivers 250–400 tokens per second for Llama 70B, versus 50–80 tokens/sec for Claude Sonnet and GPT-4 Turbo. Time-to-first-token is also faster at typically under 200ms, which matters significantly for streaming and voice agent applications where perceived latency drives user satisfaction.
Does Groq support fine-tuning or custom models in OpenClaw?
No. Groq does not currently offer fine-tuning. You work with hosted base models as-is. If your application requires fine-tuned models, you need a provider like OpenAI, Together AI, or a self-hosted inference setup integrated through OpenClaw's custom base URL configuration.
What are the rate limits on Groq's free tier?
Groq's free tier limits vary by model but typically cap at 30 requests per minute and 6,000 tokens per minute for Llama 70B as of early 2025. For production workloads, upgrade to a paid plan before going live — the limits increase by 10–50x and per-token costs remain competitive with other cloud providers.
When should I use Groq instead of Claude for my OpenClaw agent?
Use Groq when response latency is the primary constraint — real-time chat, voice interfaces, rapid agent iteration cycles, or pipelines where a 5-second response is a user-experience failure. Claude wins on reasoning depth and tool ecosystem; Groq wins on raw throughput speed and cost for high-volume classification tasks.
What is the GROQ_API_KEY environment variable and where do I get it?
GROQ_API_KEY is the environment variable OpenClaw uses to authenticate with the Groq cloud inference API. Get your key from console.groq.com under API Keys — the key starts with gsk_. Set it in your .env file or shell environment before running OpenClaw. The SDK loads it automatically when api_key_env: GROQ_API_KEY is set in your config.
Can I use Groq as a fallback provider in OpenClaw when Claude is slow?
OpenClaw supports provider fallback configuration, but automatic runtime switching based on latency is not a native feature as of early 2025. The practical approach is to assign Groq as the primary provider for specific agent tasks — routing steps, streaming chat responses — and Claude for reasoning-heavy terminal steps, splitting by task type rather than attempting dynamic latency-based routing.
openclaw doctor after config to verify the connection.