Integrations / Groq
To trace Groq with Tracify, wrap the Groq client with the Tracify SDK. Its chat.completions calls are recorded with the model, tokens, latency and any error. The OpenAI client pointed at Groq works the same way.
Your code
Groq
Tracify
One run.
Setup
Use Groq's own library, or the OpenAI one if you prefer.
pip install tracify-sdk groqCreate a project in Tracify, copy its API key and put it in the environment where your code runs. The SDK reads it from there, so nothing is hard-coded.
export TRACIFY_API_KEY="tracify_sk_live_..."Groq's library has the same chat.completions shape as OpenAI's, so the OpenAI wrapper records it. GROQ_API_KEY is read by Groq's library as usual.
import tracify
from groq import Groq
groq = tracify.wrap_openai(Groq())
reply = groq.chat.completions.create(
model="llama-3.3-70b-versatile",
messages=[{"role": "user", "content": "Hello"}],
)Point the OpenAI library at Groq's compatible endpoint. In TypeScript this is the simplest route.
import OpenAI from "openai";
import { wrapOpenAI } from "tracify-sdk";
const groq = wrapOpenAI(
new OpenAI({
apiKey: process.env.GROQ_API_KEY,
baseURL: "https://api.groq.com/openai/v1",
}),
);
const reply = await groq.chat.completions.create({
model: "llama-3.3-70b-versatile",
messages: [{ role: "user", content: "Hello" }],
});Run your code one time, then open the Tracing page of your project. Your Groq call shows up as a run with its steps in order, plus the tokens, time and any error for each call.
Good to know
The wrapper reads the OpenAI call format, so calls are labeled as OpenAI-style in the trace. The model name you send is always the one shown, so you can still tell models apart.
Good to know
Groq is quick, so agents tend to make many calls. In the run you can see every call in order with its time, which makes slow tool steps stand out.
Good to know
Tracify records the tokens the provider returns. A dollar cost is shown when you give the wrapper your own rates with calculate_cost (Python) or calculateCost (TypeScript), so the number always matches your real price plan.
Full details in the documentation. All integrations are listed on the integrations page.
