Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sets up a Groq local development loop with a memoized client, model constants, and mocked plus live test tiers.
52% 91%+39 ptsof test cases passed
Passed 21 of 23 test cases with the skill, and 12 of 23 without it.
What specific environment variable flag is used to conditionally enable live API integration testing in the Groq local dev loop setup?
uses GROQ_INTEGRATION
3 of 3 safety checks passed
Set up a fast, reproducible local development workflow for Groq. Groq's sub-second response times make it uniquely suited for tight dev loops -- you get LLM responses fast enough to iterate without context-switching. This skill scaffolds a project, a memoized client, model constants, and a two-tier test strategy (mocked unit tests + opt-in live integration tests). The lean skeleton lives here; the full code lives in references/implementation.md and references/examples.md.
groq-sdk installed (npm install groq-sdk)GROQ_API_KEY set (free tier is fine for development)The groq-sdk client reads GROQ_API_KEY from the environment automatically —
new Groq() and getGroqClient() both pick it up. Get a key at
console.groq.com/keys, store it in a
git-ignored .env.local, and commit only .env.example as a template. Never
hardcode the key or commit .env.local.
Follow these seven steps in order. Steps 1-2 lay out the project; steps 3-4 centralize the client and model IDs; steps 5-6 establish the test tiers; step 7 templates the environment. Full code for each is in the reference files.
src/groq/{client,models,completions}.ts, tests/, and .env.local / .env.example.dev (tsx watch), test / test:watch (vitest), and test:integration scripts.getGroqClient() that fails fast when GROQ_API_KEY is missing and a resetClient() for tests.MODELS map with DEV_MODEL defaulting to llama-3.1-8b-instant to conserve dev quota.vi.mock("groq-sdk") so unit tests run sub-second with zero API calls.GROQ_INTEGRATION=1 with describe.skipIf so the default run stays offline..env.example, git-ignore .env.local.// src/groq/client.ts -- lazily-memoized singleton
import Groq from "groq-sdk";
let _client: Groq | null = null;
Next to this one in the catalogue, plus more from the same author.