Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

AI Tools · Const

Groq

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.

How it works

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.

Syntax

groq(modelId)

Parameters

NameTypeDescription
modelIdstringThe Groq model identifier, such as llama-3.3-70b-versatile.

Returns

A Groq language model instance suitable for use with AI SDK model functions.

Key points

  • Groq provides language models that can be used through the AI SDK's standardized model interface.
  • Install and import the provider from the dedicated @ai-sdk/groq package.
  • The package exports groq, a ready-to-use default provider instance.
  • The package also exposes createGroq for constructing a customized provider instance.

Common mistakes

  • Use createGroq when the default provider instance does not match your configuration needs.

Example: Generate text with Groq

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.

When to use it

Text generation

Generate text using a Groq-hosted language model.

Provider abstraction

Use Groq models behind the AI SDK's common language-model interface.

Custom configuration

Create a provider with custom settings instead of using the default instance.

  • @ai-sdk/groq
  • createGroq
  • generateText
  • Groq API

Source: Groq Provider. Checked 2026-10-15.