groq-data-handling
БесплатноБез исполняемых скриптовНе проверенUse when you need to keep PII out of Groq API calls, filter model responses, audit-log conversations, or track token cost and usage for a Groq integration…
от jeremylongshore★ 2 961 звезда на GitHubОб этом скилле
Groq Data Handling
Overview
Manage data flowing through Groq's inference API. This skill wires a privacy pipeline around the Groq SDK: sanitize prompts before they are sent, filter responses after they return, redact PII, hash-log an audit trail, and track token usage and cost. Key fact: Groq does not use API data for model training (Groq Privacy Policy).
Prerequisites
- Node.js project with the
groq-sdkpackage installed (npm i groq-sdk). - A Groq API key exported as
GROQ_API_KEY. The SDK reads it automatically from the environment —new Groq()needs no explicit argument. Never hardcode the key; keep it in an untracked.envor your secret manager. - Node's built-in
cryptomodule (for the audit hash) — no install needed.
Instructions
The pipeline layers in four stages; drop simple add-ons (moderation, cost reporting) on top. Each snippet below is the skeleton — the full, copy-ready code for every stage is in references/implementation.md.
Sanitize input — run a PII rule table over every message before it leaves your process, flagging which categories were caught:
function sanitizeMessages(messages: any[]): { messages: any[]; hadPII: boolean } { // apply PII_RULES to each message's content; return redacted copy + flag }Wrap the completion call — call
safeCompletion(...)instead of the rawgroq.chat.completions.create, so input and response both pass the sanitizer.Track usage —
trackUsage(model, completion.usage, sessionId)records token counts and estimated cost per call using a per-model price table.Audit —
auditedCompletion(...)ties it together and logs a SHA-256 hash of the prompt (never the prompt text) so the audit trail carries no sensitive content.
For content moderation via Llama Guard and a daily cost report, see references/examples.md.
Groq data policy
- Groq does not train on API request/response data.
- Prompts and completions are processed and discarded.
- Groq may temporarily log requests for abuse prevention.
- For enterprise: contact Groq for DPA and SOC 2 compliance details.
Output
- Sanitized messages/responses — text with
[EMAIL],[PHONE],[SSN],[CARD],[IP]placeholders swapped in for detected PII, plus ahadPIIboolean and a list of redacted categories. - Usage records — one JSON line per call (
type: "groq_usage") with model, token counts, andestimatedCostUsd. - Audit entries — one JSON line per call (
type: "groq_audit") carrying a prompt hash,piiDetected,responseFiltered, and the usage record. - Cost report — an aggregated object with
totalCost,totalTokens,totalCalls, and a per-model breakdown (see the sample in references/examples.md).
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| PII leaks in response | Model echoes sensitive input | Apply response filtering on all completions |
| Cost spike | 70B model for all requests | Route simple tasks to 8B |
| Missing usage data | Streaming mode | Use non-streaming for tracked requests, or estimate |
| Audit gaps | Not all code paths use wrapper | Lint rule: ban direct groq.chat.completions.create |
GROQ_API_KEY not set |
Key missing from environment | Export the key before running; the SDK throws on an unauthenticated call |
Examples
- Full four-stage pipeline (sanitizer, safe wrapper, usage tracker, audited completion) — references/implementation.md.
- Content safety check with Llama Guard and a daily cost report — references/examples.md.
Minimal end-to-end use once the helpers are in place:
const { content, audit } = await auditedCompletion(sessionId, messages);
// content is PII-filtered; audit is a hash-only record safe to persist
Resources
For enterprise access controls, see the groq-enterprise-rbac skill.
Установить groq-data-handling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditВложенные файлы
FAQ
Что делает скилл groq-data-handling?
Use when you need to keep PII out of Groq API calls, filter model responses, audit-log conversations, or track token cost and usage for a Groq integration. Implements prompt sanitization, PII redaction, response filtering, and usage tracking. Trigger with phrases like "groq data", "groq PII", "groq GDPR", "groq data retention", "groq privacy", "groq compliance".
Как установить скилл groq-data-handling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл groq-data-handling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic