/groq-pack:groq-deploy-integrationfrom groq-pack
Deploys Groq-powered applications to Vercel, Cloud Run, and Docker. Covers platform-specific secrets, edge functions, and containerized deployment pipelines.
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.
None: SKILL.md is the whole skill.
Deploy 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.
GROQ_API_KEYgroq-sdk package// app/api/chat/route.ts (Next.js App Router)
import Groq from "groq-sdk";
export const runtime = "edge";
export async function POST(req: Request) {
const groq = new Groq({ apiKey: process.env.GROQ_API_KEY! });
const { messages, stream: useStream } = await req.json();
if (useStream) {
const stream = await groq.chat.completions.create({
model: "llama-3.3-70b-versatile",
messages,
stream: true,
max_tokens: 2048,
});
const encoder = new TextEncoder();
const readable = new ReadableStream({
async start(controller) {
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) {
controller.enqueue(
encoder.encode(`data: ${JSON.stringify({ content })}\n\n`)
);
}
}
controller.enqueue(encoder.encode("data: [DONE]\n\n"));
controller.close();
},
});
return new Response(readable, {
headers: {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
Connection: "keep-alive",
},
});
}
const completion = await groq.chat.completions.create({
model: "llama-3.3-70b-versatile",
messages,
max_tokens: 2048,
});
return Response.json(completion);
}
set -euo pipefail
# Set secret
vercel env add GROQ_API_KEY production
# Deploy
vercel --prod
FROM node:20-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-slim
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json .
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s CMD curl -sf http://localhost:3000/health || exit 1
CMD ["node", "dist/index.js"]
set -euo pipefail
# Store API key in Secret Manager
echo -n "$GROQ_API_KEY" | gcloud secrets create groq-api-key --data-file=-
# Deploy with streaming support
gcloud run deploy groq-api \
--source . \
--region us-central1 \
--set-secrets=GROQ_API_KEY=groq-api-key:latest \
--min-instances=1 \
--max-instances=10 \
--cpu=1 --memory=512Mi \
--allow-unauthenticated \
--timeout=60s
import express from "express";
import Groq from "groq-sdk";
const app = express();
const groq = new Groq();
app.use(express.json());
// Health check -- uses cheapest model with minimal tokens
app.get("/health", async (_req, res) => {
try {
const start = performance.now();
await groq.chat.completions.create({
model: "llama-3.1-8b-instant",
messages: [{ role: "user", content: "OK" }],
max_tokens: 1,
});
res.json({
status: "healthy",
groq: { connected: true, latencyMs: Math.round(performance.now() - start) },
});
} catch (err: any) {
res.status(503).json({
status: "unhealthy",
groq: { connected: false, error: err.message },
});
}
});
// Chat endpoint with streaming
app.post("/api/chat", async (req, res) => {
const { messages, model = "llama-3.3-70b-versatile" } = req.body;
if (req.headers.accept === "text/event-stream") {
res.writeHead(200, {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
Connection: "keep-alive",
});
const stream = await groq.chat.completions.create({
model,
messages,
stream: true,
max_tokens: 2048,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) {
res.write(`data: ${JSON.stringify({ content })}\n\n`);
}
}
res.write("data: [DONE]\n\n");
res.end();
} else {
const completion = await groq.chat.completions.create({
model,
messages,
max_tokens: 2048,
});
res.json(completion);
}
});
app.listen(3000, () => console.log("Groq API server on :3000"));
// Using @ai-sdk/groq for Vercel AI SDK
import { createGroq } from "@ai-sdk/groq";
import { streamText } from "ai";
const groq = createGroq({ apiKey: process.env.GROQ_API_KEY });
export async function POST(req: Request) {
const { messages } = await req.json();
const result = streamText({
model: groq("llama-3.3-70b-versatile"),
messages,
});
return result.toDataStreamResponse();
}
| Platform | Command |
|---|---|
| Vercel | vercel env add GROQ_API_KEY production |
| Cloud Run | gcloud secrets create groq-api-key --data-file=- |
| Fly.io | fly secrets set GROQ_API_KEY=gsk_... |
| Railway | railway variables set GROQ_API_KEY=gsk_... |
| Docker | -e GROQ_API_KEY=gsk_... or Docker secrets |
| Issue | Cause | Solution |
|---|---|---|
| Rate limited (429) | Too many requests | Implement request queuing with backoff |
| Edge timeout | Response > 25s | Use streaming for long completions |
| Model unavailable | Capacity or deprecation | Fall back to llama-3.1-8b-instant |
| Cold start latency | Serverless function init | Set min-instances=1 on Cloud Run |
| API key not found | Secret not configured | Check platform secret config |
For multi-environment setup, see groq-multi-env-setup.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
groq-deploy, vercel-deploy, cloud-run, docker-deploy, edge-functions
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 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-bExecute Groq secondary workflows: audio transcription (Whisper), vision,
text-to-speech, and batch model evaluation.
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-handlingImplement prompt sanitization, PII redaction, response filtering, and
usage tracking for Groq API integrations.
Trigger with phrases like "groq data", "groq PII",
"groq GDPR", "groq data retention", "groq privacy", "groq compliance".
npx claudepluginhub flight505/skill-forge --plugin groq-packOther plugins' skills for the same job