groq-pack
Complete Groq integration skill pack with 24 skills covering LPU inference, ultra-fast AI, and Groq Cloud deployment. Flagship tier vendor pack.
Installation
Open Claude Code and run this command:
/plugin install groq-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
What It Does
> 24 Claude Code skills for Groq's ultra-fast LPU inference API -- real SDK code, real model IDs, real speed benchmarks.
Skills (24) plugin-local skills
Configure Groq CI/CD integration with GitHub Actions, testing, and model validation.
Groq CI Integration
Overview
Set up CI/CD pipelines for Groq integrations with unit tests (mocked), integration tests (live API), and model deprecation checks. Groq's fast inference makes live integration tests practical in CI -- a completion round-trip takes < 500ms.
Prerequisites
- GitHub repository with Actions enabled
- Groq API key stored as GitHub secret
- vitest or jest for testing
Instructions
The integration has four moving parts. Read this section for the high-level flow, then drill into the reference files for the full copy-paste blocks — the complete workflows and configuration live in references/implementation.md and the full test suite in references/examples.md.
Step 1: GitHub Actions workflow
Write .github/workflows/groq-tests.yml with three jobs: unit-tests (mocked groq-sdk, runs on every PR, no key), integration-tests (live API, push-to-main only, guarded by if: github.event_name != 'pull_request'), and a weekly model-check cron that diffs the model IDs the code references against Groq's live model list. The job skeleton:
# .github/workflows/groq-tests.yml — see references/implementation.md for full file
on:
push: { branches: [main] }
pull_request: { branches: [main] }
schedule:
- cron: "0 6 * * 1" # Weekly model deprecation check
jobs:
unit-tests: # mocked groq-sdk, no API key
integration-tests: # live API, push-to-main only
model-check: # curl /v1/models, flag deprecated IDs
Step 2: Configure secrets
Store a CI-scoped key with gh secret set GROQ_API_KEY --body "gsk_your_ci_key_here". Keep it separate from the production key so it rotates and tracks CI usage independently.
Step 3: Integration test suite
Add tests/groq.integration.ts gated on a GROQ_INTEGRATION env var (so the file is a no-op without a key). It asserts model listing, chat completion, streaming, and JSON mode. Full file: references/examples.md.
Step 4: Release workflow
Gate npm publish behind a live production Groq round-trip so a broken key or deprecated model blocks the release. Full release.yml: references/implementation.md.
CI best practices: mock groq-sdk in unit tests, run integration tests only on main push (saves quota), prefer llama-3.1-8b-instant (cheapest, fastest) with low max_tokens (5-50), add timeout-minutes: 2, and schedule the weekly deprecation check.
Output
Applying this skill produc
Diagnose and fix Groq API errors with real error codes and solutions.
Groq Common Errors
Overview
Comprehensive reference for Groq API error codes, their root causes, and proven fixes. Groq returns standard HTTP status codes with structured error bodies and rate-limit headers. This skill walks the diagnosis from raw error string to fix, then hands off to the full per-status reference for depth.
Every Groq error body follows one shape — read the code and type first:
{
"error": {
"message": "Rate limit reached for model `llama-3.3-70b-versatile`...",
"type": "tokens",
"code": "rate_limit_exceeded"
}
}
Prerequisites
GROQ_API_KEYexported in the environment (keys start withgsk_).curlandjqavailable for the diagnostic probes below.- For SDK-level handling:
groq-sdk(TypeScript) orgroq(Python) installed.
Instructions
- Capture the failing status and body. Read the raw error response — the HTTP status plus the
code/typefields determine the whole diagnosis path. - Confirm the key works before assuming anything deeper:
set -euo pipefail
# Verify API key is valid — expect a model count, not an auth error
curl -s https://api.groq.com/openai/v1/models \
-H "Authorization: Bearer $GROQ_API_KEY" | jq '.data | length'
- Confirm the model still exists. Many 400s are deprecated model IDs — list the live models and Grep your codebase for any stale ID:
curl -s https://api.groq.com/openai/v1/models \
-H "Authorization: Bearer $GROQ_API_KEY" | jq '.data[].id' | sort
- Map the status to a fix using the table below, then drill into references/error-reference.md for the exact error string, causes, and copy-paste fix.
- For SDK integrations, branch on the typed exception classes — see references/sdk-error-handling.md.
Output
A diagnosis that names the error class, the root cause, and the concrete fix — for example: "429 on TPM: token budget exhausted; add the single-retry handleRateLimit wrapper and honor retry-after," or "400: mixtral-8x7b-32768 is deprecated; switch to llama-3.3-70b-versatile." When run against real code, the output is the edited call site plus a verification curl that returns 200.
Error Handling
Map the HTTP status to its cause; full error strings, rate-limit headers, a
Execute Groq's primary workflow: chat completions with tool use and JSON mode.
Groq Core Workflow A: Chat, Tools & Structured Output
Overview
Primary integration patterns for Groq: chat completions, tool/function calling, JSON mode, and structured outputs. Groq's LPU delivers sub-200ms time-to-first-token, making these patterns viable for real-time user-facing features. This skill walks through five workflow steps; the lean skeleton lives here, and the full copy-paste code lives in references/.
Prerequisites
- Install the SDK with
npm install groq-sdk. - Set
GROQ_API_KEYin the environment (see Authentication below). - Familiarity with the Groq model line-up and which model fits each task.
Authentication
Groq authenticates via an API key. Create one at console.groq.com/keys and export it as GROQ_API_KEY; the SDK reads it automatically, so new Groq() needs no explicit argument. Never hardcode the key — read it from the environment (or a secrets manager) so it stays out of source control.
Model Selection for This Workflow
| Task | Recommended Model | Why |
|---|---|---|
| Chat with tools | llama-3.3-70b-versatile |
Best tool-calling accuracy |
| JSON extraction | llama-3.1-8b-instant |
Fast, accurate for structured tasks |
| Structured outputs | llama-3.3-70b-versatile |
Supports strict: true schema compliance |
| Vision + chat | meta-llama/llama-4-scout-17b-16e-instruct |
Multimodal input |
Instructions
Work through the five patterns in order. Read the target file, then Write or Edit the integration code into your project.
- Chat completion — send
system+usermessages togroq.chat.completions.createand returnchoices[0].message.contentplususage. Skeleton below; full example in worked examples. - Tool use / function calling — a three-phase loop: send the message with
tools+tool_choice: "auto", execute any returnedtool_calls, then send the results back for the final answer. Full code in implementation. - JSON mode — set
response_format: { type: "json_object" }and describe the JSON shape in the system prompt. See implementation. - Structured outputs — use
response_format.json_schemawithstrict: truefor guaranteed schema compliance (no post-validation). See implementation
Use when you need Groq's non-chat endpoints — transcribing or translating audio with Whisper, understanding images with Llama 4 vision, generating speech (TTS), or benchmarking models for speed vs quality.
Groq Core Workflow B: Audio, Vision & Speech
Overview
Beyond chat completions, Groq offers ultra-fast Whisper transcription (216x real-time), Llama 4 vision, and text-to-speech — all on the same groq-sdk client. This skill covers transcription/translation, vision, TTS, and model benchmarking, with full runnable code in references/implementation.md and worked scripts in references/examples.md.
Prerequisites
groq-sdkinstalled,GROQ_API_KEYset (the SDK reads it from the environment automatically)- For audio: audio files in a supported format
- For vision: image URLs or base64-encoded images
Audio Models
| Model ID | Languages | Speed | Best For |
|---|---|---|---|
whisper-large-v3 |
100+ | 164x real-time | Best accuracy, multilingual |
whisper-large-v3-turbo |
100+ | 216x real-time | Best speed/accuracy balance |
Supported audio formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm
Instructions
Each workflow is a single SDK call on the shared groq client. Pick the endpoint for your task, then follow the full walkthrough in references/implementation.md for the complete, copy-pasteable version of each.
- Transcription —
groq.audio.transcriptions.create({ file, model: "whisper-large-v3-turbo", response_format }). Useresponse_format: "verbose_json"withtimestamp_granularities: ["segment"]to get per-segment start/end times. - Translation —
groq.audio.translations.create({ file, model: "whisper-large-v3" })transcribes any-language audio directly to English text. - Vision — a normal
groq.chat.completions.createcall wherecontentis an array mixing{ type: "text" }and{ type: "image_url" }parts. Accepts up to 5 images (URL ordata:base64) withmeta-llama/llama-4-scout-17b-16e-instruct. - Text-to-Speech —
groq.audio.speech.create({ model: "playai-tts", input, voice, response_format }), then writeBuffer.from(await response.arrayBuffer())to a file. - Benchmarking — loop a prompt across several chat models and time each call to compare latency and tokens/sec (see references/examples.md).
Minimal transcription skeleton:
import Groq from "groq-sdk";
impoOptimize Groq costs through model routing, token management, and usage monitoring.
Groq Cost Tuning
Overview
Optimize Groq inference costs through smart model routing, token minimization, and caching. Groq pricing is already extremely competitive, but at high volume the savings from routing classification to 8B vs 70B are 12x per request.
Prerequisites
- A Groq account with an API key exported as the
GROQ_API_KEYenvironment variable — thegroq-sdkclient reads it automatically (new Groq()). - Node.js with the
groq-sdkpackage installed (npm install groq-sdk). - Access to the Groq Console to set spending caps and read the usage dashboard.
Groq Pricing (per million tokens)
| Model | Input | Output |
|---|---|---|
llama-3.1-8b-instant |
~$0.05 | ~$0.08 |
llama-3.3-70b-versatile |
~$0.59 | ~$0.79 |
llama-3.3-70b-specdec |
~$0.59 | ~$0.99 |
meta-llama/llama-4-scout-17b-16e-instruct |
~$0.11 | ~$0.34 |
whisper-large-v3-turbo |
~$0.04/hr | — |
Check current pricing at groq.com/pricing.
Instructions
Apply these six levers in order. Each compounds on the last — routing alone is the biggest win (~12x), and caching plus batching halve the remainder. The lean skeleton below shows the routing core; the full code for every step lives in references/implementation.md.
- Smart model routing — map each use case to the cheapest model that meets its quality bar (classification/extraction/summarization →
llama-3.1-8b-instant; reasoning/code review/chat →llama-3.3-70b-versatile; vision →llama-4-scout). - Minimize tokens per request — trim verbose system prompts and cap
max_tokensso a one-word answer never bills for a paragraph. - Batch to reduce overhead — fold many items into one request; 10-in-1 cuts per-request overhead and RPM pressure ~90%.
- Cache deterministic requests — at
temperature: 0, hash identical prompts into a cache for zero-cost, zero-latency repeat hits. - Usage tracking — log token counts and estimated cost per call to catch spend regressions before the invoice.
- Spending limits in console — set a monthly cap, alerts at 50%/80%, and auto-pause in Groq Console > Billing.
import Groq from "groq-sdk";
const groq = new Groq(); // reads GROQ_API_KEY
const ROUTING = {
classification: "llama-3.1-8b-insUse when you need to keep PII out of Groq API calls, filter model responses, audit-log conversations, or track token cost and usage for a Groq integration.
Groq Data Handling
Overview
Manage data flowing through Groq's inference API. This skill wires a privacy pipeline around the Groq SDK: sanitize prompts before they are sent, filter responses after they return, redact PII, hash-log an audit trail, and track token usage and cost. Key fact: Groq does not use API data for model training (Groq Privacy Policy).
Prerequisites
- Node.js project with the
groq-sdkpackage installed (npm i groq-sdk). - A Groq API key exported as
GROQ_API_KEY. The SDK reads it automatically from the environment —new Groq()needs no explicit argument. Never hardcode the key; keep it in an untracked.envor your secret manager. - Node's built-in
cryptomodule (for the audit hash) — no install needed.
Instructions
The pipeline layers in four stages; drop simple add-ons (moderation, cost reporting) on top. Each snippet below is the skeleton — the full, copy-ready code for every stage is in references/implementation.md.
- Sanitize input — run a PII rule table over every message before it leaves your process, flagging which categories were caught:
function sanitizeMessages(messages: any[]): { messages: any[]; hadPII: boolean } {
// apply PII_RULES to each message's content; return redacted copy + flag
}
- Wrap the completion call — call
safeCompletion(...)instead of the rawgroq.chat.completions.create, so input and response both pass the sanitizer.
- Track usage —
trackUsage(model, completion.usage, sessionId)records token counts and estimated cost per call using a per-model price table.
- Audit —
auditedCompletion(...)ties it together and logs a SHA-256 hash of the prompt (never the prompt text) so the audit trail carries no sensitive content.
For content moderation via Llama Guard and a daily cost report, see references/examples.md.
Groq data policy
- Groq does not train on API request/response data.
- Prompts and completions are processed and discarded.
- Groq may temporarily log requests for abuse prevention.
- For enterprise: contact Groq for DPA and SOC 2 compliance details.
Output
- Sanitized messages/responses — text with
[EMAIL],[PHONE],[SSN],[CARD],[IP]placeholders swapped in for detected PII, plus ahadPIIboolean and a list of redacted categories. - Usage records —
Collect Groq debug evidence for support tickets and troubleshooting.
Groq Debug Bundle
Current State
!node --version 2>/dev/null || echo 'N/A' !python3 --version 2>/dev/null || echo 'N/A' !npm list groq-sdk 2>/dev/null | grep groq-sdk || echo 'groq-sdk not installed'
Overview
Collect all diagnostic information needed to resolve Groq API issues. Produces a redacted support bundle (a .tar.gz) with environment info, SDK version, connectivity test results, rate limit headers, per-model latency, and redacted application logs — everything a Groq support engineer needs, with secrets masked before the archive is written.
Prerequisites
GROQ_API_KEYset in environmentcurlandjqavailable- Access to application logs (optional — the log step is skipped if
logs/is absent)
Instructions
The bundle is assembled by a six-step shell script. Each step appends to a file inside a timestamped $BUNDLE_DIR; the final step tars it and deletes the working copy. Run the steps in order in one shell, or paste the whole sequence into a script.
- Environment — capture OS, Node/Python versions, installed Groq SDK versions, and a masked key fingerprint (length + 4-char prefix only, never the key).
- Connectivity — hit
GET /openai/v1/modelsto confirm auth and count available models. - Rate limits — send a 1-token completion and grab the
x-ratelimit-*,retry-after, andx-request-idresponse headers. - Latency — time a minimal completion against each model of interest.
- Log extraction — grep recent Groq/429/rate-limit errors from
logs/*.logand mask anygsk_keys and.envvalues. - Package —
tar -czfthe directory, remove the working copy, and print a review reminder.
The skeleton of Step 1 (the rest is in the full walkthrough):
#!/bin/bash
set -euo pipefail
BUNDLE_DIR="groq-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
# ... append environment, connectivity, rate-limits, latency, logs ...
See references/implementation.md for the complete, copy-pasteable six-step script.
Output
A single archive named groq-debug-TIMESTAMP.tar.gz (where TIMESTAMP is YYYYMMDD-HHMMSS) containing:
| File | Purpose | Sensitive? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
environment.txt |
Node/Python versions, SDK version, key fingerprint | Key prefix only | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
connectivity.txt |
API reachability
groq-deploy-integration
View full skill →
Deploy Groq integrations to Vercel, Cloud Run, and containerized platforms.
ReadWriteEditBash(vercel:*)Bash(fly:*)Bash(gcloud:*)
Groq Deploy IntegrationOverviewDeploy applications using Groq's inference API to Vercel Edge, Cloud Run, Docker, and other platforms. Groq's sub-200ms latency makes it ideal for edge deployments and real-time applications. This SKILL.md is the high-level workflow. Every platform recipe — full source for the Vercel Edge Function, Dockerfile, Cloud Run command, Express health-check server, and Vercel AI SDK handler — lives verbatim in Prerequisites
InstructionsPick the deployment target, then follow its recipe in
The essential Vercel Edge skeleton looks like this — the full streaming body is in the reference:
groq-enterprise-rbac
View full skill →
Use when you run Groq inference for multiple teams and need per-team model allow-lists, spending caps, rate limits, and key rotation — because Groq API keys have no built-in scopes, so access control must live in your gateway.
ReadWriteEdit
Groq Enterprise Access ManagementOverviewManage team access to Groq's inference API through API key strategy, model-level routing controls, spending limits, and usage monitoring. Groq uses flat API keys ( Groq Access Model
Prerequisites
InstructionsAccess control is enforced in your own gateway. The full, copy-paste implementation for every step lives in references/implementation.md; the high-level flow:
groq-hello-world
View full skill →
Create a minimal working Groq chat completion example.
ReadWriteEdit
Groq Hello WorldOverviewBuild a minimal chat completion with Groq's LPU inference API. Groq uses an OpenAI-compatible endpoint, so the API shape is familiar -- but responses arrive 10-50x faster than GPU-based providers. This skill gets you from an installed SDK to a working, verified request; deeper variants (streaming, Python, model selection) live in Prerequisites
InstructionsUse Step 1: Basic Chat Completion (TypeScript)
Step 2: Go deeper (references)Once Step 1 returns text, extend it with the moved-out variants:
OutputA successful run prints the assistant's reply text followed by the total token count, e.g.:
The underlying API returns an OpenAI-compatible Error Handling
|