Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 80
  • 3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-architecture

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install groq-reference-architecture in Claude Code

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

A

No 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 →

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.

groq-reference-architecture Install

Add to stack

Loading.