Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/groq-upgrade-migration

@0d57af8
Run it yourself

Upgrade groq-sdk versions and handle Groq model deprecations. Use when upgrading SDK versions, detecting deprecated models, or migrating to new Groq model IDs. Trigger with phrases like "upgrade groq", "groq migration", "groq breaking changes", "update groq SDK", "groq deprecated model".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/groq-upgrade-migration

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesimplementation.md

≈961 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Groq Upgrade & Migration — Full Walkthrough

The complete, copy-paste-ready command sequence for upgrading groq-sdk and migrating deprecated Groq model IDs. SKILL.md summarizes this workflow at a high level; this file carries every step verbatim.

Authentication

Every Groq API call (including the live-model verification in Step 5) reads the API key from the GROQ_API_KEY environment variable. The SDK constructor (new Groq()) picks it up automatically; the curl verification passes it as a bearer token. Never hard-code the key — export it in your shell or CI secret store:

export GROQ_API_KEY="gsk_..."   # from https://console.groq.com/keys

Step 1: Check Current Version and Models

set -euo pipefail
# SDK version
npm list groq-sdk 2>/dev/null
npm view groq-sdk version  # latest on npm

# Find all model references in your code
grep -rn "model.*['\"]" src/ --include="*.ts" --include="*.js" | grep -i "groq\|llama\|mixtral\|gemma\|whisper"

Step 2: Upgrade SDK

set -euo pipefail
# Create upgrade branch
git checkout -b chore/upgrade-groq-sdk

# Update to latest
npm install groq-sdk@latest

# Check for breaking changes
npm ls groq-sdk

Step 3: Find and Replace Deprecated Models

Add a resolver map so deprecated model IDs are rewritten at runtime while you migrate call sites. Use Read/Edit to fold this into your Groq client module:

// Find-and-replace map for deprecated model IDs
const MODEL_MIGRATIONS: Record<string, string> = {
  "mixtral-8x7b-32768": "llama-3.3-70b-versatile",
  "gemma2-9b-it": "llama-3.1-8b-instant",
  "llama-3.1-70b-versatile": "llama-3.3-70b-versatile",
  "llama-3.1-70b-specdec": "llama-3.3-70b-specdec",
  "llama3-70b-8192": "llama-3.3-70b-versatile",
  "llama3-8b-8192": "llama-3.1-8b-instant",
  "distil-whisper-large-v3-en": "whisper-large-v3-turbo",
};

function resolveModel(model: string): string {
  if (model in MODEL_MIGRATIONS) {
    console.warn(`Model ${model} is deprecated. Using ${MODEL_MIGRATIONS[model]} instead.`);
    return MODEL_MIGRATIONS[model];
  }
  return model;
}

Step 4: Run Migration Scanner

set -euo pipefail
# Automated scan for deprecated patterns
echo "=== Deprecated Model IDs ==="
grep -rn "mixtral-8x7b\|gemma2-9b\|llama-3.1-70b-versatile\|llama3-70b\|llama3-8b\|distil-whisper" \
  src/ --include="*.ts" --include="*.js" --include="*.py" || echo "None found"

echo ""
echo "=== Old Import Patterns ==="
grep -rn "from '@groq/sdk'\|from \"@groq/sdk\"\|require('@groq/sdk')" \
  src/ --include="*.ts" --include="*.js" || echo "None found (correct import is 'groq-sdk')"

echo ""
echo "=== Deprecated Method Calls ==="
grep -rn "\.ping()\|\.healthCheck()\|GroqClient\|GroqError" \
  src/ --include="*.ts" --include="*.js" || echo "None found"

Step 5: Validate and Test

set -euo pipefail
# Run tests
npm test

# Verify models are current
curl -s https://api.groq.com/openai/v1/models \
  -H "Authorization: Bearer $GROQ_API_KEY" | \
  jq -r '.data[].id' | sort

# Integration test
node -e "
const Groq = require('groq-sdk').default;
const g = new Groq();
g.chat.completions.create({
  model: 'llama-3.1-8b-instant',
  messages: [{role: 'user', content: 'ping'}],
  max_tokens: 5
}).then(r => console.log('OK:', r.choices[0].message.content));
"

Step 6: Rollback If Needed

set -euo pipefail
# Pin to previous version
npm install groq-sdk@0.11.0 --save-exact
npm test

SDK Changelog Highlights

The groq-sdk package mirrors the OpenAI SDK structure. Key changes to watch:

  • New model IDs added to type definitions
  • Response type changes (e.g., new usage fields)
  • Constructor options changes
  • New endpoint support (vision, audio, TTS)

Always check the GitHub releases.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a standard and safe workflow for upgrading the Groq SDK and migrating deprecated model IDs. It follows security best practices by recommending environment variables for API key management and uses official Groq API endpoints. While the skill interacts with the local codebase and environment, its actions are consistent with its primary purpose as an upgrade utility.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
version
1.11.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "groq",
  "api",
  "migration"
]
All 5 allowed tools
ReadWriteEditBash(npm:*)Bash(git:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/groq-upgrade-migration