Documentation
¶
Overview ¶
Package groq wraps Groq's OpenAI-compatible API. Groq runs open- weight models (Llama, Gemma, DeepSeek, Kimi) on its in-house LPUs at extremely high throughput.
Groq-specific knobs reachable through the namespaced OpenAI request extension:
- service_tier ("on_demand" / "flex" / "auto") trades cost for latency. See https://console.groq.com/docs/flex-processing.
- reasoning_format ("parsed" / "raw" / "hidden") controls how reasoning-model output is surfaced.
See https://console.groq.com/docs/ for the full API reference.
Index ¶
Constants ¶
const ( OpenAIRequestExtensionKey = "groq/openai_request" OpenAIResponseExtensionKey = "groq/openai_response" OpenAIStreamChunkExtensionKey = "groq/openai_stream_chunk" )
Namespacing preserves provider-specific data without promoting it into the shared Core protocol or colliding with another provider.
const ( Provider = "Groq" BaseURL = "https://api.groq.com/openai/v1" )
Exported identifiers keep provider-owned names and defaults out of caller literals.
const ( ModelGPTOSS120B = "openai/gpt-oss-120b" ModelGPTOSS20B = "openai/gpt-oss-20b" ModelQwen36_27B = "qwen/qwen3.6-27b" )
Current production model ids. See https://console.groq.com/docs/models.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶ added in v0.13.0
type Chat = openai.ChatCompletions
Chat implements Groq's chat endpoint.
func NewChat ¶ added in v0.13.0
func NewChat(config ChatConfig) (*Chat, error)
NewChat rejects an invalid provider binding before the first chat call.
type ChatConfig ¶ added in v0.13.0
type ChatConfig struct {
APIKey string
DefaultOptions corechat.Options
BaseURL string
HTTPClient *http.Client
}
ChatConfig binds provider access and defaults shared by every chat call.
func (ChatConfig) Validate ¶ added in v0.13.0
func (c ChatConfig) Validate() error