---
title: providers
---

<div class="python-reference">
<a id="fastvideo.entrypoints.streaming.prompt.providers-classes"></a>
<a id="fastvideo.entrypoints.streaming.prompt.providers"></a>
<p>LLM provider implementations used by the prompt enhancer.</p>
<h2 id="fastvideo.entrypoints.streaming.prompt.providers.LLMMessage"><code>fastvideo.entrypoints.streaming.prompt.providers.LLMMessage</code></h2>
<pre class="doc-signature"><code>LLMMessage(role: Literal&#91;&#x27;system&#x27;, &#x27;user&#x27;, &#x27;assistant&#x27;&#93;, content: str)</code></pre>


<h2 id="fastvideo.entrypoints.streaming.prompt.providers.LLMProvider"><code>fastvideo.entrypoints.streaming.prompt.providers.LLMProvider</code></h2>
<pre class="doc-signature"><code>LLMProvider()</code></pre>
<p>Provider interface every LLM adapter implements.</p>
<p>Providers are async-first because every built-in implementation
talks to an HTTP API. Synchronous providers can wrap their call in
<code>asyncio.to_thread</code> internally.</p>
<h3 id="fastvideo.entrypoints.streaming.prompt.providers.LLMProvider.complete"><code>fastvideo.entrypoints.streaming.prompt.providers.LLMProvider.complete</code></h3>
<pre class="doc-signature"><code>complete(request: LLMRequest) -&gt; LLMResponse</code></pre>

<h2 id="fastvideo.entrypoints.streaming.prompt.providers.LLMProviderError"><code>fastvideo.entrypoints.streaming.prompt.providers.LLMProviderError</code></h2>
<pre class="doc-signature"><code>LLMProviderError(message: str, *, retryable: bool = True)</code></pre>
<p>Raised when an LLM provider fails a request.</p>
<p><code>retryable</code> controls whether the enhancer falls back to the next
provider. It is settable per-instance so the same exception type
can describe retryable transport errors (5xx, 429) and
non-retryable client errors (4xx auth/bad-request) without forcing
a separate subclass for every status family.</p>

<h2 id="fastvideo.entrypoints.streaming.prompt.providers.LLMRequest"><code>fastvideo.entrypoints.streaming.prompt.providers.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.LLMResponse"><code>fastvideo.entrypoints.streaming.prompt.providers.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.LLMTimeoutError"><code>fastvideo.entrypoints.streaming.prompt.providers.LLMTimeoutError</code></h2>
<pre class="doc-signature"><code>LLMTimeoutError(message: str)</code></pre>
<p>Raised when an LLM provider times out — always retryable.</p>

<h2 id="fastvideo.entrypoints.streaming.prompt.providers.CerebrasProvider"><code>fastvideo.entrypoints.streaming.prompt.providers.CerebrasProvider</code></h2>
<pre class="doc-signature"><code>CerebrasProvider(api_key: str | None = None, base_url: str = _DEFAULT_BASE_URL, name: str = &#x27;cerebras&#x27;)</code></pre>
<p>Cerebras inference adapter.</p>
<p><code>api_key</code> falls back to <code>CEREBRAS_API_KEY</code> when unset.</p>

<h3 id="fastvideo.entrypoints.streaming.prompt.providers.CerebrasProvider.complete"><code>fastvideo.entrypoints.streaming.prompt.providers.CerebrasProvider.complete</code></h3>
<pre class="doc-signature"><code>complete(request: LLMRequest) -&gt; LLMResponse</code></pre>

<h2 id="fastvideo.entrypoints.streaming.prompt.providers.GroqProvider"><code>fastvideo.entrypoints.streaming.prompt.providers.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>

<h3 id="fastvideo.entrypoints.streaming.prompt.providers.GroqProvider.complete"><code>fastvideo.entrypoints.streaming.prompt.providers.GroqProvider.complete</code></h3>
<pre class="doc-signature"><code>complete(request: LLMRequest) -&gt; LLMResponse</code></pre>

</div>

<h2>Submodules</h2>
<ul>
<li><a href="/FastVideo/api/fastvideo/entrypoints/streaming/prompt/providers/base">base</a></li>
<li><a href="/FastVideo/api/fastvideo/entrypoints/streaming/prompt/providers/cerebras">cerebras</a></li>
<li><a href="/FastVideo/api/fastvideo/entrypoints/streaming/prompt/providers/groq">groq</a></li>
</ul>
