Skip to content

Groq

Groq offers extremely fast LLM inference with a generous free tier.

Setup

Get an API key at console.groq.com.

import { Agent } from '@moon-wave/core';
const agent = new Agent({
name: 'my-agent',
model: {
provider: 'groq',
model: 'llama-3.3-70b-versatile',
},
systemPrompt: 'You are a helpful assistant.',
});

Set the key:

Terminal window
# Local dev
echo "GROQ_API_KEY=gsk_..." > .dev.vars
# Production
npx wrangler secret put GROQ_API_KEY
ModelContextBest for
llama-3.3-70b-versatile128kGeneral purpose (recommended)
llama-3.1-8b-instant128kFast, lightweight tasks
mixtral-8x7b-3276832kComplex reasoning
gemma2-9b-it8kEfficient, multilingual

Environment variable

interface Env {
GROQ_API_KEY: string;
}