Repository navigation
feat(providers): add Groq direct API support - #978
Merged
Merged
Conversation
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
approved these changes
Jul 14, 2026
Astro-Han
left a comment
Contributor
There was a problem hiding this comment.
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.
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_effortonly forgpt-oss-120b/gpt-oss-20b, valueslow/medium/high— nonone(docs). Only those two getthinkingOptionsinmodel-metadata.ts; all others (incl. the defaultllama-3.3-70b-versatile) get none, sobuildProviderOptionsnever sends the wire to an unsupported model and never sendsnoneto gpt-oss.No per-provider model exclusion.
gpt-oss-safeguard-20bis a moderation model but models.dev marks itfunctionCalling: true, so it stays in the fallback list — same as Vercel ships it; no Groq-local exclusion. Default staysllama-3.3-70b-versatile(recommended-first, build-time asserted), so safeguard can't become the default.