Live survey315 models · 14 providers · 23,592 auditsAudited implement · SAFE →What changedHow we verifyllms.txt

Agent skill · Audited from source

Groq Reference Architecture

skill · jeremylongshore/claude-code-plugins-plus-skillsMIT licenceAudited 8 Oct 2026 · source 4f83675ca38a

★ 2,823pushed todayversion 1.11.0
✓SAFEGrade B · 89/100 · 8 Oct 2026 · 4f83675
2,823repo stars · whole jeremylongshore/claude-code-plugins-plus-skills

Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 4f83675ca38a and found no filesystem, network or shell access and no hard-coded secrets. What it does: Implement Groq reference architecture with model routing, streaming

Ask an AI about this pageGChatGPTCClaudePPerplexityGeGeminiXGrok
More
Cite

Cite this page

ModelsAtlas. “Groq Reference Architecture (jeremylongshore/claude-code-plugins-plus-skills)”. Retrieved 8 Oct 2026. https://modelsatlas.com/skills/jeremylongshore/groq-reference-architecture

Trust audit

Audit 0.4.1 · source read 8 Oct 2026

Trust score89/100✓SAFE B
0 critical0 high0 medium0 low0 info

SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.

What the source does

  • FilesystemNone observedNo reads or writes in the source
  • NetworkNone observedNo outbound calls in the source
  • ShellNone observedNo commands run in the source
  • DependenciesPinnedNothing floats
  • SecretsNone foundNo keys in source

Five audit layers

LayerWhat we checkResultFindings
L0 ProvenanceRepo owner, licence, archive status, activityPASS0
L1 Static sourceSecrets, path traversal, supply chain, hidden codePASS0
L2 InstructionsPrompt injection, authority framing, hidden directivesPASS0
L3 InventoryThe files and declarations match the sourcePASS0
L4 SandboxRun in isolation and watch behaviourSKIPPED why0

Gates applied: no behavioural pass.

Findings (0)

No findings at any severity. We re-audit when the source changes.

Audit 0.4.1 · source sha 4f83675ca38a · 8 Oct 2026Report an issue or request a re-scan

Provenance

Who published it, and what the verdict is pinned to

What it tells the agent

Full source on GitHub ↗

Its description: Implement Groq reference architecture with model routing, streaming

---
name: groq-reference-architecture
description: 'Implement Groq reference architecture with model routing, streaming
  pipelines, and fallbacks.

  Use when designing new Groq integrations, reviewing project structure,

  or establishing architecture standards for Groq applications.

  Trigger with phrases like "groq architecture", "groq best practices",

  "groq project structure", "how to organize groq", "groq design".

  '
allowed-tools: Read, Grep
version: 1.11.0
license: MIT
author: Jeremy Longshore <[email protected]>
tags:
- saas
- groq
- groq-reference
compatibility: Designed for Claude Code
---
# Groq Reference Architecture

## Overview

Production architecture for applications built on Groq's LPU inference API. It
covers four concerns that every serious Groq integration needs: routing requests
to the right model by latency/capability/cost, a middleware band (cache, metrics,
retry), a multi-provider fallback chain, and a streaming pipeline. The service
layer built here is reusable across a chat UI, an API backend, a batch processor,
or an agent.

The full layer diagram and how the pieces interact lives in
[references/architecture.md](references/architecture.md); the complete,
copy-ready TypeScript for every layer is in
[references/implementation.md](references/implementation.md).

## Prerequisites

- **Groq API key** — create one at [console.groq.com](https://console.groq.com)
  and export it as `GROQ_API_KEY`. The Groq SDK reads it from the environment;
  the client is constructed as `new Groq({ apiKey: process.env.GROQ_API_KEY })`.
  Never hardcode the key.
- **Runtime**: Node.js 18+ (for `performance.now()` and native `fetch`).
- **Packages**: `groq-sdk` and `lru-cache` (`npm install groq-sdk lru-cache`).
- **Optional backup provider**: an OpenAI-compatible key if you extend the
  fallback chain beyond Groq's own models.

## Instructions

Build the service layer in five ordered steps. Each step is one file under
`src/groq/`. The router depends on the registry; the middleware and fallback
depend on the client; the streaming pipeline stands alone. Full source for every
step (verbatim) is in [references/implementation.md](references/implementation.md).

1. **Model Registry** (`models.ts`) — declare a `ModelSpec` for each model with
   its tier, context window, speed, cost, and capabilities. Skeleton:

   ```typescript
   export const MODELS: Record<string, ModelSpec> = {
     "llama-3.1-8b-instant":     { tier: "speed",   /* fast, cheap */ },
     "llama-3.3-70b-versatile":  { tier: "quality", /* tools + JSON */ },
     "meta-llama/llama-4-scout-17b-16e-instruct": { tier: "vision" },
     "whisper-large-v3-turbo":   { tier: "audio" },
   };
   ```

2. **Model Router** (`router.ts`) — `selectModel(req)` maps requirements
   (`maxLatencyMs`, `needsVision`, `needsTools`, `costSensitive`) to the cheapest
   model that satisfies them. Callers pass requirements, never hardcoded ids.
3. **Middleware** (`middleware.ts`) — `completionWithMiddleware()` wraps each call
   with an LRU cache (deterministic requests only, `temperature === 0`), latency +
   token metrics, and a pluggable metrics sink.
4. **Fallback Chain** (`fallback.ts`) — `completionWithFallback()` tries the
   primary model, drops to a model in a different rate-limit pool on 429/5xx, then
   returns a graceful-degradation payload instead of throwing.
5. **Streaming Pipeline** (`streaming.ts`) — `streamCompletion()` is an async
   generator yielding `{ type: "token" | "done" | "error" }` for real-time SSE UIs.

When applying this to an existing repo, `Read` the current `src/` layout and
`Grep` for direct `groq.chat.completions.create` calls to find code that should
route through the middleware and fallback wrappers instead.

## Integration Patterns

| Pattern | When to Use | Groq Feature |
|---------|-------------|-------------|
| Direct completion | Simple request/response | `chat.completions.create` |
| Streaming SSE | Real-time chat UI | `stream: true` |
| Tool calling | Agent with function execution | `tools` parameter |
| JSON extraction | Structured data from text | `response_format: json_object` |
| Batch processing | High-volume document processing | Queue + rate limiting |
| Audio transcription | Voice input | `audio.transcriptions.create` |
| Vision analysis | Image understanding | Llama 4 Scout/Maverick |

## Output

Applying this skill produces a `src/groq/` service layer with six files
(`client.ts`, `models.ts`, `router.ts`, `middleware.ts`, `fallback.ts`,
`streaming.ts`) plus the service and API layers that consume it. At runtime you get:

- **Routed completions** — `selectModel()` returns a `ModelSpec`; callers never
  hardcode a model id, so cost/latency policy lives in one place.
- **Cached deterministic responses** — repeated `temperature: 0` calls return from
  the LRU cache instead of re-billing the API.
- **Resilient calls** — `completionWithFallback()` returns a valid completion shape
  even when Groq is rate-limited, never surfacing a raw 429 to the user.
- **Streamed tokens** — `streamCompletion()` yields `{ type, content }` events for
  SSE, with a terminal `done` or `error` event.
- **Metrics** — every call emits `{ model, latencyMs, tokens, cached }` to your
  metrics sink (Prometheus, Datadog, or `console.log` by default).

## Error Handling

| Issue | Cause | Solution |
|-------|-------|----------|
| 429 on primary model | RPM/TPM exceeded | Fall back to different model |
| High latency | Wrong model tier | Route to `8b-instant` for latency-critical paths |
| Context overflow | Input > 128K tokens | Truncate or chunk input |
| Vision errors | Wrong model for images | Use Llama 4 Scout full model path |
| `GROQ_API_KEY` undefined | Env var not exported | Export the key before starting the process |

## Examples

A latency-critical chat turn routes to the speed tier and returns one completion:

```typescript
const model = selectModel({ maxLatencyMs: 80, costSensitive: true });
// → llama

Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.

Install

Pinned to the audited commit 4f83675

Download folder ↗
git clone https://github.com/jeremylongshore/claude-code-plugins-plus-skills
git -C claude-code-plugins-plus-skills checkout 4f83675ca38a

The author documents no install command, so this uses the repository directly. Our verdict covers commit 4f83675ca38a only.

Works in which agents?

What its own text says, not a test

AgentStatusMore
Claude CodeMentioned in its text, not testedSkills for Claude Code · About Claude Code
“Mentioned” means the skill’s text names the agent. We have not run it there.

Audit history

Every audit, every source change

  1. ✓SAFE B 89 / 100

    first audit · source 4f83675ca38a

README badge

For maintainers · shows the latest audit

ModelsAtlas: SAFE BMODELSATLASSAFE · B
[![ModelsAtlas: SAFE B](https://modelsatlas.com/skills/jeremylongshore/groq-reference-architecture/badge.svg)](https://modelsatlas.com/skills/jeremylongshore/groq-reference-architecture/)

The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.

Similar skills

Add this badge to your README

[![ModelsAtlas: SAFE B](https://modelsatlas.com/skills/jeremylongshore/groq-reference-architecture/badge.svg)](https://modelsatlas.com/skills/jeremylongshore/groq-reference-architecture/)

Questions about Groq Reference Architecture

What does the Groq Reference Architecture skill do?
Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.
Is Groq Reference Architecture safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Groq Reference Architecture access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
Which assistants does Groq Reference Architecture work with?
Its documentation mentions claude-code. That is what the text claims, not a compatibility test we ran.
How current is this page?
The grade is for one exact copy of the source (4f83675ca38a), read on 2026-10-08. The repository is watched, and a new audit runs when it changes — this is the first audit.

Sources

Spotted something wrong? Report a correction · Methodology

Keep going in your AI

Opens with this page as the source. We add nothing else to the prompt.