---
title: groq
---

<div class="python-reference">
<a id="fastvideo.entrypoints.streaming.prompt.providers.groq-classes"></a>
<a id="fastvideo.entrypoints.streaming.prompt.providers.groq-functions"></a>
<a id="fastvideo.entrypoints.streaming.prompt.providers.groq"></a>
<p>Groq LLM provider (OpenAI-compatible chat endpoint).</p>
<h2 id="fastvideo.entrypoints.streaming.prompt.providers.groq.complete_openai_compatible"><code>fastvideo.entrypoints.streaming.prompt.providers.groq.complete_openai_compatible</code></h2>
<pre class="doc-signature"><code>complete_openai_compatible(*, api_key: str | None, api_key_hint: str, base_url: str, provider_name: str, request: LLMRequest) -&gt; LLMResponse</code></pre>
<p>Issue a chat-completions call and decode the OpenAI response.</p>
<h2 id="fastvideo.entrypoints.streaming.prompt.providers.groq.LLMRequest"><code>fastvideo.entrypoints.streaming.prompt.providers.groq.LLMRequest</code></h2>
<pre class="doc-signature"><code>LLMRequest(messages: list&#91;LLMMessage&#93;, model: str, max_tokens: int | None = None, temperature: float | None = None, timeout_ms: int | None = None)</code></pre>


<h2 id="fastvideo.entrypoints.streaming.prompt.providers.groq.LLMResponse"><code>fastvideo.entrypoints.streaming.prompt.providers.groq.LLMResponse</code></h2>
<pre class="doc-signature"><code>LLMResponse(content: str, provider: str, model: str, latency_ms: float, fallback_used: bool = False)</code></pre>


<h2 id="fastvideo.entrypoints.streaming.prompt.providers.groq.GroqProvider"><code>fastvideo.entrypoints.streaming.prompt.providers.groq.GroqProvider</code></h2>
<pre class="doc-signature"><code>GroqProvider(api_key: str | None = None, base_url: str = _DEFAULT_BASE_URL, name: str = &#x27;groq&#x27;)</code></pre>
<p>Groq inference adapter.</p>
<p>Identical wire format to :class:<code>CerebrasProvider</code>; both go through
:func:<code>complete_openai_compatible</code>. The two providers differ only
in base URL, env var, and model id conventions.</p>

<details><summary>Source</summary><pre><code>@dataclass
class GroqProvider:
    &quot;&quot;&quot;Groq inference adapter.

    Identical wire format to :class:`CerebrasProvider`; both go through
    :func:`complete_openai_compatible`. The two providers differ only
    in base URL, env var, and model id conventions.
    &quot;&quot;&quot;

    api_key: str | None = None
    base_url: str = _DEFAULT_BASE_URL
    name: str = &quot;groq&quot;

    def __post_init__(self) -&gt; None:
        if self.api_key is None:
            self.api_key = os.environ.get(_API_KEY_ENV)

    async def complete(self, request: LLMRequest) -&gt; LLMResponse:
        return await complete_openai_compatible(
            api_key=self.api_key,
            api_key_hint=_API_KEY_ENV,
            base_url=self.base_url,
            provider_name=self.name,
            request=request,
        )</code></pre></details>
<h3 id="fastvideo.entrypoints.streaming.prompt.providers.groq.GroqProvider.complete"><code>fastvideo.entrypoints.streaming.prompt.providers.groq.GroqProvider.complete</code></h3>
<pre class="doc-signature"><code>complete(request: LLMRequest) -&gt; LLMResponse</code></pre>

<details><summary>Source</summary><pre><code>async def complete(self, request: LLMRequest) -&gt; LLMResponse:
    return await complete_openai_compatible(
        api_key=self.api_key,
        api_key_hint=_API_KEY_ENV,
        base_url=self.base_url,
        provider_name=self.name,
        request=request,
    )</code></pre></details>
</div>
