Groq
Ultra-fast LPU inference — OpenAI-compatible chat, vision, speech-to-text/TTS, JSON mode, and batch.
Overview
Groq serves open models on its custom LPU (Language Processing Unit) hardware, delivering extremely low latency and high throughput through an OpenAI-compatible API.
Official Website: https://groq.com API Documentation: https://console.groq.com/docs
Key features
- Ultra-fast inference — LPU-accelerated for minimal latency
- High throughput — well-suited to real-time and interactive applications
- Chat — OpenAI-compatible text generation with function calling
- Vision — image understanding
- Speech — speech-to-text and text-to-speech
- JSON mode — structured, schema-constrained outputs
- Batch — asynchronous bulk processing
Using Groq with Yunxin
Address Groq models by prefixing the model id with the groq slug — groq/<model>. You always call the same Yunxin base URL, https://api.yuhuanstudio.com/v1, with your sk- API key; Yunxin routes the request to Groq.
Usage example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["YUNXIN_API_KEY"],
base_url="https://api.yuhuanstudio.com/v1",
)
response = client.chat.completions.create(
model="groq/model-id",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"},
],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.YUNXIN_API_KEY,
baseURL: "https://api.yuhuanstudio.com/v1",
});
const response = await client.chat.completions.create({
model: "groq/model-id",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Hello!" },
],
});
console.log(response.choices[0].message.content);curl https://api.yuhuanstudio.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YUNXIN_API_KEY" \
-d '{
"model": "groq/model-id",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
}'Available models
List the models currently available for this provider:
curl "https://api.yuhuanstudio.com/v1/models?provider=groq" \
-H "Authorization: Bearer $YUNXIN_API_KEY"Capabilities and pricing are per-model. Use the Models API to discover which Groq models are available and what each one supports.
Official resources
How is this guide?