Groq
Access Groq’s ultra-fast inference through NotPixel. Groq uses custom LPU (Language Processing Unit) hardware for extremely low-latency responses.
Setup
1. Get API Key
- Go to Groq Console
- Create an account or sign in
- Navigate to API Keys
- Create a new API key
2. Configure Environment
.env
GROQ_API_KEY=gsk_...Usage
import Ads from 'notpixel';
const ads = new Ads({
publisherId: 'pub_xxx',
model: 'groq/llama-3.1-70b-versatile',
input: 'Explain how caching works in web applications',
});
const response = await ads.offer();
console.log(response.text);Available Models
| Model | Context | Best For |
|---|---|---|
groq/llama-3.1-70b-versatile | 128K | General purpose, high quality |
groq/llama-3.1-8b-instant | 128K | Ultra-fast responses |
groq/mixtral-8x7b-32768 | 32K | Balanced MoE model |
groq/gemma2-9b-it | 8K | Lightweight tasks |
Groq is known for being one of the fastest inference providers, often 10x faster than GPU-based alternatives.
Model Selection
// High quality, still very fast
model: 'groq/llama-3.1-70b-versatile'
// Maximum speed
model: 'groq/llama-3.1-8b-instant'
// Balanced performance
model: 'groq/mixtral-8x7b-32768'Why Groq?
- Ultra-low latency: Responses in milliseconds
- High throughput: Handle more requests per second
- Competitive pricing: Pay per token, not per second
- Open models: Access to Llama, Mixtral, and more
Environment Variable
| Variable | Description |
|---|---|
GROQ_API_KEY | Your Groq API key |