> ## Documentation Index
> Fetch the complete documentation index at: https://runinfra.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployments overview

> What happens after an optimization run: a live OpenAI-compatible endpoint you call, or a kit you run on your own hardware.

An optimization run ends in one of two ways. Either RunInfra runs the winning configuration for you as a live endpoint, or you download a kit and run the same configuration yourself.

## Deploy the winner

Your optimization session leaves behind a **pipeline**: the saved setup, holding the model, the settings that won, and the measurements behind them. Deploying turns that into a live endpoint.

<Tabs>
  <Tab title="From chat">
    ```text theme={"dark"}
    Deploy this pipeline
    ```

    The agent picks the winning candidate, provisions a GPU, and returns the endpoint URL and key.
  </Tab>

  <Tab title="From the Deploy tab">
    Select **Deploy**, then pick the variant and the mode. Provisioning takes 1 to 3 minutes on the first deploy.
  </Tab>
</Tabs>

RunInfra deploys the exact artifact the selected pipeline version produced: its files, model revision, serving backend, and optimization settings. A missing or stale artifact snapshot is rejected before provisioning rather than replaced with a generic build, so a deployment cannot silently lose the optimization you chose.

## Call the endpoint

The endpoint is OpenAI-compatible. Point any OpenAI client at the RunInfra base URL with your key and the model id the deployment serves.

Set `MODEL_ID` to your deployed model's id from `GET /v1/models` before running these examples.

<CodeGroup>
  ```python Python theme={"dark"}
  import os
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.runinfra.ai/v1",
      api_key=os.environ["RUNINFRA_GATEWAY_KEY"],
  )

  response = client.chat.completions.create(
      model=os.environ["MODEL_ID"],
      messages=[{"role": "user", "content": "Hello"}],
  )
  print(response.choices[0].message.content)
  ```

  ```typescript TypeScript theme={"dark"}
  import OpenAI from "openai";

  const modelId = process.env.MODEL_ID;
  if (!modelId) throw new Error("Set MODEL_ID to your deployed model's id.");

  const client = new OpenAI({
    baseURL: "https://api.runinfra.ai/v1",
    apiKey: process.env.RUNINFRA_GATEWAY_KEY,
  });

  const response = await client.chat.completions.create({
    model: modelId,
    messages: [{ role: "user", content: "Hello" }],
  });
  console.log(response.choices[0].message.content);
  ```

  ```bash cURL theme={"dark"}
  curl https://api.runinfra.ai/v1/chat/completions \
    -H "Authorization: Bearer $RUNINFRA_GATEWAY_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"model\":\"$MODEL_ID\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}"
  ```
</CodeGroup>

`GET /v1/models` lists the deployed models your key can reach. See [OpenAI compatibility](/docs/tools-sdks/openai-compatibility) for the full contract, and this is the order every request passes through:

<div className="block dark:hidden">
  <svg viewBox="0 0 720 582" width="100%" role="img" aria-label="The eight ordered gates of a Model APIs request, each with the status and error code it refuses with, ending in a funded response." fill="none" xmlns="http://www.w3.org/2000/svg"><text x="48" y="16" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">Request lifecycle</text><text x="696" y="16" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="end">POST /v1/chat/completions</text><line x1="26" y1="24" x2="26" y2="538" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="23.5" y="51.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="54" x2="48" y2="54" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="30.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="49" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">01 Size</text><text x="124" y="49" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Body size gate</text><text x="62" y="66" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Encoded JSON over 3.5MB is refused before auth runs</text><line x1="412" y1="54" x2="426" y2="54" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="49" width="5" height="5" fill="#b95f5f" shapeRendering="crispEdges" /><text x="448" y="57" fill="#953b3b" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">413</text><text x="512" y="57" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">payload\_too\_large</text><rect x="23.5" y="113.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="116" x2="48" y2="116" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="92.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="111" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">02 Auth</text><text x="124" y="111" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Authentication</text><text x="62" y="128" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Bearer workspace key; expired or deactivated keys refused</text><line x1="412" y1="116" x2="426" y2="116" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="105" width="5" height="5" fill="#b95f5f" shapeRendering="crispEdges" /><text x="448" y="113" fill="#953b3b" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">401</text><text x="512" y="113" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">invalid\_api\_key</text><rect x="436" y="121" width="5" height="5" fill="#b95f5f" shapeRendering="crispEdges" /><text x="448" y="129" fill="#953b3b" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">403</text><text x="512" y="129" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">auth\_error</text><rect x="23.5" y="175.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="178" x2="48" y2="178" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="154.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="173" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">03 Rate</text><text x="124" y="173" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Key rate limit</text><text x="62" y="190" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">The key's requests-per-minute budget, X-RateLimit headers</text><line x1="412" y1="178" x2="426" y2="178" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="173" width="5" height="5" fill="#b07f24" shapeRendering="crispEdges" /><text x="448" y="181" fill="#82601e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">429</text><text x="512" y="181" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">rate\_limit\_exceeded</text><rect x="23.5" y="237.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="240" x2="48" y2="240" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="216.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="235" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">04 Model</text><text x="124" y="235" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Model resolve</text><text x="62" y="252" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">The id must resolve to a model your key can reach</text><line x1="412" y1="240" x2="426" y2="240" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="229" width="5" height="5" fill="#b95f5f" shapeRendering="crispEdges" /><text x="448" y="237" fill="#953b3b" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">404</text><text x="512" y="237" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">model\_not\_found</text><rect x="436" y="245" width="5" height="5" fill="#b07f24" shapeRendering="crispEdges" /><text x="448" y="253" fill="#82601e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">503</text><text x="512" y="253" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">hosted\_model\_paused</text><rect x="23.5" y="299.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="302" x2="48" y2="302" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="278.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="297" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">05 Shape</text><text x="124" y="297" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Validation</text><text x="62" y="314" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Capabilities, parameters, output budget across choices</text><line x1="412" y1="302" x2="426" y2="302" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="297" width="5" height="5" fill="#b07f24" shapeRendering="crispEdges" /><text x="448" y="305" fill="#82601e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">400</text><text x="512" y="305" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">hosted\_capability\_not\_supported</text><rect x="23.5" y="361.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="364" x2="48" y2="364" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="340.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="359" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">06 Admit</text><text x="124" y="359" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Admission</text><text x="62" y="376" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Concurrency and token-rate leases: key, workspace, model</text><line x1="412" y1="364" x2="426" y2="364" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="359" width="5" height="5" fill="#b07f24" shapeRendering="crispEdges" /><text x="448" y="367" fill="#82601e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">429</text><text x="512" y="367" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">hosted\_\*\_limit</text><rect x="23.5" y="423.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="426" x2="48" y2="426" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="402.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="421" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">07 Funds</text><text x="124" y="421" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Funding decision</text><text x="62" y="438" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Plan, credits, or Standby must admit the request</text><line x1="412" y1="426" x2="426" y2="426" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="415" width="5" height="5" fill="#b95f5f" shapeRendering="crispEdges" /><text x="448" y="423" fill="#953b3b" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">402</text><text x="512" y="423" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">insufficient\_credits</text><rect x="436" y="431" width="5" height="5" fill="#b95f5f" shapeRendering="crispEdges" /><text x="448" y="439" fill="#953b3b" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">402</text><text x="512" y="439" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">plan\_limit\_reached</text><rect x="23.5" y="485.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="488" x2="48" y2="488" stroke="#e8e8e3" strokeWidth="1" /><rect x="48.5" y="464.5" width="363" height="47" fill="#ffffff" stroke="#e8e8e3" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="483" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">08 Serve</text><text x="124" y="483" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Serving</text><text x="62" y="500" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">A connection failure before any output is retried for you</text><line x1="412" y1="488" x2="426" y2="488" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="483" width="5" height="5" fill="#b95f5f" shapeRendering="crispEdges" /><text x="448" y="491" fill="#953b3b" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">502/504</text><text x="512" y="491" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">upstream\_error</text><rect x="23.5" y="539.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="29" y1="542" x2="48" y2="542" stroke="#e8e8e3" strokeWidth="1" /><rect x="48" y="527" width="118" height="3" fill="#76b900" shapeRendering="crispEdges" /><rect x="48" y="530" width="128" height="24" fill="#76b900" shapeRendering="crispEdges" /><rect x="58" y="554" width="118" height="3" fill="#76b900" shapeRendering="crispEdges" /><text x="112" y="546" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12" fontWeight="500" textAnchor="middle" letterSpacing="-0.12">Response</text><text x="192" y="545" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Billed from the usage the response reports, settled after the response.</text><text x="192" y="560" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">A refused request is never billed.</text></svg>
</div>

<div className="hidden dark:block">
  <svg viewBox="0 0 720 582" width="100%" role="img" aria-label="The eight ordered gates of a Model APIs request, each with the status and error code it refuses with, ending in a funded response." fill="none" xmlns="http://www.w3.org/2000/svg"><text x="48" y="16" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">Request lifecycle</text><text x="696" y="16" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="end">POST /v1/chat/completions</text><line x1="26" y1="24" x2="26" y2="538" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="23.5" y="51.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="54" x2="48" y2="54" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="30.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="49" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">01 Size</text><text x="124" y="49" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Body size gate</text><text x="62" y="66" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Encoded JSON over 3.5MB is refused before auth runs</text><line x1="412" y1="54" x2="426" y2="54" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="49" width="5" height="5" fill="#c76f6f" shapeRendering="crispEdges" /><text x="448" y="57" fill="#c76f6f" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">413</text><text x="512" y="57" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">payload\_too\_large</text><rect x="23.5" y="113.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="116" x2="48" y2="116" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="92.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="111" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">02 Auth</text><text x="124" y="111" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Authentication</text><text x="62" y="128" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Bearer workspace key; expired or deactivated keys refused</text><line x1="412" y1="116" x2="426" y2="116" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="105" width="5" height="5" fill="#c76f6f" shapeRendering="crispEdges" /><text x="448" y="113" fill="#c76f6f" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">401</text><text x="512" y="113" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">invalid\_api\_key</text><rect x="436" y="121" width="5" height="5" fill="#c76f6f" shapeRendering="crispEdges" /><text x="448" y="129" fill="#c76f6f" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">403</text><text x="512" y="129" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">auth\_error</text><rect x="23.5" y="175.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="178" x2="48" y2="178" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="154.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="173" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">03 Rate</text><text x="124" y="173" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Key rate limit</text><text x="62" y="190" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">The key's requests-per-minute budget, X-RateLimit headers</text><line x1="412" y1="178" x2="426" y2="178" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="173" width="5" height="5" fill="#d9a64a" shapeRendering="crispEdges" /><text x="448" y="181" fill="#d9a64a" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">429</text><text x="512" y="181" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">rate\_limit\_exceeded</text><rect x="23.5" y="237.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="240" x2="48" y2="240" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="216.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="235" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">04 Model</text><text x="124" y="235" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Model resolve</text><text x="62" y="252" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">The id must resolve to a model your key can reach</text><line x1="412" y1="240" x2="426" y2="240" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="229" width="5" height="5" fill="#c76f6f" shapeRendering="crispEdges" /><text x="448" y="237" fill="#c76f6f" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">404</text><text x="512" y="237" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">model\_not\_found</text><rect x="436" y="245" width="5" height="5" fill="#d9a64a" shapeRendering="crispEdges" /><text x="448" y="253" fill="#d9a64a" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">503</text><text x="512" y="253" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">hosted\_model\_paused</text><rect x="23.5" y="299.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="302" x2="48" y2="302" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="278.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="297" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">05 Shape</text><text x="124" y="297" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Validation</text><text x="62" y="314" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Capabilities, parameters, output budget across choices</text><line x1="412" y1="302" x2="426" y2="302" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="297" width="5" height="5" fill="#d9a64a" shapeRendering="crispEdges" /><text x="448" y="305" fill="#d9a64a" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">400</text><text x="512" y="305" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">hosted\_capability\_not\_supported</text><rect x="23.5" y="361.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="364" x2="48" y2="364" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="340.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="359" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">06 Admit</text><text x="124" y="359" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Admission</text><text x="62" y="376" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Concurrency and token-rate leases: key, workspace, model</text><line x1="412" y1="364" x2="426" y2="364" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="359" width="5" height="5" fill="#d9a64a" shapeRendering="crispEdges" /><text x="448" y="367" fill="#d9a64a" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">429</text><text x="512" y="367" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">hosted\_\*\_limit</text><rect x="23.5" y="423.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="426" x2="48" y2="426" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="402.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="421" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">07 Funds</text><text x="124" y="421" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Funding decision</text><text x="62" y="438" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Plan, credits, or Standby must admit the request</text><line x1="412" y1="426" x2="426" y2="426" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="415" width="5" height="5" fill="#c76f6f" shapeRendering="crispEdges" /><text x="448" y="423" fill="#c76f6f" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">402</text><text x="512" y="423" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">insufficient\_credits</text><rect x="436" y="431" width="5" height="5" fill="#c76f6f" shapeRendering="crispEdges" /><text x="448" y="439" fill="#c76f6f" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">402</text><text x="512" y="439" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">plan\_limit\_reached</text><rect x="23.5" y="485.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="488" x2="48" y2="488" stroke="#383833" strokeWidth="1" /><rect x="48.5" y="464.5" width="363" height="47" fill="#161614" stroke="#383833" strokeWidth="1" shapeRendering="crispEdges" /><text x="62" y="483" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">08 Serve</text><text x="124" y="483" fill="#f0efe2" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12.5" fontWeight="500" letterSpacing="-0.12">Serving</text><text x="62" y="500" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">A connection failure before any output is retried for you</text><line x1="412" y1="488" x2="426" y2="488" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="436" y="483" width="5" height="5" fill="#c76f6f" shapeRendering="crispEdges" /><text x="448" y="491" fill="#c76f6f" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">502/504</text><text x="512" y="491" fill="#9a998e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0">upstream\_error</text><rect x="23.5" y="539.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="29" y1="542" x2="48" y2="542" stroke="#383833" strokeWidth="1" /><rect x="48" y="527" width="118" height="3" fill="#76b900" shapeRendering="crispEdges" /><rect x="48" y="530" width="128" height="24" fill="#76b900" shapeRendering="crispEdges" /><rect x="58" y="554" width="118" height="3" fill="#76b900" shapeRendering="crispEdges" /><text x="112" y="546" fill="#0f0f0e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="12" fontWeight="500" textAnchor="middle" letterSpacing="-0.12">Response</text><text x="192" y="545" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Billed from the usage the response reports, settled after the response.</text><text x="192" y="560" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">A refused request is never billed.</text></svg>
</div>

## Two modes

<Tabs>
  <Tab title="Flex">
    Scale-to-zero. Replicas shed after 5 idle minutes and spin back up on the next request.

    | Property | Value |
    | - | - |
    | Cost | Per-token only, nothing while idle |
    | Idle timeout | 5 minutes of no traffic |
    | Best for | Development, bursty traffic, cost-sensitive workloads |
  </Tab>

  <Tab title="Active">
    Always-on. Replicas stay warm, so no request pays a cold start.

    | Property | Value |
    | - | - |
    | Cost | Per-token rate plus an hourly fee per warm replica |
    | Cold start | None |
    | Best for | Production APIs with latency commitments |
  </Tab>
</Tabs>

<div className="block dark:hidden">
  <svg viewBox="0 0 720 194" width="100%" role="img" aria-label="A Flex deployment takes 1 to 3 minutes on the first deploy, serves until it scales to zero after 5 idle minutes, and is warmed again on the next request by Instant Start." fill="none" xmlns="http://www.w3.org/2000/svg"><text x="24" y="16" fill="#6e6d64" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">Deployment modes</text><line x1="24" y1="72" x2="696" y2="72" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="21.5" y="69.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><rect x="693.5" y="69.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><rect x="93.5" y="69.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="96" y1="75" x2="96" y2="88" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><text x="96" y="102" fill="#0f0f0e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">Deploy</text><text x="24" y="119" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">1 to 3 minutes on the first deploy</text><rect x="261.5" y="69.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="264" y1="75" x2="264" y2="88" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><text x="264" y="102" fill="#0f0f0e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">serving</text><text x="222" y="119" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">endpoint is serving</text><rect x="429.5" y="69.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="432" y1="75" x2="432" y2="88" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><text x="432" y="102" fill="#0f0f0e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">scale-to-zero</text><text x="378" y="119" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">after 5 idle minutes</text><rect x="597.5" y="69.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><line x1="600" y1="75" x2="600" y2="88" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><text x="600" y="102" fill="#0f0f0e" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">Instant Start</text><text x="528" y="119" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">warm again on the next request</text><line x1="24" y1="142" x2="696" y2="142" stroke="#e8e8e3" strokeWidth="1" strokeDasharray="3 3" /><rect x="21.5" y="139.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><rect x="693.5" y="139.5" width="5" height="5" fill="#bbb9b1" shapeRendering="crispEdges" /><text x="24" y="160" fill="#52524c" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">First deploy of a pipeline pays the full weight warm-up (minutes).</text><text x="24" y="176" fill="#6e6d64" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Subsequent cold starts go through Instant Start and are much faster.</text></svg>
</div>

<div className="hidden dark:block">
  <svg viewBox="0 0 720 194" width="100%" role="img" aria-label="A Flex deployment takes 1 to 3 minutes on the first deploy, serves until it scales to zero after 5 idle minutes, and is warmed again on the next request by Instant Start." fill="none" xmlns="http://www.w3.org/2000/svg"><text x="24" y="16" fill="#8f8e83" fontFamily="Consolas, Menlo, monospace" fontSize="9" fontWeight="500" letterSpacing="0.3">Deployment modes</text><line x1="24" y1="72" x2="696" y2="72" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="21.5" y="69.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><rect x="693.5" y="69.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><rect x="93.5" y="69.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="96" y1="75" x2="96" y2="88" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><text x="96" y="102" fill="#f0efe2" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">Deploy</text><text x="24" y="119" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">1 to 3 minutes on the first deploy</text><rect x="261.5" y="69.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="264" y1="75" x2="264" y2="88" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><text x="264" y="102" fill="#f0efe2" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">serving</text><text x="222" y="119" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">endpoint is serving</text><rect x="429.5" y="69.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="432" y1="75" x2="432" y2="88" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><text x="432" y="102" fill="#f0efe2" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">scale-to-zero</text><text x="378" y="119" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">after 5 idle minutes</text><rect x="597.5" y="69.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><line x1="600" y1="75" x2="600" y2="88" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><text x="600" y="102" fill="#f0efe2" fontFamily="Consolas, Menlo, monospace" fontSize="10.5" letterSpacing="0" textAnchor="middle">Instant Start</text><text x="528" y="119" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">warm again on the next request</text><line x1="24" y1="142" x2="696" y2="142" stroke="#383833" strokeWidth="1" strokeDasharray="3 3" /><rect x="21.5" y="139.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><rect x="693.5" y="139.5" width="5" height="5" fill="#6e6d64" shapeRendering="crispEdges" /><text x="24" y="160" fill="#c8c7ba" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">First deploy of a pipeline pays the full weight warm-up (minutes).</text><text x="24" y="176" fill="#9a998e" fontFamily="'Helvetica Neue', Helvetica, Arial, sans-serif" fontSize="10.5" letterSpacing="0">Subsequent cold starts go through Instant Start and are much faster.</text></svg>
</div>

## Capacity

Each replica serves up to 30 concurrent requests. Managed deploy unlocks when your lifetime paid credit purchases reach \$50.

| Lifetime paid credit purchases | Max replicas | Max concurrent requests |
| - | - | - |
| \$50 or more | 4 | 120 |

Exceeding the budget returns `429` with `Retry-After`. Worker counts persist across stop, start, and GPU changes: an explicit count on the request wins, otherwise the deployment's original sizing, otherwise the workspace default, up to the 4-replica limit.

## The deployment kit

The **Deploy** tab packages the same pipeline version deployment uses, so you can run it on your own hardware. Build it, download it, follow the setup guide, and verify before serving.

The bundle's five load-bearing files are `README.md`, `FETCH_MODEL.sh` which pulls the optimized weights into `./model` from a signed, time-limited URL, `runinfra/manifest.json` carrying provenance and the portability contract, `runinfra/verify.sh` which runs the canary against that manifest, and `runinfra/serve.sh` which starts the selected runtime. It also ships a Dockerfile, a Compose file, benchmark and quality projections, a canary sample request, and SHA-256 checksums. Rebuilding the bundle from the **Deploy** tab issues a fresh signed weight URL.

### How much evidence backs the kit

The manifest carries a `proof_level` so a downstream team can see what the numbers are worth.

| Proof level | Meaning |
| - | - |
| `benchmarked_and_quality_gated` | Benchmarks and a quality gate are present for this artifact. |
| `benchmarked_only` | Benchmarks are present, no quality gate was recorded. |
| `uncharacterized` | The export is usable, but benchmark or quality evidence is missing. |

When proof is incomplete the tab and the manifest show the degraded level rather than filling in confident numbers. A pipeline no run ever measured ships no claim files at all.

### The weights the numbers were measured on

A repository name is a moving target: its default branch advances and tags can be re-pointed, so a kit that names only the repository can load different weights than its own report was measured on.

| What the run resolved | What the kit does |
| - | - |
| An immutable commit | Every launch surface pins it through `HF_REVISION`, and `OPTIMIZATION.lock` records `weights_pin` as `commit` with `weights_reproducible` true. |
| A branch, a tag, or nothing | The kit says so on every buyer-facing file, records `weights_pin` as `moving-ref` with `weights_reproducible` false, and never describes itself as pinned. |

If your kit carries the second case, set `HF_REVISION` to a commit id before relying on its numbers. A kit that already resolved a commit needs no action.

## Manage and test

Test before or after deploying from the Deploy tab playground: real prompts, token counts, latency, variant comparison, no code. Workspaces below the $50 milestone get 100 playground requests a day; at $50 or more it is uncapped. The first request after an idle period on a Flex deployment pays a cold start.

From chat or the [Deployments](https://runinfra.ai/deployments) dashboard you can stop an endpoint (no charges while stopped), start it again (cached weights make restarts fast), or change its GPU tier, and the agent warns when re-optimization is worth doing.

## Common questions

<AccordionGroup>
  <Accordion title="How do I know when the deployment is ready?">
    The Deployments dashboard shows `provisioning` and moves to `active` when the replica is serving. The deployment's detail page has logs, so you can confirm the model finished loading.
  </Accordion>

  <Accordion title="How do I roll back to a previous variant?">
    From the pipeline page, pick any prior optimization variant and redeploy it. Weights are usually still cached from the earlier run, so the rollback is fast.
  </Accordion>

  <Accordion title="My first request took much longer than the rest">
    The first deploy of a pipeline pays the full weight warm-up, which takes minutes. Later cold starts reuse the cached weights and are much faster. If you need no cold start at all, use Active mode.
  </Accordion>

  <Accordion title="A long generation timed out">
    The request timeout is long but finite. For large `max_tokens`, stream the response instead of waiting for one JSON body.
  </Accordion>

  <Accordion title="The deploy failed">
    The Deploy tab names the cause and the next action first. When a deployment starts but never becomes ready, RunInfra reads its startup log and names only what it can prove: a problem fetching the build, storage filling during startup, a GPU runtime incompatibility, a failed start command, or running out of memory. If the log proves none of those, the message stays generic and retryable rather than guessing.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={3}>
  <Card title="OpenAI compatibility" icon="plug" href="/docs/tools-sdks/openai-compatibility">
    Point an existing OpenAI client at your endpoint.
  </Card>

  <Card title="Optimization runs" icon="zap" href="/docs/features/optimization">
    Where the pipeline you are deploying came from.
  </Card>

  <Card title="Pricing and credits" icon="credit-card" href="/docs/introduction/plans">
    What a deployment costs, and the \$50 milestone.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.