groq-webhooks-events

Featured

Build event-driven architectures with Groq streaming, batch processing, and async patterns. Use when setting up real-time SSE endpoints, batch processing pipelines, or event-driven LLM processing with Groq. Trigger with phrases like "groq streaming", "groq events", "groq SSE", "groq batch", "groq async", "groq event-driven".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Groq Events & Async Patterns ## Overview Build event-driven architectures around Groq's inference API. Groq does not provide native webhooks, but its sub-second latency enables unique patterns: real-time SSE streaming, batch processing with callbacks, queue-based pipelines, and event processors that use Groq as an LLM classification/extraction engine. ## Prerequisites - `groq-sdk` installed, `GROQ_API_KEY` set - Queue system for batch patterns (BullMQ, Redis, SQS) - Understanding of Server-Sent Events (SSE) for streaming ## Instructions ### Step 1: SSE Streaming Endpoint ```typescript import Groq from "groq-sdk"; import express from "express"; const groq = new Groq(); const app = express(); app.use(express.json()); app.post("/api/chat/stream", async (req, res) => { const { messages, model = "llama-3.3-70b-versatile" } = req.body; res.writeHead(200, { "Content-Type": "text/event-stream", "Cache-Control": "no-cache", Connection: "keep-alive", "X-Accel-Buffering": "no", // Disable nginx buffering }); try { const stream = await groq.chat.completions.create({ model, messages, stream: true, max_tokens: 2048, }); for await (const chunk of stream) { const content = chunk.choices[0]?.delta?.content; if (content) { res.write(`data: ${JSON.stringify({ content, type: "token" })}\n\n`); } } res.write(`data: ${JSON.stringify({ type: "done" })}\n\n`); } catch (err: any) { res.wri...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category