GR

groq-multi-env-setup

Configure environment-specific model selection, API keys, and rate limits for Groq.

Install

mkdir -p .claude/skills/groq-multi-env-setup && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8566" && unzip -o skill.zip -d .claude/skills/groq-multi-env-setup && rm skill.zip

Installs to .claude/skills/groq-multi-env-setup

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.

Use when you need Groq to behave differently across dev, staging, and production — cheap fast models and verbose logs in dev, the production model and hardened retries everywhere else, with per-environment API keys. Configure environment-specific model selection, rate limits, and secrets. Trigger with phrases like "groq environments", "groq staging", "groq dev prod", "groq environment setup", "groq multi-env", "groq config by env".
435 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Configure environment-specific model selection
  • Manage per-environment API keys
  • Implement environment-aware logging
  • Verify live connections across environments
  • Hardened retry strategies for production

How it works

It uses a configuration module keyed by NODE_ENV to resolve model, retry, and logging settings. It validates keys and provides a verification script to confirm connectivity.

Inputs & outputs

You give it
NODE_ENV and environment-specific secrets
You get back
Resolved Groq configuration and verified connection

When to use groq-multi-env-setup

  • Setting up per-environment API keys
  • Configuring log verbosity for development
  • Implementing hardened retries for production
  • Defining environment-specific model routing

About this skill

Groq Multi-Environment Setup

Overview

Configure Groq API access across development, staging, and production with the right model, rate limit strategy, and secret management per environment. Key insight: use llama-3.1-8b-instant in development (cheapest, fastest), match production model in staging, and harden production with retries and fallbacks.

Prerequisites

  • A Groq account with API keys from console.groq.com/keys — ideally a separate key (or organization) per environment.
  • Node project with the groq-sdk package installed (npm install groq-sdk).
  • NODE_ENV set per environment (development / staging / production).
  • A secret store for staging/production keys: GitHub Actions secrets, AWS Secrets Manager, GCP Secret Manager, or HashiCorp Vault.

Environment Strategy

EnvironmentAPI Key SourceDefault ModelRetryLogging
Development.env.localllama-3.1-8b-instant1Verbose
StagingCI/CD secretsllama-3.3-70b-versatile3Standard
ProductionSecret managerllama-3.3-70b-versatile5Structured

Instructions

The full, copy-paste implementation lives in the reference files — this section is the map. Read the implementation walkthrough for the code module, service wrapper, and verify script, and secrets & deployment for per-platform key management, Docker Compose profiles, and rate-limit inspection.

  1. Build the config module (config/groq.ts). One configs record keyed by environment resolves model, token budget, retries, timeout, and logging, then validates that a key is present with an environment-specific error message. The essential skeleton:

    const configs: Record<string, GroqEnvConfig> = {
      development: { model: "llama-3.1-8b-instant", maxRetries: 1, logRequests: true, /* ... */ },
      staging:     { model: "llama-3.3-70b-versatile", maxRetries: 3, logRequests: false, /* ... */ },
      production:  { model: "llama-3.3-70b-versatile", maxRetries: 5, logRequests: false, /* ... */ },
    };
    export function getGroqConfig(): GroqEnvConfig {
      return configs[process.env.NODE_ENV || "development"] || configs.development;
    }
    

    See implementation.md § Step 1 for the full module including key validation and the memoized getGroqClient().

  2. Wire an environment-aware service (services/groq-service.ts) that reads the resolved config, logs only when logRequests is on, and surfaces the retry-after header on 429. Full code in implementation.md § Step 2.

  3. Source secrets per platform. Dev reads a git-ignored .env.local; staging uses CI/CD secrets; production pulls from a secret manager. Commands for GitHub Actions, AWS, GCP, and Vault are in secrets-and-deployment.md § Step 3.

  4. Deploy with Docker Compose profiles so each environment injects its own key (env var for dev/staging, external Docker secret for prod). See secrets-and-deployment.md § Step 4.

  5. Verify each environment with scripts/verify-groq-env.ts, which prints the resolved model/retries and does a live round-trip. Full script in implementation.md § Step 5.

  6. Inspect rate limits per key via the x-ratelimit-* response headers — see secrets-and-deployment.md § Step 6.

Output

After setup, each environment resolves its own Groq configuration and the verify script confirms a live connection. Expected output from verify-groq-env.ts in production:

Environment: production
Model: llama-3.3-70b-versatile
Max retries: 5
API key prefix: gsk_AbCd...
Connection: OK (312ms)
Model response: OK

You end with: a config/groq.ts that selects model/retries/logging by NODE_ENV, a service wrapper that logs verbosely only in dev, per-environment keys sourced from the right secret store, and Docker Compose profiles that never leak a production key into the process environment.

Error Handling

IssueCauseSolution
GROQ_API_KEY not setMissing env varCheck .env.local (dev) or secret manager (prod)
Wrong model in envConfig mismatchVerify with verify-groq-env.ts script
Rate limited in devFree tier limitsUse llama-3.1-8b-instant with low max_tokens
Staging/prod key in devKey leak riskUse separate Groq organizations per environment

Examples

Resolve the config for the current environment:

import { getGroqConfig } from "./config/groq";

const config = getGroqConfig();      // picks dev/staging/prod by NODE_ENV
console.log(config.model);           // "llama-3.1-8b-instant" in dev

Complete a chat with the environment default model:

import { complete } from "./services/groq-service";

const answer = await complete([{ role: "user", content: "Summarize in one line." }]);

Verify production before a deploy:

NODE_ENV=production GROQ_API_KEY_PROD=gsk_... npx tsx scripts/verify-groq-env.ts

Full, runnable versions of every snippet are in implementation.md and secrets-and-deployment.md.

Resources

Next Steps

For deployment configuration, see the groq-deploy-integration skill, which builds on this environment strategy to wire CI/CD deploy pipelines and health checks.

When not to use it

  • Single-environment local scripts
  • Environments without secret management infrastructure

Prerequisites

Groq account with API keysgroq-sdk packageNODE_ENV configurationSecret store

Limitations

  • Requires separate Groq organizations for strict key isolation
  • Depends on external secret managers for production

How it compares

This approach centralizes environment logic into a single config module rather than scattering environment checks throughout the codebase.

Compared to similar skills

groq-multi-env-setup side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
groq-multi-env-setup (this skill)027dReviewIntermediate
apollo-deploy-integration127dCautionIntermediate
vercel-hello-world027dCautionBeginner
azure-appconfiguration-ts04moReviewIntermediate

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

apollo-deploy-integration

jeremylongshore

Deploy Apollo.io integrations to production. Use when deploying Apollo integrations, configuring production environments, or setting up deployment pipelines. Trigger with phrases like "deploy apollo", "apollo production deploy", "apollo deployment pipeline", "apollo to production".

19

vercel-hello-world

jeremylongshore

Create a minimal working Vercel example. Use when starting a new Vercel integration, testing your setup, or learning basic Vercel API patterns. Trigger with phrases like "vercel hello world", "vercel example", "vercel quick start", "simple vercel code".

01

azure-appconfiguration-ts

wegonbeok45

Centralized configuration management with feature flags and dynamic refresh.

00

mcp-builder

anthropics

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

136215

telegram-bot-builder

davila7

Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.

106130

telegram-mini-app

davila7

Expert in building Telegram Mini Apps (TWA) - web apps that run inside Telegram with native-like experience. Covers the TON ecosystem, Telegram Web App API, payments, user authentication, and building viral mini apps that monetize. Use when: telegram mini app, TWA, telegram web app, TON app, mini app.

62163

Search skills

Search the agent skills registry