Optional
auth?: GroqAuthConfigAuthentication configuration for Groq. If not supplied, it will be loaded from the environment.
Optional
client?: HttpClient<THttpClientOptions>HTTP client to use for requests. If not supplied, the built-in fetch-based implementation will be used.
The model ID as defined by Groq
The Groq Model Provider with the OpenAiChatApi
If no auth is passed and GROQ_API_KEY is not found in process.env
import { createGroqModelProvider } from "generative-ts";
const llama3 = createGroqModelProvider({
modelId: "llama3-70b-8192",
});
const response = await llama3.sendRequest({ $prompt: "Brief History of NY Mets:" });
console.log(response.choices[0]?.message.content);
Creates a Groq ModelProvider with the OpenAiChatApi
Provider Setup and Notes
Create an API account at Groq
Obtain a Groq API key and either pass them explicitly in
auth
or set them in the environment asGROQ_API_KEY
Groq uses the OpenAI ChatCompletion API for all the models it hosts.
Model Parameters
Model IDs