Skip to Content
NotPixel SDK v1.0.1 — Now with caching, hooks, and browser tracking!

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

  1. Go to Groq Console 
  2. Create an account or sign in
  3. Navigate to API Keys
  4. 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

ModelContextBest For
groq/llama-3.1-70b-versatile128KGeneral purpose, high quality
groq/llama-3.1-8b-instant128KUltra-fast responses
groq/mixtral-8x7b-3276832KBalanced MoE model
groq/gemma2-9b-it8KLightweight 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

VariableDescription
GROQ_API_KEYYour Groq API key