groq-reference-architecture
Skill by jeremylongshore
Implements a Groq reference architecture with model routing, streaming pipelines, and fallbacks. It is for developers designing new Groq integrations or reviewing project structure.
Install groq-reference-architecture
Built from the published package, never by AI.
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/groq-reference-architecture ~/.claude/skills/groq-reference-architectureRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install groq-reference-architecture in Claude Code
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/groq-reference-architecture ~/.gemini/antigravity-cli/skills/groq-reference-architectureAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install groq-reference-architecture in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
Groq Reference Architecture is a skill for Claude Code that lays out a production service layer for applications built on Groq's LPU inference API. It covers four concerns: routing requests to a model by latency, capability and cost, a middleware band with an LRU cache, latency and token metrics and retry, a multi-provider fallback chain, and a streaming pipeline. The skill describes five ordered steps, each a file under src/groq/.
The router depends on a model registry, the middleware and fallback depend on the client, and the streaming pipeline stands alone. When applied to an existing repo, the skill reads the current src/ layout and searches for direct chat completion calls that should go through the wrappers. It is aimed at developers designing new Groq integrations, reviewing project structure, or setting architecture standards for Groq applications. Full code for each layer is in linked reference files.
Written from the project's SKILL.md and checked against it.
What it can do
- Model routingSelects the cheapest model that meets latency, vision, tool, and cost requirements.
- Middleware wrapperWraps calls with an LRU cache, latency and token metrics, and a pluggable metrics sink.
- Fallback chainRetries on a different model after 429 or 5xx errors and returns a degraded payload instead of throwing.
- Streaming pipelineYields token, done, and error events from an async generator for real-time SSE UIs.
- Codebase reviewReads the existing src/ layout and finds direct Groq completion calls to route through the wrappers.
What you need
- Groq API key set as GROQ_API_KEY
- Node.js 18 or later
- groq-sdk and lru-cache npm packages
- Claude Code
Try asking
- Review my src/ folder and find direct Groq chat completion calls I should wrap.
- Show me how to set up model routing for a latency-critical chat turn on Groq.
- Design a streaming Groq pipeline with a fallback model for my chat UI.
Good to know
- Caching applies only to deterministic requests with temperature set to 0.
- Context windows above 128K tokens need input truncation or chunking.
- Allowed tools are limited to Read and Grep.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/.curated/groq-reference-architecture/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: ReadGrep
-
SKILL.md7 KB -
references/architecture.md4 KB -
references/examples.md2 KB -
references/implementation.md7 KB
Alternatives to groq-reference-architecture
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
groq-reference-architecture: common questions
Does this skill change my Groq code automatically?
The source says the skill reads the current layout and searches for direct create calls to find code that should route through the wrappers. It does not describe automatic edits.
What happens when the primary Groq model is rate limited?
The fallback chain tries a model in a different rate-limit pool on 429 or 5xx responses. It then returns a graceful-degradation payload instead of throwing.
Where is the full code for each layer?
The complete TypeScript for every layer is in references/implementation.md, and the layer diagram is in references/architecture.md.
How do I install groq-reference-architecture?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is groq-reference-architecture free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is groq-reference-architecture safe to use?
It scores 80 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to groq-reference-architecture?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
