Groq Core Workflow B: Audio, Vision & Speech
Overview
Beyond chat completions, Groq offers ultra-fast Whisper transcription (216x real-time), Llama 4 vision, and text-to-speech — all on the same groq-sdk client. This skill covers transcription/translation, vision, TTS, and model benchmarking, with full runnable code in references/implementation.md and worked scripts in references/examples.md.
Prerequisites
groq-sdk installed, GROQ_API_KEY set (the SDK reads it from the environment automatically)
- For audio: audio files in a supported format
- For vision: image URLs or base64-encoded images
Audio Models
| Model ID |
Languages |
Speed |
Best For |
whisper-large-v3 |
100+ |
164x real-time |
Best accuracy, multilingual |
whisper-large-v3-turbo |
100+ |
216x real-time |
Best speed/accuracy balance |
Supported audio formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm
Instructions
Each workflow is a single SDK call on the shared groq client. Pick the endpoint for your task, then follow the full walkthrough in references/implementation.md for the complete, copy-pasteable version of each.
- Transcription —
groq.audio.transcriptions.create({ file, model: "whisper-large-v3-turbo", response_format }). Use response_format: "verbose_json" with timestamp_granularities: ["segment"] to get per-segment start/end times.
- Translation —
groq.audio.translations.create({ file, model: "whisper-large-v3" }) transcribes any-language audio directly to English text.
- Vision — a normal
groq.chat.completions.create call where content is an array mixing { type: "text" } and { type: "image_url" } parts. Accepts up to 5 images (URL or data: base64) with meta-llama/llama-4-scout-17b-16e-instruct.
- Text-to-Speech —
groq.audio.speech.create({ model: "playai-tts", input, voice, response_format }), then write Buffer.from(await response.arrayBuffer()) to a file.
- Benchmarking — loop a prompt across several chat models and time each call to compare latency and tokens/sec (see references/examples.md).
Minimal transcription skeleton:
import Groq from "groq-sdk";
import fs from "fs";
const groq = new Groq();
async function transcribe(filePath: string): Promise<string> {
const transcription = await groq.audio.transcriptions.create({
file: fs.createReadStream(filePath),
model: "whisper-large-v3-turbo",
response_format: "json",
});
return transcription.text;
}
Output
- Transcription/translation: a
transcription.text string. With verbose_json, a segments[] array where each segment has start, end, and text.
- Vision: the assistant reply at
completion.choices[0].message.content (a natural-language answer about the image(s)).
- Text-to-Speech: an audio response you convert to a
Buffer and write to disk (wav, mp3, flac, opus, or aac).
- Benchmarking: one console line per model — latency in ms, throughput in tok/s, and total tokens.
Vision Model Limits
- Maximum 5 images per request
- Supported formats: JPEG, PNG, GIF, WebP
- Images fetched from URL or embedded as base64
- Vision models also support tool use, JSON mode, and streaming
Error Handling
| Error |
Cause |
Solution |
Invalid file format |
Unsupported audio type |
Convert to mp3/wav/flac first |
File too large |
Audio exceeds 25MB |
Split into smaller chunks |
model_not_found |
Vision model ID wrong |
Use full path: meta-llama/llama-4-scout-17b-16e-instruct |
max_images_exceeded |
>5 images in request |
Reduce to 5 or fewer images |
429 on Whisper |
Audio RPM limit hit |
Queue transcription requests |
Examples
Complete, runnable scripts live in references/examples.md:
- Python transcription with timestamps — transcribe a local MP3 and print each segment with its start/end time.
- Model benchmarking — run one prompt across
llama-3.1-8b-instant, llama-3.3-70b-versatile, and llama-3.3-70b-specdec and print latency + throughput per model.
Quick vision example (analyze one image by URL):
const completion = await groq.chat.completions.create({
model: "meta-llama/llama-4-scout-17b-16e-instruct",
messages: [{
role: "user",
content: [
{ type: "text", text: "What is in this image?" },
{ type: "image_url", image_url: { url: imageUrl } },
],
}],
max_tokens: 1024,
});
console.log(completion.choices[0].message.content);
Resources
Next Steps
For common errors and troubleshooting patterns across all Groq workflows, see the groq-common-errors skill. For chat completions, streaming, tool use, and JSON mode, see groq-core-workflow-a.
Source: jeremylongshore/claude-code-plugins-plus-skills → plugins/saas-packs/groq-pack/skills/groq-core-workflow-b/SKILL.md
1---2name: groq-core-workflow-b3description: "| Use when you need Groq's non-chat endpoints — transcribing or translating audio with Whisper, understanding images with Llama 4 vision, generating speech (TTS), or benchmarking models for speed vs quality. Trigger with phrases like \"groq whisper\", \"groq transcription\", \"groq audio\", \"groq vision\", \"groq TTS\", \"groq speech\"."4allowed-tools: "Read, Bash(npm:*)"5category: media-and-creative6source_repo: jeremylongshore/claude-code-plugins-plus-skills7source_path: "plugins/saas-packs/groq-pack/skills/groq-core-workflow-b/SKILL.md"8source_url: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/HEAD/plugins/saas-packs/groq-pack/skills/groq-core-workflow-b/SKILL.md9---1011# Groq Core Workflow B: Audio, Vision & Speech1213## Overview1415Beyond chat completions, Groq offers ultra-fast Whisper transcription (216x real-time), Llama 4 vision, and text-to-speech — all on the same `groq-sdk` client. This skill covers transcription/translation, vision, TTS, and model benchmarking, with full runnable code in [references/implementation.md](references/implementation.md) and worked scripts in [references/examples.md](references/examples.md).1617## Prerequisites1819- `groq-sdk` installed, `GROQ_API_KEY` set (the SDK reads it from the environment automatically)20- For audio: audio files in a supported format21- For vision: image URLs or base64-encoded images2223## Audio Models2425| Model ID | Languages | Speed | Best For |26|----------|-----------|-------|----------|27| `whisper-large-v3` | 100+ | 164x real-time | Best accuracy, multilingual |28| `whisper-large-v3-turbo` | 100+ | 216x real-time | Best speed/accuracy balance |2930**Supported audio formats**: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm3132## Instructions3334Each workflow is a single SDK call on the shared `groq` client. Pick the endpoint for your task, then follow the full walkthrough in [references/implementation.md](references/implementation.md) for the complete, copy-pasteable version of each.35361. **Transcription** — `groq.audio.transcriptions.create({ file, model: "whisper-large-v3-turbo", response_format })`. Use `response_format: "verbose_json"` with `timestamp_granularities: ["segment"]` to get per-segment start/end times.372. **Translation** — `groq.audio.translations.create({ file, model: "whisper-large-v3" })` transcribes any-language audio directly to English text.383. **Vision** — a normal `groq.chat.completions.create` call where `content` is an array mixing `{ type: "text" }` and `{ type: "image_url" }` parts. Accepts up to 5 images (URL or `data:` base64) with `meta-llama/llama-4-scout-17b-16e-instruct`.394. **Text-to-Speech** — `groq.audio.speech.create({ model: "playai-tts", input, voice, response_format })`, then write `Buffer.from(await response.arrayBuffer())` to a file.405. **Benchmarking** — loop a prompt across several chat models and time each call to compare latency and tokens/sec (see [references/examples.md](references/examples.md)).4142Minimal transcription skeleton:4344```typescript45import Groq from "groq-sdk";46import fs from "fs";4748const groq = new Groq();4950async function transcribe(filePath: string): Promise<string> {51 const transcription = await groq.audio.transcriptions.create({52 file: fs.createReadStream(filePath),53 model: "whisper-large-v3-turbo",54 response_format: "json",55 });56 return transcription.text;57}58```5960## Output6162- **Transcription/translation**: a `transcription.text` string. With `verbose_json`, a `segments[]` array where each segment has `start`, `end`, and `text`.63- **Vision**: the assistant reply at `completion.choices[0].message.content` (a natural-language answer about the image(s)).64- **Text-to-Speech**: an audio response you convert to a `Buffer` and write to disk (`wav`, `mp3`, `flac`, `opus`, or `aac`).65- **Benchmarking**: one console line per model — latency in ms, throughput in tok/s, and total tokens.6667## Vision Model Limits6869- Maximum 5 images per request70- Supported formats: JPEG, PNG, GIF, WebP71- Images fetched from URL or embedded as base6472- Vision models also support tool use, JSON mode, and streaming7374## Error Handling7576| Error | Cause | Solution |77|-------|-------|----------|78| `Invalid file format` | Unsupported audio type | Convert to mp3/wav/flac first |79| `File too large` | Audio exceeds 25MB | Split into smaller chunks |80| `model_not_found` | Vision model ID wrong | Use full path: `meta-llama/llama-4-scout-17b-16e-instruct` |81| `max_images_exceeded` | >5 images in request | Reduce to 5 or fewer images |82| `429` on Whisper | Audio RPM limit hit | Queue transcription requests |8384## Examples8586Complete, runnable scripts live in [references/examples.md](references/examples.md):8788- **Python transcription with timestamps** — transcribe a local MP3 and print each segment with its start/end time.89- **Model benchmarking** — run one prompt across `llama-3.1-8b-instant`, `llama-3.3-70b-versatile`, and `llama-3.3-70b-specdec` and print latency + throughput per model.9091Quick vision example (analyze one image by URL):9293```typescript94const completion = await groq.chat.completions.create({95 model: "meta-llama/llama-4-scout-17b-16e-instruct",96 messages: [{97 role: "user",98 content: [99 { type: "text", text: "What is in this image?" },100 { type: "image_url", image_url: { url: imageUrl } },101 ],102 }],103 max_tokens: 1024,104});105console.log(completion.choices[0].message.content);106```107108## Resources109110- [Groq Speech-to-Text](https://console.groq.com/docs/speech-to-text)111- [Groq Text-to-Speech](https://console.groq.com/docs/text-to-speech)112- [Groq Vision](https://console.groq.com/docs/vision)113- [Groq Models](https://console.groq.com/docs/models)114115## Next Steps116117For common errors and troubleshooting patterns across all Groq workflows, see the `groq-common-errors` skill. For chat completions, streaming, tool use, and JSON mode, see `groq-core-workflow-a`.118119---120121**Source:** [`jeremylongshore/claude-code-plugins-plus-skills`](https://github.com/jeremylongshore/claude-code-plugins-plus-skills) → `plugins/saas-packs/groq-pack/skills/groq-core-workflow-b/SKILL.md`