/groq-pack:groq-migration-deep-divefrom groq-pack
Migrates codebases from OpenAI, Anthropic, or other LLM providers to Groq with feature-flagged cutover, benchmarking, and rollback plan.
Ships in groq-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
!npm list groq-sdk openai @anthropic-ai/sdk 2>/dev/null | grep -E "groq|openai|anthropic" || echo 'No LLM SDKs found'
Migrate to Groq from OpenAI, Anthropic, or other LLM providers. Groq's OpenAI-compatible API makes migration straightforward — the primary changes are a different SDK import, different model IDs, and different response metadata. The reward is 10-50x faster inference.
The safe path is a provider-abstraction layer plus feature-flagged traffic shifting: route a small canary to Groq, benchmark quality and speed, ramp to 100%, and keep a one-flag rollback the whole way.
| Source | Complexity | Key Changes |
|---|---|---|
| OpenAI | Low | Import, model IDs, base URL — API shape is identical |
| Anthropic | Medium | Different API shape, message format, streaming protocol |
| Local LLMs | Medium | Remove infra, add API calls |
| Other cloud (Bedrock, Vertex) | Medium | Remove cloud SDK, add groq-sdk |
GROQ_API_KEY) from console.groq.com.groq-sdk installed: npm install groq-sdk.groq_migration_pct value for gradual traffic shifting.OPENAI_API_KEY or equivalent)
so you can run both providers side-by-side during the cutover.>=18 if you use the performance.now() benchmark helper.Steps 1-2 below are the essential skeleton — the two changes every migration needs. Steps 3-7 (the provider abstraction, traffic shifting, scanner, benchmark, and full compatibility matrix) are moved verbatim into the reference files linked under Examples so this file stays scannable.
The minimal change: swap the SDK import, client, and model ID. The response
shape is identical, so downstream code (result.choices[0].message.content)
is untouched.
// BEFORE: OpenAI
import OpenAI from "openai";
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const result = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello" }],
});
// AFTER: Groq (minimal changes)
import Groq from "groq-sdk";
const groq = new Groq({ apiKey: process.env.GROQ_API_KEY });
const result = await groq.chat.completions.create({
model: "llama-3.3-70b-versatile", // or "llama-3.1-8b-instant"
messages: [{ role: "user", content: "Hello" }],
});
// Same response shape: result.choices[0].message.content
Centralize the OpenAI/Anthropic → Groq translation so a single map drives the whole codebase and unknown models fall back to a safe default.
// OpenAI → Groq model equivalents
const MODEL_MAP: Record<string, string> = {
// OpenAI → Groq (quality equivalent)
"gpt-4o": "llama-3.3-70b-versatile",
"gpt-4o-mini": "llama-3.1-8b-instant",
"gpt-4-turbo": "llama-3.3-70b-versatile",
"gpt-3.5-turbo": "llama-3.1-8b-instant",
// Anthropic → Groq (approximate)
"claude-3-5-sonnet": "llama-3.3-70b-versatile",
"claude-3-haiku": "llama-3.1-8b-instant",
};
function migrateModelId(model: string): string {
return MODEL_MAP[model] || "llama-3.3-70b-versatile";
}
Once Steps 1-2 compile, wrap both providers in a common interface and shift traffic gradually. The full code lives in the references:
Running this skill's workflow produces:
gpt-* model IDs in use, any OpenAI-only features
(embeddings/images/fine-tuning) that block a clean cutover, and the number
of API-key references to update.LLMProvider layer with GroqProvider and
OpenAIProvider implementations both live behind one getProvider() call.groq_migration_pct feature flag driving the canary → 100% ramp, with a
one-flag rollback to 0%.| Issue | Cause | Solution |
|---|---|---|
| Quality regression | Different model strengths | Tune system prompts for Llama models |
| Missing features | Groq doesn't have embeddings/images | Keep OpenAI for those features |
| Rate limits | Different limits than OpenAI | Configure per-model rate limits |
| Cost increase | Different pricing structure | Route simple tasks to 8B model |
For ongoing SDK version upgrades between Groq model generations, see the
companion groq-upgrade-migration skill in this pack.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
groq-migration, llm-provider, zero-downtime, feature-flag, rollback
24 skills in this plugin
/groq-ci-integrationConfigure Groq CI/CD integration with GitHub Actions, testing, and model validation.
Use when setting up automated testing, configuring CI pipelines,
or integrating Groq tests into your build process.
Trigger with phrases like "groq CI", "groq GitHub Actions",
"groq automated tests", "CI groq".
/groq-common-errorsDiagnose and fix Groq API errors with real error codes and solutions.
Use when encountering Groq errors, debugging failed requests,
or troubleshooting integration issues.
Trigger with phrases like "groq error", "fix groq",
"groq not working", "debug groq", "groq 429".
/groq-core-workflow-aExecute Groq's primary workflow: chat completions with tool use and JSON mode.
Use when implementing chat interfaces, function calling, structured output,
or building AI features with Groq's fast inference.
Trigger with phrases like "groq chat completion", "groq tool use",
"groq function calling", "groq JSON mode".
/groq-core-workflow-bUse 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.
Trigger with phrases like "groq whisper", "groq transcription",
"groq audio", "groq vision", "groq TTS", "groq speech".
/groq-cost-tuningOptimize Groq costs through model routing, token management, and usage monitoring.
Use when analyzing Groq billing, reducing API costs,
or implementing usage monitoring and budget alerts.
Trigger with phrases like "groq cost", "groq billing",
"reduce groq costs", "groq pricing", "groq expensive", "groq budget".
/groq-data-handlingUse 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.
Implements prompt sanitization, PII redaction, response filtering, and usage
tracking. Trigger with phrases like "groq data", "groq PII", "groq GDPR",
"groq data retention", "groq privacy", "groq compliance".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin groq-packOther plugins' skills for the same job