import{s as hs,o as ms,n as x}from"../chunks/scheduler.ddeee2a5.js";import{S as fs,i as Js,e as h,s as r,c as g,h as gs,a as m,d as l,b as o,f as ys,g as T,j as J,k as Oe,l as Ts,m as s,n as U,t as w,o as j,p as I}from"../chunks/index.10b70568.js";import{C as Us}from"../chunks/CopyLLMTxtMenu.68696f97.js";import{C as A}from"../chunks/CodeBlock.7ca4c11d.js";import{H as B,E as ws}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.d66d689f.js";import{H as gl,a as q}from"../chunks/HfOption.1e773499.js";function js($){let n,y='For convenience, the <code>huggingface_hub</code> library provides an <a href="https://huggingface.co/docs/huggingface_hub/guides/inference" rel="nofollow"><code>InferenceClient</code></a> that automatically handles provider selection and request routing.',i,M,p="In your terminal, install the Hugging Face Hub Python client and log in:",u,a,f,c,C="You can now use the the client with a Python interpreter:",Z,v,k;return a=new A({props:{code:"cGlwJTIwaW5zdGFsbCUyMGh1Z2dpbmdmYWNlX2h1YiUwQWhmJTIwYXV0aCUyMGxvZ2luJTIwJTIzJTIwZ2V0JTIwYSUyMHJlYWQlMjB0b2tlbiUyMGZyb20lMjBoZi5jbyUyRnNldHRpbmdzJTJGdG9rZW5z",highlighted:`pip install huggingface_hub
hf auth login # get a read token from hf.co/settings/tokens`,wrap:!1}}),v=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBY2xpZW50JTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50KCklMEElMEFjb21wbGV0aW9uJTIwJTNEJTIwY2xpZW50LmNoYXQuY29tcGxldGlvbnMuY3JlYXRlKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyZGVlcHNlZWstYWklMkZEZWVwU2Vlay1WMy0wMzI0JTIyJTJDJTBBJTIwJTIwJTIwJTIwbWVzc2FnZXMlM0QlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIb3clMjBtYW55JTIwJ0cncyUyMGluJTIwJ2h1Z2dpbmdmYWNlJyUzRiUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSklMEElMEFwcmludChjb21wbGV0aW9uLmNob2ljZXMlNUIwJTVELm1lc3NhZ2Up",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> InferenceClient

client = InferenceClient()

completion = client.chat.completions.create(
    model=<span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
    messages=[
        {
            <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
            <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>
        }
    ],
)

<span class="hljs-built_in">print</span>(completion.choices[<span class="hljs-number">0</span>].message)`,wrap:!1}}),{c(){n=h("p"),n.innerHTML=y,i=r(),M=h("p"),M.textContent=p,u=r(),g(a.$$.fragment),f=r(),c=h("p"),c.textContent=C,Z=r(),g(v.$$.fragment)},l(d){n=m(d,"P",{"data-svelte-h":!0}),J(n)!=="svelte-1mw7idw"&&(n.innerHTML=y),i=o(d),M=m(d,"P",{"data-svelte-h":!0}),J(M)!=="svelte-wrbzp4"&&(M.textContent=p),u=o(d),T(a.$$.fragment,d),f=o(d),c=m(d,"P",{"data-svelte-h":!0}),J(c)!=="svelte-gdpw2e"&&(c.textContent=C),Z=o(d),T(v.$$.fragment,d)},m(d,b){s(d,n,b),s(d,i,b),s(d,M,b),s(d,u,b),U(a,d,b),s(d,f,b),s(d,c,b),s(d,Z,b),U(v,d,b),k=!0},p:x,i(d){k||(w(a.$$.fragment,d),w(v.$$.fragment,d),k=!0)},o(d){j(a.$$.fragment,d),j(v.$$.fragment,d),k=!1},d(d){d&&(l(n),l(i),l(M),l(u),l(f),l(c),l(Z)),I(a,d),I(v,d)}}}function Is($){let n,y="If you’re already using OpenAI’s Python client, then you need a <strong>drop-in OpenAI replacement</strong>. Just swap-out the base URL to instantly access hundreds of additional open-weights models through our provider network.",i,M,p="Our system automatically routes your request to the most popular provider for the specified model. You can also select the provider of your choice by appending it to the model id (e.g. <code>&quot;deepseek-ai/DeepSeek-V3-0324:sambanova&quot;</code>).",u,a,f;return a=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwb3BlbmFpJTIwaW1wb3J0JTIwT3BlbkFJJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5lbnZpcm9uJTVCJTIySEZfVE9LRU4lMjIlNUQlMkMlMEEpJTBBJTBBY29tcGxldGlvbiUyMCUzRCUyMGNsaWVudC5jaGF0LmNvbXBsZXRpb25zLmNyZWF0ZSglMEElMjAlMjAlMjAlMjBtb2RlbCUzRCUyMmRlZXBzZWVrLWFpJTJGRGVlcFNlZWstVjMtMDMyNCUyMiUyQyUwQSUyMCUyMCUyMCUyMG1lc3NhZ2VzJTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySG93JTIwbWFueSUyMCdHJ3MlMjBpbiUyMCdodWdnaW5nZmFjZSclM0YlMjIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlMjAlMjAlNUQlMkMlMEEp",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.environ[<span class="hljs-string">&quot;HF_TOKEN&quot;</span>],
)

completion = client.chat.completions.create(
    model=<span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
    messages=[
        {
            <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
            <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>
        }
    ],
)`,wrap:!1}}),{c(){n=h("p"),n.innerHTML=y,i=r(),M=h("p"),M.innerHTML=p,u=r(),g(a.$$.fragment)},l(c){n=m(c,"P",{"data-svelte-h":!0}),J(n)!=="svelte-1jk1o8z"&&(n.innerHTML=y),i=o(c),M=m(c,"P",{"data-svelte-h":!0}),J(M)!=="svelte-1xac5td"&&(M.innerHTML=p),u=o(c),T(a.$$.fragment,c)},m(c,C){s(c,n,C),s(c,i,C),s(c,M,C),s(c,u,C),U(a,c,C),f=!0},p:x,i(c){f||(w(a.$$.fragment,c),f=!0)},o(c){j(a.$$.fragment,c),f=!1},d(c){c&&(l(n),l(i),l(M),l(u)),I(a,c)}}}function Cs($){let n,y="For maximum control and interoperability with custom frameworks, use our OpenAI-compatible REST API directly.",i,M,p="Our routing system automatically selects the most popular available provider for your chosen model. You can also select the provider of your choice by appending it to the model id (e.g. <code>&quot;deepseek-ai/DeepSeek-V3-0324:novita&quot;</code>).",u,a,f;return a=new A({props:{code:"aW1wb3J0JTIwb3MlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQUFQSV9VUkwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTJGY2hhdCUyRmNvbXBsZXRpb25zJTIyJTBBaGVhZGVycyUyMCUzRCUyMCU3QiUyMkF1dGhvcml6YXRpb24lMjIlM0ElMjBmJTIyQmVhcmVyJTIwJTdCb3MuZW52aXJvbiU1QidIRl9UT0tFTiclNUQlN0QlMjIlN0QlMEFwYXlsb2FkJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIybWVzc2FnZXMlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIb3clMjBtYW55JTIwJ0cncyUyMGluJTIwJ2h1Z2dpbmdmYWNlJyUzRiUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMm1vZGVsJTIyJTNBJTIwJTIyZGVlcHNlZWstYWklMkZEZWVwU2Vlay1WMy0wMzI0JTIyJTJDJTBBJTdEJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5wb3N0KEFQSV9VUkwlMkMlMjBoZWFkZXJzJTNEaGVhZGVycyUyQyUyMGpzb24lM0RwYXlsb2FkKSUwQXByaW50KHJlc3BvbnNlLmpzb24oKSU1QiUyMmNob2ljZXMlMjIlNUQlNUIwJTVEJTVCJTIybWVzc2FnZSUyMiU1RCk=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> requests

API_URL = <span class="hljs-string">&quot;https://router.huggingface.co/v1/chat/completions&quot;</span>
headers = {<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{os.environ[<span class="hljs-string">&#x27;HF_TOKEN&#x27;</span>]}</span>&quot;</span>}
payload = {
    <span class="hljs-string">&quot;messages&quot;</span>: [
        {
            <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
            <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>
        }
    ],
    <span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
}

response = requests.post(API_URL, headers=headers, json=payload)
<span class="hljs-built_in">print</span>(response.json()[<span class="hljs-string">&quot;choices&quot;</span>][<span class="hljs-number">0</span>][<span class="hljs-string">&quot;message&quot;</span>])`,wrap:!1}}),{c(){n=h("p"),n.textContent=y,i=r(),M=h("p"),M.innerHTML=p,u=r(),g(a.$$.fragment)},l(c){n=m(c,"P",{"data-svelte-h":!0}),J(n)!=="svelte-6xb179"&&(n.textContent=y),i=o(c),M=m(c,"P",{"data-svelte-h":!0}),J(M)!=="svelte-1dvx0wx"&&(M.innerHTML=p),u=o(c),T(a.$$.fragment,c)},m(c,C){s(c,n,C),s(c,i,C),s(c,M,C),s(c,u,C),U(a,c,C),f=!0},p:x,i(c){f||(w(a.$$.fragment,c),f=!0)},o(c){j(a.$$.fragment,c),f=!1},d(c){c&&(l(n),l(i),l(M),l(u)),I(a,c)}}}function $s($){let n,y,i,M,p,u;return n=new q({props:{id:"python-clients",option:"huggingface_hub",$$slots:{default:[js]},$$scope:{ctx:$}}}),i=new q({props:{id:"python-clients",option:"openai",$$slots:{default:[Is]},$$scope:{ctx:$}}}),p=new q({props:{id:"python-clients",option:"requests",$$slots:{default:[Cs]},$$scope:{ctx:$}}}),{c(){g(n.$$.fragment),y=r(),g(i.$$.fragment),M=r(),g(p.$$.fragment)},l(a){T(n.$$.fragment,a),y=o(a),T(i.$$.fragment,a),M=o(a),T(p.$$.fragment,a)},m(a,f){U(n,a,f),s(a,y,f),U(i,a,f),s(a,M,f),U(p,a,f),u=!0},p(a,f){const c={};f&2&&(c.$$scope={dirty:f,ctx:a}),n.$set(c);const C={};f&2&&(C.$$scope={dirty:f,ctx:a}),i.$set(C);const Z={};f&2&&(Z.$$scope={dirty:f,ctx:a}),p.$set(Z)},i(a){u||(w(n.$$.fragment,a),w(i.$$.fragment,a),w(p.$$.fragment,a),u=!0)},o(a){j(n.$$.fragment,a),j(i.$$.fragment,a),j(p.$$.fragment,a),u=!1},d(a){a&&(l(y),l(M)),I(n,a),I(i,a),I(p,a)}}}function bs($){let n,y="Our JavaScript SDK provides a convenient interface with automatic provider selection and TypeScript support.",i,M,p="Install with NPM:",u,a,f,c,C="Then use the client with Javascript:",Z,v,k;return a=new A({props:{code:"bnBtJTIwaW5zdGFsbCUyMCU0MGh1Z2dpbmdmYWNlJTJGaW5mZXJlbmNl",highlighted:"npm install @huggingface/inference",wrap:!1}}),v=new A({props:{code:"aW1wb3J0JTIwJTdCJTIwSW5mZXJlbmNlQ2xpZW50JTIwJTdEJTIwZnJvbSUyMCUyMiU0MGh1Z2dpbmdmYWNlJTJGaW5mZXJlbmNlJTIyJTNCJTBBJTBBY29uc3QlMjBjbGllbnQlMjAlM0QlMjBuZXclMjBJbmZlcmVuY2VDbGllbnQocHJvY2Vzcy5lbnYuSEZfVE9LRU4pJTNCJTBBJTBBY29uc3QlMjBjaGF0Q29tcGxldGlvbiUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LmNoYXRDb21wbGV0aW9uKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIyZGVlcHNlZWstYWklMkZEZWVwU2Vlay1WMy0wMzI0JTIyJTJDJTBBJTIwJTIwbWVzc2FnZXMlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjByb2xlJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMGNvbnRlbnQlM0ElMjAlMjJIb3clMjBtYW55JTIwJ0cncyUyMGluJTIwJ2h1Z2dpbmdmYWNlJyUzRiUyMiUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCU1RCUyQyUwQSU3RCklM0IlMEElMEFjb25zb2xlLmxvZyhjaGF0Q29tcGxldGlvbi5jaG9pY2VzJTVCMCU1RC5tZXNzYWdlKSUzQg==",highlighted:`<span class="hljs-keyword">import</span> { <span class="hljs-title class_">InferenceClient</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;@huggingface/inference&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">InferenceClient</span>(process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>);

<span class="hljs-keyword">const</span> chatCompletion = <span class="hljs-keyword">await</span> client.<span class="hljs-title function_">chatCompletion</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
  <span class="hljs-attr">messages</span>: [
    {
      <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>,
      <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>,
    },
  ],
});

<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(chatCompletion.<span class="hljs-property">choices</span>[<span class="hljs-number">0</span>].<span class="hljs-property">message</span>);`,wrap:!1}}),{c(){n=h("p"),n.textContent=y,i=r(),M=h("p"),M.textContent=p,u=r(),g(a.$$.fragment),f=r(),c=h("p"),c.textContent=C,Z=r(),g(v.$$.fragment)},l(d){n=m(d,"P",{"data-svelte-h":!0}),J(n)!=="svelte-16qrv4b"&&(n.textContent=y),i=o(d),M=m(d,"P",{"data-svelte-h":!0}),J(M)!=="svelte-1n3pnv6"&&(M.textContent=p),u=o(d),T(a.$$.fragment,d),f=o(d),c=m(d,"P",{"data-svelte-h":!0}),J(c)!=="svelte-1il3uir"&&(c.textContent=C),Z=o(d),T(v.$$.fragment,d)},m(d,b){s(d,n,b),s(d,i,b),s(d,M,b),s(d,u,b),U(a,d,b),s(d,f,b),s(d,c,b),s(d,Z,b),U(v,d,b),k=!0},p:x,i(d){k||(w(a.$$.fragment,d),w(v.$$.fragment,d),k=!0)},o(d){j(a.$$.fragment,d),j(v.$$.fragment,d),k=!1},d(d){d&&(l(n),l(i),l(M),l(u),l(f),l(c),l(Z)),I(a,d),I(v,d)}}}function vs($){let n,y="If you’re already using OpenAI’s Javascript client, then you need a <strong>drop-in OpenAI replacement</strong>. Just swap-out the base URL to instantly access hundreds of additional open-weights models through our provider network. Our system automatically routes your request to the most popular provider for the specified model. You can also select the provider of your choice by appending it to the model id (e.g. <code>&quot;deepseek-ai/DeepSeek-V3-0324:nebius&quot;</code>).",i,M,p;return M=new A({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjBjb21wbGV0aW9uJTIwJTNEJTIwYXdhaXQlMjBjbGllbnQuY2hhdC5jb21wbGV0aW9ucy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJkZWVwc2Vlay1haSUyRkRlZXBTZWVrLVYzLTAzMjQlMjIlMkMlMEElMjAlMjBtZXNzYWdlcyUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMHJvbGUlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwY29udGVudCUzQSUyMCUyMkhvdyUyMG1hbnklMjAnRydzJTIwaW4lMjAnaHVnZ2luZ2ZhY2UnJTNGJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTVEJTJDJTBBJTdEKSUzQiUwQSUwQWNvbnNvbGUubG9nKGNvbXBsZXRpb24uY2hvaWNlcyU1QjAlNUQubWVzc2FnZS5jb250ZW50KSUzQg==",highlighted:`<span class="hljs-keyword">import</span> <span class="hljs-title class_">OpenAI</span> <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> completion = <span class="hljs-keyword">await</span> client.<span class="hljs-property">chat</span>.<span class="hljs-property">completions</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
  <span class="hljs-attr">messages</span>: [
    {
      <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>,
      <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>,
    },
  ],
});

<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(completion.<span class="hljs-property">choices</span>[<span class="hljs-number">0</span>].<span class="hljs-property">message</span>.<span class="hljs-property">content</span>);`,wrap:!1}}),{c(){n=h("p"),n.innerHTML=y,i=r(),g(M.$$.fragment)},l(u){n=m(u,"P",{"data-svelte-h":!0}),J(n)!=="svelte-1jy20qj"&&(n.innerHTML=y),i=o(u),T(M.$$.fragment,u)},m(u,a){s(u,n,a),s(u,i,a),U(M,u,a),p=!0},p:x,i(u){p||(w(M.$$.fragment,u),p=!0)},o(u){j(M.$$.fragment,u),p=!1},d(u){u&&(l(n),l(i)),I(M,u)}}}function Zs($){let n,y="For lightweight applications or custom implementations, use our REST API directly with standard fetch.",i,M,p="Our routing system automatically selects the most popular available provider for your chosen model. You can also select the provider of your choice by appending it to the model id (e.g. <code>&quot;deepseek-ai/DeepSeek-V3-0324:fireworks-ai&quot;</code>).",u,a,f;return a=new A({props:{code:"aW1wb3J0JTIwZmV0Y2glMjBmcm9tJTIwJTIybm9kZS1mZXRjaCUyMiUzQiUwQSUwQWNvbnN0JTIwcmVzcG9uc2UlMjAlM0QlMjBhd2FpdCUyMGZldGNoKCUwQSUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZjaGF0JTJGY29tcGxldGlvbnMlMjIlMkMlMEElMjAlMjAlN0IlMEElMjAlMjAlMjAlMjBtZXRob2QlM0ElMjAlMjJQT1NUJTIyJTJDJTBBJTIwJTIwJTIwJTIwaGVhZGVycyUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMEF1dGhvcml6YXRpb24lM0ElMjAlNjBCZWFyZXIlMjAlMjQlN0Jwcm9jZXNzLmVudi5IRl9UT0tFTiU3RCU2MCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMkNvbnRlbnQtVHlwZSUyMiUzQSUyMCUyMmFwcGxpY2F0aW9uJTJGanNvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMGJvZHklM0ElMjBKU09OLnN0cmluZ2lmeSglN0IlMEElMjAlMjAlMjAlMjAlMjAlMjBtb2RlbCUzQSUyMCUyMmRlZXBzZWVrLWFpJTJGRGVlcFNlZWstVjMtMDMyNCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMG1lc3NhZ2VzJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjb250ZW50JTNBJTIwJTIySG93JTIwbWFueSUyMCdHJ3MlMjBpbiUyMCdodWdnaW5nZmFjZSclM0YlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjAlN0QpJTJDJTBBJTIwJTIwJTdEJTBBKSUzQiUwQWNvbnNvbGUubG9nKGF3YWl0JTIwcmVzcG9uc2UuanNvbigpKSUzQg==",highlighted:`<span class="hljs-keyword">import</span> fetch <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;node-fetch&quot;</span>;

<span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> <span class="hljs-title function_">fetch</span>(
  <span class="hljs-string">&quot;https://router.huggingface.co/v1/chat/completions&quot;</span>,
  {
    <span class="hljs-attr">method</span>: <span class="hljs-string">&quot;POST&quot;</span>,
    <span class="hljs-attr">headers</span>: {
      <span class="hljs-title class_">Authorization</span>: <span class="hljs-string">\`Bearer <span class="hljs-subst">\${({}).HF_TOKEN}</span>\`</span>,
      <span class="hljs-string">&quot;Content-Type&quot;</span>: <span class="hljs-string">&quot;application/json&quot;</span>,
    },
    <span class="hljs-attr">body</span>: <span class="hljs-title class_">JSON</span>.<span class="hljs-title function_">stringify</span>({
      <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;deepseek-ai/DeepSeek-V3-0324&quot;</span>,
      <span class="hljs-attr">messages</span>: [
        {
          <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>,
          <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;How many &#x27;G&#x27;s in &#x27;huggingface&#x27;?&quot;</span>,
        },
      ],
    }),
  }
);
<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-keyword">await</span> response.<span class="hljs-title function_">json</span>());`,wrap:!1}}),{c(){n=h("p"),n.textContent=y,i=r(),M=h("p"),M.innerHTML=p,u=r(),g(a.$$.fragment)},l(c){n=m(c,"P",{"data-svelte-h":!0}),J(n)!=="svelte-11uqtap"&&(n.textContent=y),i=o(c),M=m(c,"P",{"data-svelte-h":!0}),J(M)!=="svelte-s7g9kv"&&(M.innerHTML=p),u=o(c),T(a.$$.fragment,c)},m(c,C){s(c,n,C),s(c,i,C),s(c,M,C),s(c,u,C),U(a,c,C),f=!0},p:x,i(c){f||(w(a.$$.fragment,c),f=!0)},o(c){j(a.$$.fragment,c),f=!1},d(c){c&&(l(n),l(i),l(M),l(u)),I(a,c)}}}function Bs($){let n,y,i,M,p,u;return n=new q({props:{id:"javascript-clients",option:"huggingface.js",$$slots:{default:[bs]},$$scope:{ctx:$}}}),i=new q({props:{id:"javascript-clients",option:"openai",$$slots:{default:[vs]},$$scope:{ctx:$}}}),p=new q({props:{id:"javascript-clients",option:"fetch",$$slots:{default:[Zs]},$$scope:{ctx:$}}}),{c(){g(n.$$.fragment),y=r(),g(i.$$.fragment),M=r(),g(p.$$.fragment)},l(a){T(n.$$.fragment,a),y=o(a),T(i.$$.fragment,a),M=o(a),T(p.$$.fragment,a)},m(a,f){U(n,a,f),s(a,y,f),U(i,a,f),s(a,M,f),U(p,a,f),u=!0},p(a,f){const c={};f&2&&(c.$$scope={dirty:f,ctx:a}),n.$set(c);const C={};f&2&&(C.$$scope={dirty:f,ctx:a}),i.$set(C);const Z={};f&2&&(Z.$$scope={dirty:f,ctx:a}),p.$set(Z)},i(a){u||(w(n.$$.fragment,a),w(i.$$.fragment,a),w(p.$$.fragment,a),u=!0)},o(a){j(n.$$.fragment,a),j(i.$$.fragment,a),j(p.$$.fragment,a),u=!1},d(a){a&&(l(y),l(M)),I(n,a),I(i,a),I(p,a)}}}function As($){let n,y;return n=new A({props:{code:"aW1wb3J0JTIwJTdCJTIwSW5mZXJlbmNlQ2xpZW50JTIwJTdEJTIwZnJvbSUyMCUyMiU0MGh1Z2dpbmdmYWNlJTJGaW5mZXJlbmNlJTIyJTNCJTBBJTBBY29uc3QlMjBjbGllbnQlMjAlM0QlMjBuZXclMjBJbmZlcmVuY2VDbGllbnQocHJvY2Vzcy5lbnYuSEZfVE9LRU4pJTNCJTBBJTBBJTJGJTJGJTIwRXhwbGljaXQlMjBwcm92aWRlciUyMHNlbGVjdGlvbiUwQWF3YWl0JTIwY2xpZW50LmNoYXRDb21wbGV0aW9uKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMS04Qi1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMHByb3ZpZGVyJTNBJTIwJTIyc2FtYmFub3ZhJTIyJTJDJTIwJTJGJTJGJTIwU3BlY2lmaWMlMjBwcm92aWRlciUwQSUyMCUyMG1lc3NhZ2VzJTNBJTIwJTVCJTdCJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMjBjb250ZW50JTNBJTIwJTIySGVsbG8hJTIyJTIwJTdEJTVEJTJDJTBBJTdEKSUzQiUwQSUwQSUyRiUyRiUyMEF1dG9tYXRpYyUyMHByb3ZpZGVyJTIwc2VsZWN0aW9uJTIwKGRlZmF1bHQlM0ElMjAlMjJhdXRvJTIyKSUwQWF3YWl0JTIwY2xpZW50LmNoYXRDb21wbGV0aW9uKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMS04Qi1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMCUyRiUyRiUyMERlZmF1bHRzJTIwdG8lMjAlMjJhdXRvJTIyJTIwc2VsZWN0aW9uJTIwb2YlMjB0aGUlMjBwcm92aWRlciUwQSUyMCUyMCUyRiUyRiUyMHByb3ZpZGVyJTNEJTIyYXV0byUyMiUyQyUwQSUyMCUyMG1lc3NhZ2VzJTNBJTIwJTVCJTdCJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMjBjb250ZW50JTNBJTIwJTIySGVsbG8hJTIyJTIwJTdEJTVEJTJDJTBBJTdEKSUzQg==",highlighted:`<span class="hljs-keyword">import</span> { <span class="hljs-title class_">InferenceClient</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;@huggingface/inference&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">InferenceClient</span>(process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>);

<span class="hljs-comment">// Explicit provider selection</span>
<span class="hljs-keyword">await</span> client.<span class="hljs-title function_">chatCompletion</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;meta-llama/Llama-3.1-8B-Instruct&quot;</span>,
  <span class="hljs-attr">provider</span>: <span class="hljs-string">&quot;sambanova&quot;</span>, <span class="hljs-comment">// Specific provider</span>
  <span class="hljs-attr">messages</span>: [{ <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Hello!&quot;</span> }],
});

<span class="hljs-comment">// Automatic provider selection (default: &quot;auto&quot;)</span>
<span class="hljs-keyword">await</span> client.<span class="hljs-title function_">chatCompletion</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;meta-llama/Llama-3.1-8B-Instruct&quot;</span>,
  <span class="hljs-comment">// Defaults to &quot;auto&quot; selection of the provider</span>
  <span class="hljs-comment">// provider=&quot;auto&quot;,</span>
  <span class="hljs-attr">messages</span>: [{ <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Hello!&quot;</span> }],
});`,wrap:!1}}),{c(){g(n.$$.fragment)},l(i){T(n.$$.fragment,i)},m(i,M){U(n,i,M),y=!0},p:x,i(i){y||(w(n.$$.fragment,i),y=!0)},o(i){j(n.$$.fragment,i),y=!1},d(i){I(n,i)}}}function ks($){let n,y;return n=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBY2xpZW50JTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50KHRva2VuJTNEb3MuZW52aXJvbiU1QiUyMkhGX1RPS0VOJTIyJTVEKSUwQSUwQSUyMyUyMEV4cGxpY2l0JTIwcHJvdmlkZXIlMjBzZWxlY3Rpb24lMEFyZXN1bHQlMjAlM0QlMjBjbGllbnQuY2hhdF9jb21wbGV0aW9uKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMS04Qi1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMCUyMCUyMHByb3ZpZGVyJTNEJTIyc2FtYmFub3ZhJTIyJTJDJTIwJTIwJTIzJTIwU3BlY2lmaWMlMjBwcm92aWRlciUwQSUyMCUyMCUyMCUyMG1lc3NhZ2VzJTNEJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySGVsbG8hJTIyJTdEJTVEJTJDJTBBKSUwQSUwQSUyMyUyMEF1dG9tYXRpYyUyMHByb3ZpZGVyJTIwc2VsZWN0aW9uJTIwKGRlZmF1bHQlM0ElMjAlMjJhdXRvJTIyKSUwQXJlc3VsdCUyMCUzRCUyMGNsaWVudC5jaGF0X2NvbXBsZXRpb24oJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0QlMjJtZXRhLWxsYW1hJTJGTGxhbWEtMy4xLThCLUluc3RydWN0JTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIzJTIwRGVmYXVsdHMlMjB0byUyMCUyMmF1dG8lMjIlMjBzZWxlY3Rpb24lMjBvZiUyMHRoZSUyMHByb3ZpZGVyJTBBJTIwJTIwJTIwJTIwJTIzJTIwcHJvdmlkZXIlM0QlMjJhdXRvJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWVzc2FnZXMlM0QlNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIZWxsbyElMjIlN0QlNUQlMkMlMEEp",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> InferenceClient

client = InferenceClient(token=os.environ[<span class="hljs-string">&quot;HF_TOKEN&quot;</span>])

<span class="hljs-comment"># Explicit provider selection</span>
result = client.chat_completion(
    model=<span class="hljs-string">&quot;meta-llama/Llama-3.1-8B-Instruct&quot;</span>,
    provider=<span class="hljs-string">&quot;sambanova&quot;</span>,  <span class="hljs-comment"># Specific provider</span>
    messages=[{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello!&quot;</span>}],
)

<span class="hljs-comment"># Automatic provider selection (default: &quot;auto&quot;)</span>
result = client.chat_completion(
    model=<span class="hljs-string">&quot;meta-llama/Llama-3.1-8B-Instruct&quot;</span>,
    <span class="hljs-comment"># Defaults to &quot;auto&quot; selection of the provider</span>
    <span class="hljs-comment"># provider=&quot;auto&quot;,</span>
    messages=[{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello!&quot;</span>}],
)`,wrap:!1}}),{c(){g(n.$$.fragment)},l(i){T(n.$$.fragment,i)},m(i,M){U(n,i,M),y=!0},p:x,i(i){y||(w(n.$$.fragment,i),y=!0)},o(i){j(n.$$.fragment,i),y=!1},d(i){I(n,i)}}}function qs($){let n,y,i,M;return n=new q({props:{id:"client-side-provider-selection",option:"javascript",$$slots:{default:[As]},$$scope:{ctx:$}}}),i=new q({props:{id:"client-side-provider-selection",option:"python",$$slots:{default:[ks]},$$scope:{ctx:$}}}),{c(){g(n.$$.fragment),y=r(),g(i.$$.fragment)},l(p){T(n.$$.fragment,p),y=o(p),T(i.$$.fragment,p)},m(p,u){U(n,p,u),s(p,y,u),U(i,p,u),M=!0},p(p,u){const a={};u&2&&(a.$$scope={dirty:u,ctx:p}),n.$set(a);const f={};u&2&&(f.$$scope={dirty:u,ctx:p}),i.$set(f)},i(p){M||(w(n.$$.fragment,p),w(i.$$.fragment,p),M=!0)},o(p){j(n.$$.fragment,p),j(i.$$.fragment,p),M=!1},d(p){p&&l(y),I(n,p),I(i,p)}}}function xs($){let n,y;return n=new A({props:{code:"aW1wb3J0JTIwJTdCJTIwT3BlbkFJJTIwJTdEJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjBjb21wbGV0aW9uJTIwJTNEJTIwYXdhaXQlMjBjbGllbnQuY2hhdC5jb21wbGV0aW9ucy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJtZXRhLWxsYW1hJTJGTGxhbWEtMy4xLThCLUluc3RydWN0JTIyJTJDJTBBJTIwJTIwbWVzc2FnZXMlM0ElMjAlNUIlN0IlMjByb2xlJTNBJTIwJTIydXNlciUyMiUyQyUyMGNvbnRlbnQlM0ElMjAlMjJIZWxsbyElMjIlMjAlN0QlNUQlMkMlMEElN0QpJTNC",highlighted:`<span class="hljs-keyword">import</span> { <span class="hljs-title class_">OpenAI</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;openai&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">OpenAI</span>({
  <span class="hljs-attr">baseURL</span>: <span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
  <span class="hljs-attr">apiKey</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>,
});

<span class="hljs-keyword">const</span> completion = <span class="hljs-keyword">await</span> client.<span class="hljs-property">chat</span>.<span class="hljs-property">completions</span>.<span class="hljs-title function_">create</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;meta-llama/Llama-3.1-8B-Instruct&quot;</span>,
  <span class="hljs-attr">messages</span>: [{ <span class="hljs-attr">role</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-attr">content</span>: <span class="hljs-string">&quot;Hello!&quot;</span> }],
});`,wrap:!1}}),{c(){g(n.$$.fragment)},l(i){T(n.$$.fragment,i)},m(i,M){U(n,i,M),y=!0},p:x,i(i){y||(w(n.$$.fragment,i),y=!0)},o(i){j(n.$$.fragment,i),y=!1},d(i){I(n,i)}}}function Ns($){let n,y;return n=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwb3BlbmFpJTIwaW1wb3J0JTIwT3BlbkFJJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5lbnZpcm9uJTVCJTIySEZfVE9LRU4lMjIlNUQlMkMlMEEpJTBBJTBBY29tcGxldGlvbiUyMCUzRCUyMGNsaWVudC5jaGF0LmNvbXBsZXRpb25zLmNyZWF0ZSglMEElMjAlMjAlMjAlMjBtb2RlbCUzRCUyMm1ldGEtbGxhbWElMkZMbGFtYS0zLjEtOEItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBtZXNzYWdlcyUzRCU1QiU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkhlbGxvISUyMiU3RCU1RCUyQyUwQSklMEElMEFwcmludChjb21wbGV0aW9uLmNob2ljZXMlNUIwJTVELm1lc3NhZ2UuY29udGVudCk=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI

client = OpenAI(
    base_url=<span class="hljs-string">&quot;https://router.huggingface.co/v1&quot;</span>,
    api_key=os.environ[<span class="hljs-string">&quot;HF_TOKEN&quot;</span>],
)

completion = client.chat.completions.create(
    model=<span class="hljs-string">&quot;meta-llama/Llama-3.1-8B-Instruct&quot;</span>,
    messages=[{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello!&quot;</span>}],
)

<span class="hljs-built_in">print</span>(completion.choices[<span class="hljs-number">0</span>].message.content)`,wrap:!1}}),{c(){g(n.$$.fragment)},l(i){T(n.$$.fragment,i)},m(i,M){U(n,i,M),y=!0},p:x,i(i){y||(w(n.$$.fragment,i),y=!0)},o(i){j(n.$$.fragment,i),y=!1},d(i){I(n,i)}}}function Ws($){let n,y,i,M;return n=new q({props:{id:"openai-compatible",option:"javascript",$$slots:{default:[xs]},$$scope:{ctx:$}}}),i=new q({props:{id:"openai-compatible",option:"python",$$slots:{default:[Ns]},$$scope:{ctx:$}}}),{c(){g(n.$$.fragment),y=r(),g(i.$$.fragment)},l(p){T(n.$$.fragment,p),y=o(p),T(i.$$.fragment,p)},m(p,u){U(n,p,u),s(p,y,u),U(i,p,u),M=!0},p(p,u){const a={};u&2&&(a.$$scope={dirty:u,ctx:p}),n.$set(a);const f={};u&2&&(f.$$scope={dirty:u,ctx:p}),i.$set(f)},i(p){M||(w(n.$$.fragment,p),w(i.$$.fragment,p),M=!0)},o(p){j(n.$$.fragment,p),j(i.$$.fragment,p),M=!1},d(p){p&&l(y),I(n,p),I(i,p)}}}function Gs($){let n,y,i,M,p,u,a,f,c,C='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/Inference-providers-banner-light.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/inference-providers/Inference-providers-banner-dark.png"/>',Z,v,k="Hugging Face’s Inference Providers give developers access to hundreds of machine learning models, powered by world-class inference providers. They are also integrated into our client SDKs (for JS and Python), making it easy to explore serverless inference of models on your favorite providers.",d,b,et,E,Tl="Our platform integrates with leading AI infrastructure providers, giving you access to their specialized capabilities through a single, consistent API. Here’s what each partner supports:",tt,V,Ul='<thead><tr><th>Provider</th> <th align="center">Chat completion (LLM)</th> <th align="center">Chat completion (VLM)</th> <th align="center">Feature Extraction</th> <th align="center">Text to Image</th> <th align="center">Text to video</th> <th align="center">Speech to text</th></tr></thead> <tbody><tr><td><a href="./providers/cerebras">Cerebras</a></td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/cohere">Cohere</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/fal-ai">Fal AI</a></td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center">✅</td></tr> <tr><td><a href="./providers/featherless-ai">Featherless AI</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/fireworks-ai">Fireworks</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/groq">Groq</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/hf-inference">HF Inference</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center">✅</td></tr> <tr><td><a href="./providers/hyperbolic">Hyperbolic</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/nebius">Nebius</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/novita">Novita</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center">✅</td> <td align="center"></td></tr> <tr><td><a href="./providers/nscale">Nscale</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/publicai">Public AI</a></td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/replicate">Replicate</a></td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center">✅</td></tr> <tr><td><a href="./providers/sambanova">SambaNova</a></td> <td align="center">✅</td> <td align="center"></td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/scaleway">Scaleway</a></td> <td align="center">✅</td> <td align="center"></td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/together">Together</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td></tr> <tr><td><a href="./providers/zai-org">Z.ai</a></td> <td align="center">✅</td> <td align="center">✅</td> <td align="center"></td> <td align="center"></td> <td align="center"></td> <td align="center"></td></tr></tbody>',lt,H,st,_,wl="When you build AI applications, it’s tough to manage multiple provider APIs, comparing model performance, and dealing with varying reliability. Inference Providers solves these challenges by offering:",nt,L,jl="<strong>Instant Access to Cutting-Edge Models</strong>: Go beyond mainstream providers to access thousands of specialized models across multiple AI tasks. Whether you need the latest language models, state-of-the-art image generators, or domain-specific embeddings, you’ll find them here.",at,Y,Il="<strong>Zero Vendor Lock-in</strong>: Unlike being tied to a single provider’s model catalog, you get access to models from Cerebras, Groq, Together AI, Replicate, and more — all through one consistent interface.",it,R,Cl="<strong>Production-Ready Performance</strong>: Built for enterprise workloads with the reliability your applications demand.",rt,F,$l="Here’s what you can build:",ot,P,bl="<li><strong>Text Generation</strong>: Use Large language models with tool-calling capabilities for chatbots, content generation, and code assistance</li> <li><strong>Image and Video Generation</strong>: Create custom images and videos, including support for LoRAs and style customization</li> <li><strong>Search &amp; Retrieval</strong>: State-of-the-art embeddings for semantic search, RAG systems, and recommendation engines</li> <li><strong>Traditional ML Tasks</strong>: Ready-to-use models for classification, NER, summarization, and speech recognition</li>",pt,X,vl='⚡ <strong>Get Started for Free</strong>: Inference Providers includes a generous free tier, with additional credits for <a href="https://hf.co/subscribe/pro" rel="nofollow">PRO users</a> and <a href="https://huggingface.co/enterprise" rel="nofollow">Enterprise Hub organizations</a>.',ct,z,Mt,D,Zl="<li><strong>🎯 All-in-One API</strong>: A single API for text generation, image generation, document embeddings, NER, summarization, image classification, and more.</li> <li><strong>🔀 Multi-Provider Support</strong>: Easily run models from top-tier providers like fal, Replicate, Sambanova, Together AI, and others.</li> <li><strong>🚀 Scalable &amp; Reliable</strong>: Built for high availability and low-latency performance in production environments.</li> <li><strong>🔧 Developer-Friendly</strong>: Simple requests, fast responses, and a consistent developer experience across Python and JavaScript clients.</li> <li><strong>👷 Easy to integrate</strong>: Drop-in replacement for the OpenAI chat completions API.</li> <li><strong>💰 Cost-Effective</strong>: No extra markup on provider rates.</li>",ut,K,dt,O,Bl="Inference Providers works with your existing development workflow. Whether you prefer Python, JavaScript, or direct HTTP calls, we provide native SDKs and OpenAI-compatible APIs to get you up and running quickly.",yt,ee,Al='We’ll walk through a practical example using <a href="https://huggingface.co/deepseek-ai/DeepSeek-V3-0324" rel="nofollow">deepseek-ai/DeepSeek-V3-0324</a>, a state-of-the-art open-weights conversational model.',ht,te,mt,le,kl='Before diving into integration, explore models interactively with our <a href="https://huggingface.co/playground" rel="nofollow">Inference Playground</a>. Test different <a href="http://huggingface.co/models?inference_provider=all&amp;sort=trending&amp;other=conversational" rel="nofollow">chat completion models</a> with your prompts and compare responses to find the perfect fit for your use case.',ft,N,ql='<img src="https://cdn-uploads.huggingface.co/production/uploads/5f17f0a0925b9863e28ad517/9_Tgf0Tv65srhBirZQMTp.png" alt="Inference Playground thumbnail" style="max-width: 550px; width: 100%;"/>',Jt,se,gt,ne,xl='You’ll need a Hugging Face token to authenticate your requests. Create one by visiting your <a href="https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&amp;tokenType=fineGrained" rel="nofollow">token settings</a> and generating a <code>fine-grained</code> token with <code>Make calls to Inference Providers</code> permissions.',Tt,ae,Nl='For complete token management details, see our <a href="https://huggingface.co/docs/hub/en/security-tokens" rel="nofollow">security tokens guide</a>.',Ut,ie,wt,re,Wl="Let’s start with the most common use case: conversational AI using large language models. This section demonstrates how to perform chat completions using DeepSeek V3, showcasing the different ways you can integrate Inference Providers into your applications.",jt,oe,Gl="Whether you prefer our native clients, want OpenAI compatibility, or need direct HTTP access, we’ll show you how to get up and running with just a few lines of code.",It,pe,Ct,ce,Sl="Here are three ways to integrate Inference Providers into your Python applications, from high-level convenience to low-level control:",$t,W,bt,Me,vt,ue,Ql="Integrate Inference Providers into your JavaScript applications with these flexible approaches:",Zt,G,Bt,de,At,ye,El=`For testing, debugging, or integrating with any HTTP client, here’s the raw REST API format.
Our routing system automatically selects the most popular available provider for your chosen model. You can also select the provider of your choice by appending it to the model id (e.g. <code>&quot;deepseek-ai/DeepSeek-V3-0324:fireworks-ai&quot;</code>).`,kt,he,qt,me,xt,fe,Vl='Let’s explore how to generate images from text prompts using Inference Providers. We’ll use <a href="https://huggingface.co/black-forest-labs/FLUX.1-dev" rel="nofollow">black-forest-labs/FLUX.1-dev</a>, a state-of-the-art diffusion model that produces highly detailed, photorealistic images.',Nt,Je,Wt,ge,Hl="Use the <code>huggingface_hub</code> library for the simplest image generation experience with automatic provider selection:",Gt,Te,St,Ue,Qt,we,_l="Use our JavaScript SDK for streamlined image generation with TypeScript support:",Et,je,Vt,Ie,Ht,Ce,Ll="The Inference Providers API acts as a unified proxy layer that sits between your application and multiple AI providers. Understanding how provider selection works is crucial for optimizing performance, cost, and reliability in your applications.",_t,$e,Lt,be,Yl="When using Inference Providers, your requests go through Hugging Face’s proxy infrastructure, which provides several key benefits:",Yt,ve,Rl="<li><strong>Unified Authentication &amp; Billing</strong>: Use a single Hugging Face token for all providers</li> <li><strong>Automatic Failover</strong>: When using automatic provider selection (<code>provider=&quot;auto&quot;</code>), requests are automatically routed to alternative providers if the primary provider is flagged as unavailable by our validation system</li> <li><strong>Consistent Interface through client libraries</strong>: When using our client libraries, the same request format works across different providers</li>",Rt,Ze,Fl="Because the API acts as a proxy, the exact HTTP request may vary between providers as each provider has their own API requirements and response formats. <strong>When using our official client libraries</strong> (JavaScript or Python), these provider-specific differences are handled automatically whether you use <code>provider=&quot;auto&quot;</code> or specify a particular provider.",Ft,Be,Pt,Ae,Pl="When using the Hugging Face inference clients (JavaScript or Python), you can explicitly specify a provider or let the system choose automatically. The client then formats the HTTP request to match the selected provider’s API requirements.",Xt,S,zt,ke,Xl="<strong>Provider Selection Policy:</strong>",Dt,qe,zl='<li><code>provider: &quot;auto&quot;</code> (default): Selects the first available provider for the model, sorted by your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a></li> <li><code>provider: &quot;specific-provider&quot;</code>: Forces use of a specific provider (e.g., “together”, “replicate”, “fal-ai”, …)</li>',Kt,xe,Ot,Ne,Dl="If you prefer to work with familiar OpenAI APIs or want to migrate existing chat completion code with minimal changes, we offer a drop-in compatible endpoint that handles all provider selection automatically on the server side.",el,We,Kl="<strong>Note</strong>: This OpenAI-compatible endpoint is currently available for chat completion tasks only. For other tasks like text-to-image, embeddings, or speech processing, use the Hugging Face inference clients shown above.",tl,Q,ll,Ge,Ol="This endpoint can also be requested through direct HTTP access, making it suitable for integration with various HTTP clients and applications that need to interact with the chat completion service directly.",sl,Se,nl,Qe,es="<strong>Key Features:</strong>",al,Ee,ts="<li><strong>Server-Side Provider Selection</strong>: The server automatically chooses the best available provider</li> <li><strong>Model Listing</strong>: GET <code>/v1/models</code> returns available models across all providers</li> <li><strong>OpenAI SDK Compatibility</strong>: Works with existing OpenAI client libraries</li> <li><strong>Chat Tasks Only</strong>: Limited to conversational workloads</li>",il,Ve,rl,He,ls="<strong>Use Inference Clients when:</strong>",ol,_e,ss="<li>You need support for all task types (text-to-image, speech, embeddings, etc.)</li> <li>You want explicit control over provider selection</li> <li>You’re building applications that use multiple AI tasks</li>",pl,Le,ns="<strong>Use OpenAI-Compatible Endpoint when:</strong>",cl,Ye,as="<li>You’re only doing chat completions</li> <li>You want to migrate existing OpenAI-based code with minimal changes</li> <li>You prefer server-side provider management</li>",Ml,Re,is="<strong>Use Direct HTTP when:</strong>",ul,Fe,rs="<li>You’re implementing custom request logic</li> <li>You need fine-grained control over the request/response cycle</li> <li>You’re working in environments without available client libraries</li>",dl,Pe,yl,Xe,os="Now that you understand the basics, explore these resources to make the most of Inference Providers:",hl,ze,ps='<li><strong><a href="https://huggingface.co/blog/inference-providers" rel="nofollow">Announcement Blog Post</a></strong>: Learn more about the launch of Inference Providers</li> <li><strong><a href="./pricing">Pricing and Billing</a></strong>: Understand costs and billing of Inference Providers</li> <li><strong><a href="./hub-integration">Hub Integration</a></strong>: Learn how Inference Providers are integrated with the Hugging Face Hub</li> <li><strong><a href="./register-as-a-provider">Register as a Provider</a></strong>: Requirements to join our partner network as a provider</li> <li><strong><a href="./hub-api">Hub API</a></strong>: Advanced API features and configuration</li> <li><strong><a href="./tasks/index">API Reference</a></strong>: Complete parameter documentation for all supported tasks</li>',ml,De,fl,Ke,Jl;return p=new Us({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),a=new B({props:{title:"Inference Providers",local:"inference-providers",headingTag:"h1"}}),b=new B({props:{title:"Partners",local:"partners",headingTag:"h2"}}),H=new B({props:{title:"Why Choose Inference Providers?",local:"why-choose-inference-providers",headingTag:"h2"}}),z=new B({props:{title:"Key Features",local:"key-features",headingTag:"h2"}}),K=new B({props:{title:"Getting Started",local:"getting-started",headingTag:"h2"}}),te=new B({props:{title:"Inference Playground",local:"inference-playground",headingTag:"h3"}}),se=new B({props:{title:"Authentication",local:"authentication",headingTag:"h3"}}),ie=new B({props:{title:"Quick Start - LLM",local:"quick-start---llm",headingTag:"h3"}}),pe=new B({props:{title:"Python",local:"python",headingTag:"h4"}}),W=new gl({props:{id:"python-clients",options:["huggingface_hub","openai","requests"],$$slots:{default:[$s]},$$scope:{ctx:$}}}),Me=new B({props:{title:"JavaScript",local:"javascript",headingTag:"h4"}}),G=new gl({props:{id:"javascript-clients",options:["huggingface.js","openai","fetch"],$$slots:{default:[Bs]},$$scope:{ctx:$}}}),de=new B({props:{title:"HTTP / cURL",local:"http--curl",headingTag:"h4"}}),he=new A({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZjaGF0JTJGY29tcGxldGlvbnMlMjAlNUMlMEElMjAlMjAlMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC1IJTIwJ0NvbnRlbnQtVHlwZSUzQSUyMGFwcGxpY2F0aW9uJTJGanNvbiclMjAlNUMlMEElMjAlMjAlMjAlMjAtZCUyMCclN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtZXNzYWdlcyUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkhvdyUyMG1hbnklMjBHJTIwaW4lMjBodWdnaW5nZmFjZSUzRiUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1vZGVsJTIyJTNBJTIwJTIyZGVlcHNlZWstYWklMkZEZWVwU2Vlay1WMy0wMzI0JTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyc3RyZWFtJTIyJTNBJTIwZmFsc2UlMEElMjAlMjAlMjAlMjAlN0Qn",highlighted:`curl https://router.huggingface.co/v1/chat/completions \\
    -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
    -H <span class="hljs-string">&#x27;Content-Type: application/json&#x27;</span> \\
    -d <span class="hljs-string">&#x27;{
        &quot;messages&quot;: [
            {
                &quot;role&quot;: &quot;user&quot;,
                &quot;content&quot;: &quot;How many G in huggingface?&quot;
            }
        ],
        &quot;model&quot;: &quot;deepseek-ai/DeepSeek-V3-0324&quot;,
        &quot;stream&quot;: false
    }&#x27;</span>`,wrap:!1}}),me=new B({props:{title:"Quick Start - Text-to-Image Generation",local:"quick-start---text-to-image-generation",headingTag:"h3"}}),Je=new B({props:{title:"Python",local:"python",headingTag:"h4"}}),Te=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBY2xpZW50JTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50KGFwaV9rZXklM0Rvcy5lbnZpcm9uJTVCJTIySEZfVE9LRU4lMjIlNUQpJTBBJTBBaW1hZ2UlMjAlM0QlMjBjbGllbnQudGV4dF90b19pbWFnZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0QlMjJBJTIwc2VyZW5lJTIwbGFrZSUyMHN1cnJvdW5kZWQlMjBieSUyMG1vdW50YWlucyUyMGF0JTIwc3Vuc2V0JTJDJTIwcGhvdG9yZWFsaXN0aWMlMjBzdHlsZSUyMiUyQyUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyYmxhY2stZm9yZXN0LWxhYnMlMkZGTFVYLjEtZGV2JTIyJTBBKSUwQSUwQSUyMyUyMFNhdmUlMjB0aGUlMjBnZW5lcmF0ZWQlMjBpbWFnZSUwQWltYWdlLnNhdmUoJTIyZ2VuZXJhdGVkX2ltYWdlLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> InferenceClient

client = InferenceClient(api_key=os.environ[<span class="hljs-string">&quot;HF_TOKEN&quot;</span>])

image = client.text_to_image(
    prompt=<span class="hljs-string">&quot;A serene lake surrounded by mountains at sunset, photorealistic style&quot;</span>,
    model=<span class="hljs-string">&quot;black-forest-labs/FLUX.1-dev&quot;</span>
)

<span class="hljs-comment"># Save the generated image</span>
image.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)`,wrap:!1}}),Ue=new B({props:{title:"JavaScript",local:"javascript",headingTag:"h4"}}),je=new A({props:{code:"aW1wb3J0JTIwJTdCJTIwSW5mZXJlbmNlQ2xpZW50JTIwJTdEJTIwZnJvbSUyMCUyMiU0MGh1Z2dpbmdmYWNlJTJGaW5mZXJlbmNlJTIyJTNCJTBBaW1wb3J0JTIwZnMlMjBmcm9tJTIwJTIyZnMlMjIlM0IlMEElMEFjb25zdCUyMGNsaWVudCUyMCUzRCUyMG5ldyUyMEluZmVyZW5jZUNsaWVudChwcm9jZXNzLmVudi5IRl9UT0tFTiklM0IlMEElMEFjb25zdCUyMGltYWdlQmxvYiUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LnRleHRUb0ltYWdlKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIyYmxhY2stZm9yZXN0LWxhYnMlMkZGTFVYLjEtZGV2JTIyJTJDJTBBJTIwJTIwaW5wdXRzJTNBJTBBJTIwJTIwJTIwJTIwJTIyQSUyMHNlcmVuZSUyMGxha2UlMjBzdXJyb3VuZGVkJTIwYnklMjBtb3VudGFpbnMlMjBhdCUyMHN1bnNldCUyQyUyMHBob3RvcmVhbGlzdGljJTIwc3R5bGUlMjIlMkMlMEElN0QpJTNCJTBBJTBBJTJGJTJGJTIwU2F2ZSUyMHRoZSUyMGltYWdlJTBBY29uc3QlMjBidWZmZXIlMjAlM0QlMjBCdWZmZXIuZnJvbShhd2FpdCUyMGltYWdlQmxvYi5hcnJheUJ1ZmZlcigpKSUzQiUwQWZzLndyaXRlRmlsZVN5bmMoJTIyZ2VuZXJhdGVkX2ltYWdlLnBuZyUyMiUyQyUyMGJ1ZmZlciklM0I=",highlighted:`<span class="hljs-keyword">import</span> { <span class="hljs-title class_">InferenceClient</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;@huggingface/inference&quot;</span>;
<span class="hljs-keyword">import</span> fs <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;fs&quot;</span>;

<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> <span class="hljs-title class_">InferenceClient</span>(process.<span class="hljs-property">env</span>.<span class="hljs-property">HF_TOKEN</span>);

<span class="hljs-keyword">const</span> imageBlob = <span class="hljs-keyword">await</span> client.<span class="hljs-title function_">textToImage</span>({
  <span class="hljs-attr">model</span>: <span class="hljs-string">&quot;black-forest-labs/FLUX.1-dev&quot;</span>,
  <span class="hljs-attr">inputs</span>:
    <span class="hljs-string">&quot;A serene lake surrounded by mountains at sunset, photorealistic style&quot;</span>,
});

<span class="hljs-comment">// Save the image</span>
<span class="hljs-keyword">const</span> buffer = <span class="hljs-title class_">Buffer</span>.<span class="hljs-title function_">from</span>(<span class="hljs-keyword">await</span> imageBlob.<span class="hljs-title function_">arrayBuffer</span>());
fs.<span class="hljs-title function_">writeFileSync</span>(<span class="hljs-string">&quot;generated_image.png&quot;</span>, buffer);`,wrap:!1}}),Ie=new B({props:{title:"Provider Selection",local:"provider-selection",headingTag:"h2"}}),$e=new B({props:{title:"API as a Proxy Service",local:"api-as-a-proxy-service",headingTag:"h3"}}),Be=new B({props:{title:"Client-Side Provider Selection (Inference Clients)",local:"client-side-provider-selection-inference-clients",headingTag:"h3"}}),S=new gl({props:{id:"client-side-provider-selection",options:["javascript","python"],$$slots:{default:[qs]},$$scope:{ctx:$}}}),xe=new B({props:{title:"Alternative: OpenAI-Compatible Chat Completions Endpoint (Chat Only)",local:"alternative-openai-compatible-chat-completions-endpoint-chat-only",headingTag:"h3"}}),Q=new gl({props:{id:"openai-compatible",options:["javascript","python"],$$slots:{default:[Ws]},$$scope:{ctx:$}}}),Se=new A({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZjaGF0JTJGY29tcGxldGlvbnMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJtZXRhLWxsYW1hJTJGTGxhbWEtMy4xLThCLUluc3RydWN0JTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIybWVzc2FnZXMlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIZWxsbyElMjIlMEElMjAlMjAlMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlMjAlMjAlNUQlMEElMjAlMjAlN0Qn",highlighted:`curl https://router.huggingface.co/v1/chat/completions \\
  -H <span class="hljs-string">&quot;Authorization: Bearer <span class="hljs-variable">$HF_TOKEN</span>&quot;</span> \\
  -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> \\
  -d <span class="hljs-string">&#x27;{
    &quot;model&quot;: &quot;meta-llama/Llama-3.1-8B-Instruct&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;Hello!&quot;
      }
    ]
  }&#x27;</span>`,wrap:!1}}),Ve=new B({props:{title:"Choosing the Right Approach",local:"choosing-the-right-approach",headingTag:"h3"}}),Pe=new B({props:{title:"Next Steps",local:"next-steps",headingTag:"h2"}}),De=new ws({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/inference-providers/index.md"}}),{c(){n=h("meta"),y=r(),i=h("p"),M=r(),g(p.$$.fragment),u=r(),g(a.$$.fragment),f=r(),c=h("div"),c.innerHTML=C,Z=r(),v=h("p"),v.textContent=k,d=r(),g(b.$$.fragment),et=r(),E=h("p"),E.textContent=Tl,tt=r(),V=h("table"),V.innerHTML=Ul,lt=r(),g(H.$$.fragment),st=r(),_=h("p"),_.textContent=wl,nt=r(),L=h("p"),L.innerHTML=jl,at=r(),Y=h("p"),Y.innerHTML=Il,it=r(),R=h("p"),R.innerHTML=Cl,rt=r(),F=h("p"),F.textContent=$l,ot=r(),P=h("ul"),P.innerHTML=bl,pt=r(),X=h("p"),X.innerHTML=vl,ct=r(),g(z.$$.fragment),Mt=r(),D=h("ul"),D.innerHTML=Zl,ut=r(),g(K.$$.fragment),dt=r(),O=h("p"),O.textContent=Bl,yt=r(),ee=h("p"),ee.innerHTML=Al,ht=r(),g(te.$$.fragment),mt=r(),le=h("p"),le.innerHTML=kl,ft=r(),N=h("a"),N.innerHTML=ql,Jt=r(),g(se.$$.fragment),gt=r(),ne=h("p"),ne.innerHTML=xl,Tt=r(),ae=h("p"),ae.innerHTML=Nl,Ut=r(),g(ie.$$.fragment),wt=r(),re=h("p"),re.textContent=Wl,jt=r(),oe=h("p"),oe.textContent=Gl,It=r(),g(pe.$$.fragment),Ct=r(),ce=h("p"),ce.textContent=Sl,$t=r(),g(W.$$.fragment),bt=r(),g(Me.$$.fragment),vt=r(),ue=h("p"),ue.textContent=Ql,Zt=r(),g(G.$$.fragment),Bt=r(),g(de.$$.fragment),At=r(),ye=h("p"),ye.innerHTML=El,kt=r(),g(he.$$.fragment),qt=r(),g(me.$$.fragment),xt=r(),fe=h("p"),fe.innerHTML=Vl,Nt=r(),g(Je.$$.fragment),Wt=r(),ge=h("p"),ge.innerHTML=Hl,Gt=r(),g(Te.$$.fragment),St=r(),g(Ue.$$.fragment),Qt=r(),we=h("p"),we.textContent=_l,Et=r(),g(je.$$.fragment),Vt=r(),g(Ie.$$.fragment),Ht=r(),Ce=h("p"),Ce.textContent=Ll,_t=r(),g($e.$$.fragment),Lt=r(),be=h("p"),be.textContent=Yl,Yt=r(),ve=h("ul"),ve.innerHTML=Rl,Rt=r(),Ze=h("p"),Ze.innerHTML=Fl,Ft=r(),g(Be.$$.fragment),Pt=r(),Ae=h("p"),Ae.textContent=Pl,Xt=r(),g(S.$$.fragment),zt=r(),ke=h("p"),ke.innerHTML=Xl,Dt=r(),qe=h("ul"),qe.innerHTML=zl,Kt=r(),g(xe.$$.fragment),Ot=r(),Ne=h("p"),Ne.textContent=Dl,el=r(),We=h("p"),We.innerHTML=Kl,tl=r(),g(Q.$$.fragment),ll=r(),Ge=h("p"),Ge.textContent=Ol,sl=r(),g(Se.$$.fragment),nl=r(),Qe=h("p"),Qe.innerHTML=es,al=r(),Ee=h("ul"),Ee.innerHTML=ts,il=r(),g(Ve.$$.fragment),rl=r(),He=h("p"),He.innerHTML=ls,ol=r(),_e=h("ul"),_e.innerHTML=ss,pl=r(),Le=h("p"),Le.innerHTML=ns,cl=r(),Ye=h("ul"),Ye.innerHTML=as,Ml=r(),Re=h("p"),Re.innerHTML=is,ul=r(),Fe=h("ul"),Fe.innerHTML=rs,dl=r(),g(Pe.$$.fragment),yl=r(),Xe=h("p"),Xe.textContent=os,hl=r(),ze=h("ul"),ze.innerHTML=ps,ml=r(),g(De.$$.fragment),fl=r(),Ke=h("p"),this.h()},l(e){const t=gs("svelte-u9bgzb",document.head);n=m(t,"META",{name:!0,content:!0}),t.forEach(l),y=o(e),i=m(e,"P",{}),ys(i).forEach(l),M=o(e),T(p.$$.fragment,e),u=o(e),T(a.$$.fragment,e),f=o(e),c=m(e,"DIV",{class:!0,"data-svelte-h":!0}),J(c)!=="svelte-11agwm4"&&(c.innerHTML=C),Z=o(e),v=m(e,"P",{"data-svelte-h":!0}),J(v)!=="svelte-mizacy"&&(v.textContent=k),d=o(e),T(b.$$.fragment,e),et=o(e),E=m(e,"P",{"data-svelte-h":!0}),J(E)!=="svelte-1ed4twc"&&(E.textContent=Tl),tt=o(e),V=m(e,"TABLE",{"data-svelte-h":!0}),J(V)!=="svelte-xqqeik"&&(V.innerHTML=Ul),lt=o(e),T(H.$$.fragment,e),st=o(e),_=m(e,"P",{"data-svelte-h":!0}),J(_)!=="svelte-fg40bn"&&(_.textContent=wl),nt=o(e),L=m(e,"P",{"data-svelte-h":!0}),J(L)!=="svelte-xatg1d"&&(L.innerHTML=jl),at=o(e),Y=m(e,"P",{"data-svelte-h":!0}),J(Y)!=="svelte-h2iiik"&&(Y.innerHTML=Il),it=o(e),R=m(e,"P",{"data-svelte-h":!0}),J(R)!=="svelte-1k689uw"&&(R.innerHTML=Cl),rt=o(e),F=m(e,"P",{"data-svelte-h":!0}),J(F)!=="svelte-60lnnv"&&(F.textContent=$l),ot=o(e),P=m(e,"UL",{"data-svelte-h":!0}),J(P)!=="svelte-jacsil"&&(P.innerHTML=bl),pt=o(e),X=m(e,"P",{"data-svelte-h":!0}),J(X)!=="svelte-sreoza"&&(X.innerHTML=vl),ct=o(e),T(z.$$.fragment,e),Mt=o(e),D=m(e,"UL",{"data-svelte-h":!0}),J(D)!=="svelte-qntfxk"&&(D.innerHTML=Zl),ut=o(e),T(K.$$.fragment,e),dt=o(e),O=m(e,"P",{"data-svelte-h":!0}),J(O)!=="svelte-8qewzy"&&(O.textContent=Bl),yt=o(e),ee=m(e,"P",{"data-svelte-h":!0}),J(ee)!=="svelte-15wqn05"&&(ee.innerHTML=Al),ht=o(e),T(te.$$.fragment,e),mt=o(e),le=m(e,"P",{"data-svelte-h":!0}),J(le)!=="svelte-1kvf1l6"&&(le.innerHTML=kl),ft=o(e),N=m(e,"A",{href:!0,target:!0,"data-svelte-h":!0}),J(N)!=="svelte-nl4fks"&&(N.innerHTML=ql),Jt=o(e),T(se.$$.fragment,e),gt=o(e),ne=m(e,"P",{"data-svelte-h":!0}),J(ne)!=="svelte-p5g40u"&&(ne.innerHTML=xl),Tt=o(e),ae=m(e,"P",{"data-svelte-h":!0}),J(ae)!=="svelte-111b79b"&&(ae.innerHTML=Nl),Ut=o(e),T(ie.$$.fragment,e),wt=o(e),re=m(e,"P",{"data-svelte-h":!0}),J(re)!=="svelte-ya5dcf"&&(re.textContent=Wl),jt=o(e),oe=m(e,"P",{"data-svelte-h":!0}),J(oe)!=="svelte-18cvct0"&&(oe.textContent=Gl),It=o(e),T(pe.$$.fragment,e),Ct=o(e),ce=m(e,"P",{"data-svelte-h":!0}),J(ce)!=="svelte-b4svk"&&(ce.textContent=Sl),$t=o(e),T(W.$$.fragment,e),bt=o(e),T(Me.$$.fragment,e),vt=o(e),ue=m(e,"P",{"data-svelte-h":!0}),J(ue)!=="svelte-1j7dkjh"&&(ue.textContent=Ql),Zt=o(e),T(G.$$.fragment,e),Bt=o(e),T(de.$$.fragment,e),At=o(e),ye=m(e,"P",{"data-svelte-h":!0}),J(ye)!=="svelte-1dfo09y"&&(ye.innerHTML=El),kt=o(e),T(he.$$.fragment,e),qt=o(e),T(me.$$.fragment,e),xt=o(e),fe=m(e,"P",{"data-svelte-h":!0}),J(fe)!=="svelte-104cbnb"&&(fe.innerHTML=Vl),Nt=o(e),T(Je.$$.fragment,e),Wt=o(e),ge=m(e,"P",{"data-svelte-h":!0}),J(ge)!=="svelte-k7ro1o"&&(ge.innerHTML=Hl),Gt=o(e),T(Te.$$.fragment,e),St=o(e),T(Ue.$$.fragment,e),Qt=o(e),we=m(e,"P",{"data-svelte-h":!0}),J(we)!=="svelte-1e8s5p0"&&(we.textContent=_l),Et=o(e),T(je.$$.fragment,e),Vt=o(e),T(Ie.$$.fragment,e),Ht=o(e),Ce=m(e,"P",{"data-svelte-h":!0}),J(Ce)!=="svelte-1xog8yx"&&(Ce.textContent=Ll),_t=o(e),T($e.$$.fragment,e),Lt=o(e),be=m(e,"P",{"data-svelte-h":!0}),J(be)!=="svelte-1spbtw4"&&(be.textContent=Yl),Yt=o(e),ve=m(e,"UL",{"data-svelte-h":!0}),J(ve)!=="svelte-7jdm5r"&&(ve.innerHTML=Rl),Rt=o(e),Ze=m(e,"P",{"data-svelte-h":!0}),J(Ze)!=="svelte-13kg8nq"&&(Ze.innerHTML=Fl),Ft=o(e),T(Be.$$.fragment,e),Pt=o(e),Ae=m(e,"P",{"data-svelte-h":!0}),J(Ae)!=="svelte-2xagg0"&&(Ae.textContent=Pl),Xt=o(e),T(S.$$.fragment,e),zt=o(e),ke=m(e,"P",{"data-svelte-h":!0}),J(ke)!=="svelte-1x1ysu4"&&(ke.innerHTML=Xl),Dt=o(e),qe=m(e,"UL",{"data-svelte-h":!0}),J(qe)!=="svelte-1q9hecy"&&(qe.innerHTML=zl),Kt=o(e),T(xe.$$.fragment,e),Ot=o(e),Ne=m(e,"P",{"data-svelte-h":!0}),J(Ne)!=="svelte-slyst7"&&(Ne.textContent=Dl),el=o(e),We=m(e,"P",{"data-svelte-h":!0}),J(We)!=="svelte-rak2w9"&&(We.innerHTML=Kl),tl=o(e),T(Q.$$.fragment,e),ll=o(e),Ge=m(e,"P",{"data-svelte-h":!0}),J(Ge)!=="svelte-1hqb6hm"&&(Ge.textContent=Ol),sl=o(e),T(Se.$$.fragment,e),nl=o(e),Qe=m(e,"P",{"data-svelte-h":!0}),J(Qe)!=="svelte-dcww01"&&(Qe.innerHTML=es),al=o(e),Ee=m(e,"UL",{"data-svelte-h":!0}),J(Ee)!=="svelte-1ll4xf5"&&(Ee.innerHTML=ts),il=o(e),T(Ve.$$.fragment,e),rl=o(e),He=m(e,"P",{"data-svelte-h":!0}),J(He)!=="svelte-t3us3z"&&(He.innerHTML=ls),ol=o(e),_e=m(e,"UL",{"data-svelte-h":!0}),J(_e)!=="svelte-13s5asy"&&(_e.innerHTML=ss),pl=o(e),Le=m(e,"P",{"data-svelte-h":!0}),J(Le)!=="svelte-c2rkew"&&(Le.innerHTML=ns),cl=o(e),Ye=m(e,"UL",{"data-svelte-h":!0}),J(Ye)!=="svelte-7uci6x"&&(Ye.innerHTML=as),Ml=o(e),Re=m(e,"P",{"data-svelte-h":!0}),J(Re)!=="svelte-vidaw3"&&(Re.innerHTML=is),ul=o(e),Fe=m(e,"UL",{"data-svelte-h":!0}),J(Fe)!=="svelte-73asmq"&&(Fe.innerHTML=rs),dl=o(e),T(Pe.$$.fragment,e),yl=o(e),Xe=m(e,"P",{"data-svelte-h":!0}),J(Xe)!=="svelte-1pnlwxm"&&(Xe.textContent=os),hl=o(e),ze=m(e,"UL",{"data-svelte-h":!0}),J(ze)!=="svelte-djn6lh"&&(ze.innerHTML=ps),ml=o(e),T(De.$$.fragment,e),fl=o(e),Ke=m(e,"P",{}),ys(Ke).forEach(l),this.h()},h(){Oe(n,"name","hf:doc:metadata"),Oe(n,"content",Ss),Oe(c,"class","flex justify-center"),Oe(N,"href","https://huggingface.co/playground"),Oe(N,"target","blank")},m(e,t){Ts(document.head,n),s(e,y,t),s(e,i,t),s(e,M,t),U(p,e,t),s(e,u,t),U(a,e,t),s(e,f,t),s(e,c,t),s(e,Z,t),s(e,v,t),s(e,d,t),U(b,e,t),s(e,et,t),s(e,E,t),s(e,tt,t),s(e,V,t),s(e,lt,t),U(H,e,t),s(e,st,t),s(e,_,t),s(e,nt,t),s(e,L,t),s(e,at,t),s(e,Y,t),s(e,it,t),s(e,R,t),s(e,rt,t),s(e,F,t),s(e,ot,t),s(e,P,t),s(e,pt,t),s(e,X,t),s(e,ct,t),U(z,e,t),s(e,Mt,t),s(e,D,t),s(e,ut,t),U(K,e,t),s(e,dt,t),s(e,O,t),s(e,yt,t),s(e,ee,t),s(e,ht,t),U(te,e,t),s(e,mt,t),s(e,le,t),s(e,ft,t),s(e,N,t),s(e,Jt,t),U(se,e,t),s(e,gt,t),s(e,ne,t),s(e,Tt,t),s(e,ae,t),s(e,Ut,t),U(ie,e,t),s(e,wt,t),s(e,re,t),s(e,jt,t),s(e,oe,t),s(e,It,t),U(pe,e,t),s(e,Ct,t),s(e,ce,t),s(e,$t,t),U(W,e,t),s(e,bt,t),U(Me,e,t),s(e,vt,t),s(e,ue,t),s(e,Zt,t),U(G,e,t),s(e,Bt,t),U(de,e,t),s(e,At,t),s(e,ye,t),s(e,kt,t),U(he,e,t),s(e,qt,t),U(me,e,t),s(e,xt,t),s(e,fe,t),s(e,Nt,t),U(Je,e,t),s(e,Wt,t),s(e,ge,t),s(e,Gt,t),U(Te,e,t),s(e,St,t),U(Ue,e,t),s(e,Qt,t),s(e,we,t),s(e,Et,t),U(je,e,t),s(e,Vt,t),U(Ie,e,t),s(e,Ht,t),s(e,Ce,t),s(e,_t,t),U($e,e,t),s(e,Lt,t),s(e,be,t),s(e,Yt,t),s(e,ve,t),s(e,Rt,t),s(e,Ze,t),s(e,Ft,t),U(Be,e,t),s(e,Pt,t),s(e,Ae,t),s(e,Xt,t),U(S,e,t),s(e,zt,t),s(e,ke,t),s(e,Dt,t),s(e,qe,t),s(e,Kt,t),U(xe,e,t),s(e,Ot,t),s(e,Ne,t),s(e,el,t),s(e,We,t),s(e,tl,t),U(Q,e,t),s(e,ll,t),s(e,Ge,t),s(e,sl,t),U(Se,e,t),s(e,nl,t),s(e,Qe,t),s(e,al,t),s(e,Ee,t),s(e,il,t),U(Ve,e,t),s(e,rl,t),s(e,He,t),s(e,ol,t),s(e,_e,t),s(e,pl,t),s(e,Le,t),s(e,cl,t),s(e,Ye,t),s(e,Ml,t),s(e,Re,t),s(e,ul,t),s(e,Fe,t),s(e,dl,t),U(Pe,e,t),s(e,yl,t),s(e,Xe,t),s(e,hl,t),s(e,ze,t),s(e,ml,t),U(De,e,t),s(e,fl,t),s(e,Ke,t),Jl=!0},p(e,[t]){const cs={};t&2&&(cs.$$scope={dirty:t,ctx:e}),W.$set(cs);const Ms={};t&2&&(Ms.$$scope={dirty:t,ctx:e}),G.$set(Ms);const us={};t&2&&(us.$$scope={dirty:t,ctx:e}),S.$set(us);const ds={};t&2&&(ds.$$scope={dirty:t,ctx:e}),Q.$set(ds)},i(e){Jl||(w(p.$$.fragment,e),w(a.$$.fragment,e),w(b.$$.fragment,e),w(H.$$.fragment,e),w(z.$$.fragment,e),w(K.$$.fragment,e),w(te.$$.fragment,e),w(se.$$.fragment,e),w(ie.$$.fragment,e),w(pe.$$.fragment,e),w(W.$$.fragment,e),w(Me.$$.fragment,e),w(G.$$.fragment,e),w(de.$$.fragment,e),w(he.$$.fragment,e),w(me.$$.fragment,e),w(Je.$$.fragment,e),w(Te.$$.fragment,e),w(Ue.$$.fragment,e),w(je.$$.fragment,e),w(Ie.$$.fragment,e),w($e.$$.fragment,e),w(Be.$$.fragment,e),w(S.$$.fragment,e),w(xe.$$.fragment,e),w(Q.$$.fragment,e),w(Se.$$.fragment,e),w(Ve.$$.fragment,e),w(Pe.$$.fragment,e),w(De.$$.fragment,e),Jl=!0)},o(e){j(p.$$.fragment,e),j(a.$$.fragment,e),j(b.$$.fragment,e),j(H.$$.fragment,e),j(z.$$.fragment,e),j(K.$$.fragment,e),j(te.$$.fragment,e),j(se.$$.fragment,e),j(ie.$$.fragment,e),j(pe.$$.fragment,e),j(W.$$.fragment,e),j(Me.$$.fragment,e),j(G.$$.fragment,e),j(de.$$.fragment,e),j(he.$$.fragment,e),j(me.$$.fragment,e),j(Je.$$.fragment,e),j(Te.$$.fragment,e),j(Ue.$$.fragment,e),j(je.$$.fragment,e),j(Ie.$$.fragment,e),j($e.$$.fragment,e),j(Be.$$.fragment,e),j(S.$$.fragment,e),j(xe.$$.fragment,e),j(Q.$$.fragment,e),j(Se.$$.fragment,e),j(Ve.$$.fragment,e),j(Pe.$$.fragment,e),j(De.$$.fragment,e),Jl=!1},d(e){e&&(l(y),l(i),l(M),l(u),l(f),l(c),l(Z),l(v),l(d),l(et),l(E),l(tt),l(V),l(lt),l(st),l(_),l(nt),l(L),l(at),l(Y),l(it),l(R),l(rt),l(F),l(ot),l(P),l(pt),l(X),l(ct),l(Mt),l(D),l(ut),l(dt),l(O),l(yt),l(ee),l(ht),l(mt),l(le),l(ft),l(N),l(Jt),l(gt),l(ne),l(Tt),l(ae),l(Ut),l(wt),l(re),l(jt),l(oe),l(It),l(Ct),l(ce),l($t),l(bt),l(vt),l(ue),l(Zt),l(Bt),l(At),l(ye),l(kt),l(qt),l(xt),l(fe),l(Nt),l(Wt),l(ge),l(Gt),l(St),l(Qt),l(we),l(Et),l(Vt),l(Ht),l(Ce),l(_t),l(Lt),l(be),l(Yt),l(ve),l(Rt),l(Ze),l(Ft),l(Pt),l(Ae),l(Xt),l(zt),l(ke),l(Dt),l(qe),l(Kt),l(Ot),l(Ne),l(el),l(We),l(tl),l(ll),l(Ge),l(sl),l(nl),l(Qe),l(al),l(Ee),l(il),l(rl),l(He),l(ol),l(_e),l(pl),l(Le),l(cl),l(Ye),l(Ml),l(Re),l(ul),l(Fe),l(dl),l(yl),l(Xe),l(hl),l(ze),l(ml),l(fl),l(Ke)),l(n),I(p,e),I(a,e),I(b,e),I(H,e),I(z,e),I(K,e),I(te,e),I(se,e),I(ie,e),I(pe,e),I(W,e),I(Me,e),I(G,e),I(de,e),I(he,e),I(me,e),I(Je,e),I(Te,e),I(Ue,e),I(je,e),I(Ie,e),I($e,e),I(Be,e),I(S,e),I(xe,e),I(Q,e),I(Se,e),I(Ve,e),I(Pe,e),I(De,e)}}}const Ss='{"title":"Inference Providers","local":"inference-providers","sections":[{"title":"Partners","local":"partners","sections":[],"depth":2},{"title":"Why Choose Inference Providers?","local":"why-choose-inference-providers","sections":[],"depth":2},{"title":"Key Features","local":"key-features","sections":[],"depth":2},{"title":"Getting Started","local":"getting-started","sections":[{"title":"Inference Playground","local":"inference-playground","sections":[],"depth":3},{"title":"Authentication","local":"authentication","sections":[],"depth":3},{"title":"Quick Start - LLM","local":"quick-start---llm","sections":[{"title":"Python","local":"python","sections":[],"depth":4},{"title":"JavaScript","local":"javascript","sections":[],"depth":4},{"title":"HTTP / cURL","local":"http--curl","sections":[],"depth":4}],"depth":3},{"title":"Quick Start - Text-to-Image Generation","local":"quick-start---text-to-image-generation","sections":[{"title":"Python","local":"python","sections":[],"depth":4},{"title":"JavaScript","local":"javascript","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"Provider Selection","local":"provider-selection","sections":[{"title":"API as a Proxy Service","local":"api-as-a-proxy-service","sections":[],"depth":3},{"title":"Client-Side Provider Selection (Inference Clients)","local":"client-side-provider-selection-inference-clients","sections":[],"depth":3},{"title":"Alternative: OpenAI-Compatible Chat Completions Endpoint (Chat Only)","local":"alternative-openai-compatible-chat-completions-endpoint-chat-only","sections":[],"depth":3},{"title":"Choosing the Right Approach","local":"choosing-the-right-approach","sections":[],"depth":3}],"depth":2},{"title":"Next Steps","local":"next-steps","sections":[],"depth":2}],"depth":1}';function Qs($){return ms(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rs extends fs{constructor(n){super(),Js(this,n,Qs,Gs,hs,{})}}export{Rs as component};
