Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create a minimal working Groq chat completion example. Use when starting a new Groq integration, testing your setup after installing the SDK, or learning the basic Groq API request/response pattern before building something larger. Trigger with phrases like "groq hello world", "groq example", "groq quick start", "simple groq code".
.claude/skills/jeremylongshore-groq-hello-world/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-18 | ✗→✓ | ▲ Improved | 21% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 56% | 0% |
| case-20 | ✗→✓ | ▲ Improved | -26% | 0% |
| case-21 | ✓→✗ | ▼ Worse | 2% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 66% | 0% |
Build 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 references/.
groq-sdk installed (npm install groq-sdk)GROQ_API_KEY environment variable setgroq-install-auth setupUse Write to create the example file, then run it to confirm your key and SDK work. Start with the single basic request below; reach for the reference variants only once this succeeds.
typescriptimport Groq from "groq-sdk"; const groq = new Groq(); async function main() { const completion = await groq.chat.completions.create({ model: "llama-3.3-70b-versatile", messages: [ { role: "system", content: "You are a helpful assistant." }, { role: "user", content: "What is Groq's LPU and why is it fast?" }, ], }); console.log(completion.choices[0].message.content); console.log(`Tokens: ${completion.usage?.total_tokens}`); } main().catch(console.error);
Once Step 1 returns text, extend it with the moved-out variants:
A successful run prints the assistant's reply text followed by the total token count, e.g.:
Groq's LPU (Language Processing Unit) is a deterministic, single-core
inference chip... [assistant response continues]
Tokens: 142The underlying API returns an OpenAI-compatible ChatCompletion object: the text is at choices[0].message.content, and usage carries token counts plus four Groq-specific timing fields (queue_time, prompt_time, completion_time, total_time). Full response shape: references/models-and-response.md.
| Error | Cause | Solution | |-------|-------|----------| | 401 Invalid API Key | Key not set or invalid | Check GROQ_API_KEY env var | | model_not_found | Typo in model ID or deprecated model | Check model list at console.groq.com/docs/models | | 429 Rate limit | Free tier: 30 RPM on large models | Wait for retry-after header value | | context_length_exceeded | Prompt + max_tokens > model context | Reduce prompt size or set lower max_tokens |
GROQ_API_KEY.stream: true loop that writes tokens to stdout as they arrive.groq-local-dev-loop for development workflow setup.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 4,061 | 7,802 | +92% | 1 | 1 | 0% | 997 | 1,656 | +66% | 0 | 0 | — |
case-02 | pass→pass | 10,185 | 3,123 | -69% | 1 | 1 | 0% | 1,199 | 1,644 | +37% | 0 | 0 | — |
case-03 | pass→pass | 8,504 | 7,997 | -6% | 1 | 1 | 0% | 783 | 1,583 | +102% | 0 | 0 | — |
case-04 | pass→pass | 9,371 | 2,182 | -77% | 1 | 1 | 0% | 858 | 1,475 | +72% | 0 | 0 | — |
case-05 | pass→pass | 13,072 | 10,478 | -20% | 1 | 1 | 0% | 1,373 | 1,962 | +43% | 0 | 0 | — |
case-06 | pass→pass | 12,683 | 7,991 | -37% | 1 | 1 | 0% | 1,217 | 1,489 | +22% | 0 | 0 | — |
case-07 | pass→pass | 14,268 | 8,516 | -40% | 1 | 1 | 0% | 1,733 | 1,672 | -4% | 0 | 0 | — |
case-08 | pass→pass | 17,158 | 7,612 | -56% | 1 | 1 | 0% | 2,100 | 2,359 | +12% | 0 | 0 | — |
case-09 | pass→pass | 18,588 | 8,688 | -53% | 1 | 1 | 0% | 2,524 | 1,703 | -33% | 0 | 0 | — |
case-10 | pass→pass | 9,405 | 9,689 | +3% | 1 | 1 | 0% | 1,676 | 1,857 | +11% | 0 | 0 | — |
case-11 | pass→pass | 11,826 | 8,828 | -25% | 1 | 1 | 0% | 2,095 | 2,544 | +21% | 0 | 0 | — |
case-12 | pass→pass | 6,478 | 9,496 | +47% | 1 | 1 | 0% | 1,304 | 1,829 | +40% | 0 | 0 | — |
case-13 | pass→pass | 5,582 | 8,935 | +60% | 1 | 1 | 0% | 1,050 | 1,698 | +62% | 0 | 0 | — |
case-14 | pass→pass | 4,739 | 8,172 | +72% | 1 | 1 | 0% | 933 | 1,601 | +72% | 0 | 0 | — |
case-15 | pass→pass | 11,780 | 10,594 | -10% | 1 | 1 | 0% | 1,384 | 2,092 | +51% | 0 | 0 | — |
case-16 | pass→pass | 4,329 | 2,920 | -33% | 1 | 1 | 0% | 740 | 1,518 | +105% | 0 | 0 | — |
case-17 | pass→pass | 8,194 | 3,359 | -59% | 1 | 1 | 0% | 538 | 1,597 | +197% | 0 | 0 | — |
case-18 | fail→pass | 7,173 | 6,917 | -4% | 1 | 1 | 0% | 1,090 | 1,315 | +21% | 0 | 0 | — |
case-19 | fail→pass | 9,617 | 1,728 | -82% | 1 | 1 | 0% | 846 | 1,318 | +56% | 0 | 0 | — |
case-20 | fail→pass | 15,188 | 2,103 | -86% | 1 | 1 | 0% | 1,774 | 1,321 | -26% | 0 | 0 | — |
case-21 | pass→fail | 15,783 | 13,890 | -12% | 1 | 1 | 0% | 3,179 | 3,250 | +2% | 0 | 0 | — |
case-22 | pass→pass | 14,735 | 6,688 | -55% | 1 | 1 | 0% | 1,902 | 2,194 | +15% | 0 | 0 | — |
case-23 | fail→fail | 20,662 | 13,488 | -35% | 1 | 1 | 0% | 3,192 | 3,880 | +22% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.