Skip to content

feat(providers): add Groq direct API support - #978

Merged
Astro-Han merged 1 commit into
apache:mainfrom
Colafornia:feat/add-groq-provider
Jul 14, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
Colafornia:feat/add-groq-provider

Conversation

@Colafornia

@Colafornia Colafornia commented Jul 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds groq (Groq's OpenAI-compatible LPU API), part of #860 Phase 3.

Most wiring mirrors DeepInfra (#917); below are only the parts that diverge or carry risk.

Review focus

  • Reasoning knob is per-model. Groq accepts reasoning_effort only for gpt-oss-120b / gpt-oss-20b, values low / medium / high — no none (docs). Only those two get thinkingOptions in model-metadata.ts; all others (incl. the default llama-3.3-70b-versatile) get none, so buildProviderOptions never sends the wire to an unsupported model and never sends none to gpt-oss.

  • No per-provider model exclusion. gpt-oss-safeguard-20b is a moderation model but models.dev marks it functionCalling: true, so it stays in the fallback list — same as Vercel ships it; no Groq-local exclusion. Default stays llama-3.3-70b-versatile (recommended-first, build-time asserted), so safeguard can't become the default.

Register the `groq` provider for Groq's OpenAI-compatible LPU API
(https://api.groq.com/openai/v1), mirroring the DeepInfra direct-API
contract: api-key auth, protocol openai, openai-compatible runtime,
protocol model discovery with the fallback-models filter, exact
upstream model ids (no rewriting).

- Registry entry with default `llama-3.3-70b-versatile` (recommended-
  first ordering keeps it at fallbackModels[0]); 7 tool-capable models
  from the models.dev snapshot, consistent with every other provider
  (Vercel ships the same `gpt-oss-safeguard-20b`), so Groq uses no
  special-case exclusion mechanism.
- Reasoning knob wired per Groq docs: gpt-oss-120b/20b accept
  reasoning_effort low/medium/high (no `none`); other models get no
  knob. Shared non-off effort branch in buildProviderOptions.
- Credential env GROQ_API_KEY / _FILE / _BASE_URL.
- Vendored Lobe Icons monochrome groq.svg (MIT) with a byte-exact
  SHA-256 governance test.
- Full test coverage across core/runtime/headless/storage/cli/desktop.

Part of apache#860 (Phase 3 — Groq).

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independently reviewed. The two-stage tool loop, reasoning_effort gating, and credentials/discovery all verify. One non-blocking follow-up: consider replayAssistantReasoningAs: 'reasoning' (plus a round-1 reasoning fixture) for symmetry with the Groq response wire — sibling gpt-oss gateways (HF/DeepInfra) ship flagless too, so mirroring DeepInfra is legitimate as-is. Approving.

@Astro-Han
Astro-Han merged commit 10e2f05 into apache:main Jul 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants