GR

groq-hello-world

Provides a minimal TypeScript example to verify Groq API setup and performance.

Install

mkdir -p .claude/skills/groq-hello-world && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6851" && unzip -o skill.zip -d .claude/skills/groq-hello-world && rm skill.zip

Installs to .claude/skills/groq-hello-world

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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".
333 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Beginner

Key capabilities

  • Generate chat completion requests using Groq SDK
  • Validate environment configuration for Groq API
  • Demonstrate basic request and response patterns
  • Print assistant reply text and total token count

How it works

The skill utilizes the Groq SDK to send a chat completion request to the LPU inference API. It logs the message content and token usage from the returned object.

Inputs & outputs

You give it
A chat completion request object containing model ID and messages
You get back
A ChatCompletion object containing assistant response text and usage statistics

When to use groq-hello-world

  • Test Groq API installation
  • Verify GROQ_API_KEY environment variable
  • Build a basic LPU inference request
  • Quick start a Groq integration

About this skill

Groq Hello World

Overview

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/.

Prerequisites

  • groq-sdk installed (npm install groq-sdk)
  • GROQ_API_KEY environment variable set
  • Completed groq-install-auth setup

Instructions

Use 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.

Step 1: Basic Chat Completion (TypeScript)

import 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);

Step 2: Go deeper (references)

Once Step 1 returns text, extend it with the moved-out variants:

Output

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: 142

The 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 Handling

ErrorCauseSolution
401 Invalid API KeyKey not set or invalidCheck GROQ_API_KEY env var
model_not_foundTypo in model ID or deprecated modelCheck model list at console.groq.com/docs/models
429 Rate limitFree tier: 30 RPM on large modelsWait for retry-after header value
context_length_exceededPrompt + max_tokens > model contextReduce prompt size or set lower max_tokens

Examples

  • Minimal request — the TypeScript block in Step 1 above is the canonical hello-world; run it as-is after setting GROQ_API_KEY.
  • Streaming a response — see references/examples.md for the stream: true loop that writes tokens to stdout as they arrive.
  • Python equivalent — the same request in Python: references/examples.md.
  • Choosing a model per task (speed vs. quality vs. vision) — references/examples.md.

Resources

When not to use it

  • When requiring streaming responses
  • When performing model selection based on specific task needs

Prerequisites

groq-sdk installed via npmGROQ_API_KEY environment variable setCompleted groq-install-auth setup

Limitations

  • Requires manual extension for streaming functionality
  • Limited to basic request patterns

How it compares

This workflow provides a verified, minimal TypeScript implementation to confirm SDK and API key functionality before building complex integrations.

Compared to similar skills

groq-hello-world side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
groq-hello-world (this skill)126dNo flagsBeginner
twinmind-local-dev-loop126dCautionBeginner
write-test15moReviewAdvanced
deepgram-hello-world126dReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

twinmind-local-dev-loop

jeremylongshore

Set up local development workflow with TwinMind API integration. Use when building applications that integrate TwinMind transcription, testing API calls locally, or developing meeting automation tools. Trigger with phrases like "twinmind dev setup", "twinmind local development", "twinmind API testing", "build with twinmind".

13

write-test

useautumn

Write integration tests for the Autumn billing system. Use when creating tests, writing test scenarios for billing/subscription features, track/check endpoints, or when the user asks about testing, test cases, or QA.

12

deepgram-hello-world

jeremylongshore

Create a minimal working Deepgram transcription example. Use when starting a new Deepgram integration, testing your setup, or learning basic Deepgram API patterns. Trigger with phrases like "deepgram hello world", "deepgram example", "deepgram quick start", "simple transcription", "transcribe audio".

11

speak-hello-world

jeremylongshore

Create a minimal working Speak language learning example. Use when starting a new Speak integration, testing your setup, or learning basic Speak API patterns for language tutoring. Trigger with phrases like "speak hello world", "speak example", "speak quick start", "simple speak lesson".

01

exa-local-dev-loop

jeremylongshore

Configure Exa local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Exa. Trigger with phrases like "exa dev setup", "exa local development", "exa dev environment", "develop with exa".

00

instantly-local-dev-loop

jeremylongshore

Configure Instantly local development with hot reload and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Instantly. Trigger with phrases like "instantly dev setup", "instantly local development", "instantly dev environment", "develop with instantly".

00

Search skills

Search the agent skills registry