npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@standardagents/groq

v0.13.2

Published

Groq provider for Standard Agents

Readme

@standardagents/groq

Groq provider for Standard Agents.

This package wraps Groq's Chat Completions API behind the Standard Agents provider interface. It supports:

  • model discovery
  • Standard Agents message transformation to Groq chat payloads
  • streaming and non-streaming generation
  • local function tool calling on Groq models that support it
  • reasoning controls on supported reasoning models
  • Groq usage and cost calculation

Install

npm install @standardagents/groq @standardagents/spec

Usage

import { groq } from '@standardagents/groq';

const provider = groq({
  apiKey: process.env.GROQ_API_KEY!,
});

const result = await provider.generate({
  model: 'llama-3.3-70b-versatile',
  messages: [
    { role: 'user', content: 'Give me three short product name ideas.' },
  ],
});

console.log(result.content);
console.log(result.usage?.cost);

Factory

The package exports:

  • groq(config) - provider factory
  • GroqProvider - provider class
  • groqProviderOptions - Zod schema for provider-specific options

Factory config:

type ProviderFactoryConfig = {
  apiKey: string;
  baseUrl?: string;
  timeout?: number;
};

Supported Features

Feature support is model-specific.

Typical supported capabilities include:

  • streaming text generation
  • JSON mode on supported chat models
  • local function tool calling on supported models
  • reasoning controls on supported reasoning models

Inspect the live model list and capabilities:

const models = await provider.getModels?.();
const capabilities = await provider.getModelCapabilities?.('openai/gpt-oss-120b');

Tool Calling Notes

This package only sends Standard Agents local tools to Groq models that support local/custom tool calling.

Important edge case:

  • compound-beta and compound-beta-mini support Groq built-in/server-side tools, but not Standard Agents custom function tools
  • this provider therefore strips local tools for Compound models instead of forwarding unsupported tool definitions

If you need Standard Agents function tools, use one of the normal Groq function-calling models instead of Compound.

Reasoning Controls

The provider only sends reasoning_format, include_reasoning, and reasoning_effort when the target model is known to support Groq reasoning controls.

This avoids hard failures like:

  • reasoning_format is not supported with this model

Provider Options

Common Groq-specific provider options:

  • citation_options
  • disable_tool_validation
  • include_reasoning
  • reasoning_effort
  • reasoning_format
  • service_tier
  • search_settings
  • compound_custom
  • documents

Example:

const result = await provider.generate({
  model: 'openai/gpt-oss-120b',
  messages: [{ role: 'user', content: 'Solve this carefully.' }],
  providerOptions: {
    reasoning_format: 'parsed',
    reasoning_effort: 'high',
    service_tier: 'performance',
  },
});

Icons

getIcon(modelId?) returns either the Groq provider icon or a model-lab icon derived from the model identifier when possible, such as:

  • openai/gpt-oss-120b -> OpenAI icon
  • qwen/qwen3-32b -> Qwen icon
  • llama-* -> Meta icon
  • gemma* -> Google icon

Debugging

Use inspectRequest() to see the final Groq-native request body after model-specific transforms are applied:

const inspected = await provider.inspectRequest?.({
  model: 'llama-3.1-8b-instant',
  messages: [{ role: 'user', content: 'hello' }],
});

console.log(inspected?.body);