---
title: playground
---

<div class="python-reference">
<a id="fastvideo.entrypoints.openai.playground-functions"></a>
<a id="fastvideo.entrypoints.openai.playground"></a>
<p>Same-origin prompt UI for the H3 text-to-video/audio server.</p>
<h2 id="fastvideo.entrypoints.openai.playground.explicit_request_updates"><code>fastvideo.entrypoints.openai.playground.explicit_request_updates</code></h2>
<pre class="doc-signature"><code>explicit_request_updates(request: GenerationRequest) -&gt; dict&#91;str, Any&#93;</code></pre>
<p>Project a <code>GenerationRequest</code> down to <em>explicitly set</em> fields only.</p>
<p>Returns a flat kwargs dict suitable for merging into a generator call.
The projection uses <code>_fastvideo_explicit_paths</code> (populated during
<code>parse_config</code> / raw binding) so schema defaults on the dataclass
are <strong>not</strong> emitted — only paths the caller/operator actually wrote.</p>
<p>This is what makes <code>ServeConfig.default_request</code> work as an
operator-pinned baseline rather than a full override: a YAML with just
<code>sampling.seed: 42</code> yields <code>&#123;"seed": 42&#125;</code>, not the full sampling
config with its 15 schema defaults.</p>
<p>Precondition: the request must carry <code>_fastvideo_explicit_paths</code> —
populated by :func:<code>fastvideo.api.parser.parse_config</code> or
:func:<code>fastvideo.api.compat.normalize_generation_request</code>. Calling on
a raw <code>GenerationRequest()</code> asserts.</p>
<h2 id="fastvideo.entrypoints.openai.playground.get_default_request"><code>fastvideo.entrypoints.openai.playground.get_default_request</code></h2>
<pre class="doc-signature"><code>get_default_request() -&gt; GenerationRequest | None</code></pre>
<p>Return the ServeConfig.default_request set at startup, if any.</p>
<h2 id="fastvideo.entrypoints.openai.playground.get_served_model_name"><code>fastvideo.entrypoints.openai.playground.get_served_model_name</code></h2>
<pre class="doc-signature"><code>get_served_model_name() -&gt; str</code></pre>
<p>Return the public model id advertised by the OpenAI server.</p>
<h2 id="fastvideo.entrypoints.openai.playground.get_server_args"><code>fastvideo.entrypoints.openai.playground.get_server_args</code></h2>
<pre class="doc-signature"><code>get_server_args() -&gt; FastVideoArgs</code></pre>
<p>Return the global FastVideoArgs (set during startup).</p>
<h2 id="fastvideo.entrypoints.openai.playground.get_preset_selection"><code>fastvideo.entrypoints.openai.playground.get_preset_selection</code></h2>
<pre class="doc-signature"><code>get_preset_selection(model_path: str) -&gt; tuple&#91;str | None, str | None&#93;</code></pre>
<p>Return <code>(default_preset, model_family)</code> for a model path.</p>
<p>Single-lookup variant of :func:<code>get_default_preset</code> +
:func:<code>get_model_family</code>; callers that need both should prefer this
to avoid walking the registry twice.</p>
<h2 id="fastvideo.entrypoints.openai.playground.require_h3"><code>fastvideo.entrypoints.openai.playground.require_h3</code></h2>
<pre class="doc-signature"><code>require_h3() -&gt; None</code></pre>

<details><summary>Source</summary><pre><code>def require_h3() -&gt; None:
    args = get_server_args()
    _, family = get_preset_selection(args.model_path)
    override = getattr(args, &quot;override_pipeline_cls_name&quot;, None)
    if family != &quot;minimax_h3&quot; or (override and override != &quot;MiniMaxH3ModularPipeline&quot;):
        raise HTTPException(status_code=404, detail=&quot;The playground requires an H3 text-to-video/audio server.&quot;)</code></pre></details>
<h2 id="fastvideo.entrypoints.openai.playground.playground"><code>fastvideo.entrypoints.openai.playground.playground</code></h2>
<pre class="doc-signature"><code>playground() -&gt; FileResponse</code></pre>

<details><summary>Source</summary><pre><code>@router.get(&quot;/&quot;)
async def playground() -&gt; FileResponse:
    return FileResponse(ASSETS / &quot;playground.html&quot;, headers=HEADERS)</code></pre></details>
<h2 id="fastvideo.entrypoints.openai.playground.playground_config"><code>fastvideo.entrypoints.openai.playground.playground_config</code></h2>
<pre class="doc-signature"><code>playground_config(raw_request: Request) -&gt; dict</code></pre>

<details><summary>Source</summary><pre><code>@router.get(&quot;/config&quot;)
async def playground_config(raw_request: Request) -&gt; dict:
    request = get_default_request()
    # Report operator defaults only; do not guess model presets or hardware.
    sampling = explicit_request_updates(request) if request is not None else &#123;&#125;
    fields = (&quot;width&quot;, &quot;height&quot;, &quot;num_frames&quot;, &quot;fps&quot;, &quot;seed&quot;)
    return &#123;
        &quot;model&quot;: get_served_model_name(),
        &quot;runtime&quot;: raw_request.app.state.runtime,
        &quot;defaults&quot;: &#123;
            field: sampling.get(field)
            for field in fields
        &#125;,
    &#125;</code></pre></details>
<h2 id="fastvideo.entrypoints.openai.playground.playground_asset"><code>fastvideo.entrypoints.openai.playground.playground_asset</code></h2>
<pre class="doc-signature"><code>playground_asset(asset: str) -&gt; FileResponse</code></pre>

<details><summary>Source</summary><pre><code>@router.get(&quot;/&#123;asset&#125;&quot;)
async def playground_asset(asset: str) -&gt; FileResponse:
    if asset not in &#123;&quot;playground.css&quot;, &quot;playground.js&quot;&#125;:
        raise HTTPException(status_code=404, detail=&quot;Playground asset not found.&quot;)
    return FileResponse(ASSETS / asset, headers=HEADERS)</code></pre></details>
</div>
