Text generation
Generate text using a Groq-hosted language model.
AI Tools · Const
groq is the default Groq provider instance exported by @ai-sdk/groq. Use it with a model identifier to create a language model for AI SDK operations.
The groq provider is the default provider instance exported by @ai-sdk/groq. Pass a Groq model identifier to it to create a language model, then use that model with AI SDK functions such as generateText. For customized provider configuration, create another instance with createGroq.
groq(modelId)| Name | Type | Description |
|---|---|---|
modelId | string | The Groq model identifier, such as llama-3.3-70b-versatile. |
A Groq language model instance suitable for use with AI SDK model functions.
@ai-sdk/groq package.groq, a ready-to-use default provider instance.createGroq for constructing a customized provider instance.createGroq when the default provider instance does not match your configuration needs.import { groq } from '@ai-sdk/groq';
import { generateText } from 'ai';
const { text } = await generateText({
model: groq('llama-3.3-70b-versatile'),
prompt: 'Explain dependency injection in one sentence.',
});
console.log(text);Creates text with a Groq language model through the AI SDK.
Generate text using a Groq-hosted language model.
Use Groq models behind the AI SDK's common language-model interface.
Create a provider with custom settings instead of using the default instance.
@ai-sdk/groqcreateGroqgenerateTextGroq API