import{s as Zl,o as ql,n as _}from"../chunks/scheduler.ddeee2a5.js";import{S as xl,i as kl,e as u,s as o,c as J,h as Gl,a as M,d as t,b as r,f as Bl,g,j as h,k as ct,l as Sl,m as s,n as w,t as U,o as j,p as I}from"../chunks/index.10b70568.js";import{C as Ql}from"../chunks/CopyLLMTxtMenu.48a5d8e9.js";import{C as A}from"../chunks/CodeBlock.7ca4c11d.js";import{H as G,E as Nl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c3713d0b.js";import{H as qs,a as V}from"../chunks/HfOption.1e773499.js";function Hl(k){let a,f='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.',p,y,d="In your terminal, install the Hugging Face Hub Python client and log in:",T,i,m,v,b="You can now use the the client with a Python interpreter.",x,$,B='By default, our system automatically routes your request to the first available provider for the specified model, following your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.',q,n,C="You can change the provider selection policy by appending <code>:fastest</code> (selects the provider with highest throughput) or <code>:cheapest</code> (selects the provider with lowest price per output token) to the model id (e.g., <code>openai/gpt-oss-120b:fastest</code>).",N,S,E="You can also select the provider of your choice by appending the provider name to the model id (e.g. <code>&quot;openai/gpt-oss-120b:sambanova&quot;</code>).",H,Q,W;return i=new A({props:{code:"cGlwJTIwaW5zdGFsbCUyMGh1Z2dpbmdmYWNlX2h1YiUwQWhmJTIwYXV0aCUyMGxvZ2luJTIwJTIzJTIwZ2V0JTIwYSUyMHJlYWQlMjB0b2tlbiUyMGZyb20lMjBoZi5jbyUyRnNldHRpbmdzJTJGdG9rZW5z",highlighted:`pip install huggingface_hub
hf auth login # get a read token from hf.co/settings/tokens`,wrap:!1}}),Q=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBY2xpZW50JTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50KCklMEElMEFjb21wbGV0aW9uJTIwJTNEJTIwY2xpZW50LmNoYXQuY29tcGxldGlvbnMuY3JlYXRlKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyb3BlbmFpJTJGZ3B0LW9zcy0xMjBiJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWVzc2FnZXMlM0QlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIb3clMjBtYW55JTIwJ0cncyUyMGluJTIwJ2h1Z2dpbmdmYWNlJyUzRiUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSklMEElMEFwcmludChjb21wbGV0aW9uLmNob2ljZXMlNUIwJTVELm1lc3NhZ2Up",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;openai/gpt-oss-120b&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(){a=u("p"),a.innerHTML=f,p=o(),y=u("p"),y.textContent=d,T=o(),J(i.$$.fragment),m=o(),v=u("p"),v.textContent=b,x=o(),$=u("p"),$.innerHTML=B,q=o(),n=u("p"),n.innerHTML=C,N=o(),S=u("p"),S.innerHTML=E,H=o(),J(Q.$$.fragment)},l(c){a=M(c,"P",{"data-svelte-h":!0}),h(a)!=="svelte-1mw7idw"&&(a.innerHTML=f),p=r(c),y=M(c,"P",{"data-svelte-h":!0}),h(y)!=="svelte-wrbzp4"&&(y.textContent=d),T=r(c),g(i.$$.fragment,c),m=r(c),v=M(c,"P",{"data-svelte-h":!0}),h(v)!=="svelte-tibiqq"&&(v.textContent=b),x=r(c),$=M(c,"P",{"data-svelte-h":!0}),h($)!=="svelte-59nu2d"&&($.innerHTML=B),q=r(c),n=M(c,"P",{"data-svelte-h":!0}),h(n)!=="svelte-1ij5aqo"&&(n.innerHTML=C),N=r(c),S=M(c,"P",{"data-svelte-h":!0}),h(S)!=="svelte-18ftv0p"&&(S.innerHTML=E),H=r(c),g(Q.$$.fragment,c)},m(c,Z){s(c,a,Z),s(c,p,Z),s(c,y,Z),s(c,T,Z),w(i,c,Z),s(c,m,Z),s(c,v,Z),s(c,x,Z),s(c,$,Z),s(c,q,Z),s(c,n,Z),s(c,N,Z),s(c,S,Z),s(c,H,Z),w(Q,c,Z),W=!0},p:_,i(c){W||(U(i.$$.fragment,c),U(Q.$$.fragment,c),W=!0)},o(c){j(i.$$.fragment,c),j(Q.$$.fragment,c),W=!1},d(c){c&&(t(a),t(p),t(y),t(T),t(m),t(v),t(x),t($),t(q),t(n),t(N),t(S),t(H)),I(i,c),I(Q,c)}}}function Al(k){let a,f="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.",p,y,d='By default, our system automatically routes your request to the first available provider for the specified model, following your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.',T,i,m="You can change the provider selection policy by appending <code>:fastest</code> (selects the provider with highest throughput) or <code>:cheapest</code> (selects the provider with lowest price per output token) to the model id (e.g., <code>openai/gpt-oss-120b:fastest</code>).",v,b,x="You can also select the provider of your choice by appending the provider name to the model id (e.g. <code>&quot;openai/gpt-oss-120b:sambanova&quot;</code>).",$,B,q;return B=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwb3BlbmFpJTIwaW1wb3J0JTIwT3BlbkFJJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5lbnZpcm9uJTVCJTIySEZfVE9LRU4lMjIlNUQlMkMlMEEpJTBBJTBBY29tcGxldGlvbiUyMCUzRCUyMGNsaWVudC5jaGF0LmNvbXBsZXRpb25zLmNyZWF0ZSglMEElMjAlMjAlMjAlMjBtb2RlbCUzRCUyMm9wZW5haSUyRmdwdC1vc3MtMTIwYiUzQWZhc3Rlc3QlMjIlMkMlMEElMjAlMjAlMjAlMjBtZXNzYWdlcyUzRCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkhvdyUyMG1hbnklMjAnRydzJTIwaW4lMjAnaHVnZ2luZ2ZhY2UnJTNGJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTVEJTJDJTBBKQ==",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;openai/gpt-oss-120b:fastest&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(){a=u("p"),a.innerHTML=f,p=o(),y=u("p"),y.innerHTML=d,T=o(),i=u("p"),i.innerHTML=m,v=o(),b=u("p"),b.innerHTML=x,$=o(),J(B.$$.fragment)},l(n){a=M(n,"P",{"data-svelte-h":!0}),h(a)!=="svelte-1jk1o8z"&&(a.innerHTML=f),p=r(n),y=M(n,"P",{"data-svelte-h":!0}),h(y)!=="svelte-59nu2d"&&(y.innerHTML=d),T=r(n),i=M(n,"P",{"data-svelte-h":!0}),h(i)!=="svelte-1ij5aqo"&&(i.innerHTML=m),v=r(n),b=M(n,"P",{"data-svelte-h":!0}),h(b)!=="svelte-18ftv0p"&&(b.innerHTML=x),$=r(n),g(B.$$.fragment,n)},m(n,C){s(n,a,C),s(n,p,C),s(n,y,C),s(n,T,C),s(n,i,C),s(n,v,C),s(n,b,C),s(n,$,C),w(B,n,C),q=!0},p:_,i(n){q||(U(B.$$.fragment,n),q=!0)},o(n){j(B.$$.fragment,n),q=!1},d(n){n&&(t(a),t(p),t(y),t(T),t(i),t(v),t(b),t($)),I(B,n)}}}function Wl(k){let a,f="For maximum control and interoperability with custom frameworks, use our OpenAI-compatible REST API directly.",p,y,d='By default, our system automatically routes your request to the first available provider for the specified model, following your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.',T,i,m="You can change the provider selection policy by appending <code>:fastest</code> (selects the provider with highest throughput) or <code>:cheapest</code> (selects the provider with lowest price per output token) to the model id (e.g., <code>openai/gpt-oss-120b:fastest</code>).",v,b,x="You can also select the provider of your choice by appending the provider name to the model id (e.g. <code>&quot;openai/gpt-oss-120b:sambanova&quot;</code>).",$,B,q;return B=new A({props:{code:"aW1wb3J0JTIwb3MlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQSUwQUFQSV9VUkwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTJGY2hhdCUyRmNvbXBsZXRpb25zJTIyJTBBaGVhZGVycyUyMCUzRCUyMCU3QiUyMkF1dGhvcml6YXRpb24lMjIlM0ElMjBmJTIyQmVhcmVyJTIwJTdCb3MuZW52aXJvbiU1QidIRl9UT0tFTiclNUQlN0QlMjIlN0QlMEFwYXlsb2FkJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIybWVzc2FnZXMlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIb3clMjBtYW55JTIwJ0cncyUyMGluJTIwJ2h1Z2dpbmdmYWNlJyUzRiUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMm1vZGVsJTIyJTNBJTIwJTIyb3BlbmFpJTJGZ3B0LW9zcy0xMjBiJTNBZmFzdGVzdCUyMiUyQyUwQSU3RCUwQSUwQXJlc3BvbnNlJTIwJTNEJTIwcmVxdWVzdHMucG9zdChBUElfVVJMJTJDJTIwaGVhZGVycyUzRGhlYWRlcnMlMkMlMjBqc29uJTNEcGF5bG9hZCklMEFwcmludChyZXNwb25zZS5qc29uKCklNUIlMjJjaG9pY2VzJTIyJTVEJTVCMCU1RCU1QiUyMm1lc3NhZ2UlMjIlNUQp",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;openai/gpt-oss-120b:fastest&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(){a=u("p"),a.textContent=f,p=o(),y=u("p"),y.innerHTML=d,T=o(),i=u("p"),i.innerHTML=m,v=o(),b=u("p"),b.innerHTML=x,$=o(),J(B.$$.fragment)},l(n){a=M(n,"P",{"data-svelte-h":!0}),h(a)!=="svelte-6xb179"&&(a.textContent=f),p=r(n),y=M(n,"P",{"data-svelte-h":!0}),h(y)!=="svelte-59nu2d"&&(y.innerHTML=d),T=r(n),i=M(n,"P",{"data-svelte-h":!0}),h(i)!=="svelte-1ij5aqo"&&(i.innerHTML=m),v=r(n),b=M(n,"P",{"data-svelte-h":!0}),h(b)!=="svelte-18ftv0p"&&(b.innerHTML=x),$=r(n),g(B.$$.fragment,n)},m(n,C){s(n,a,C),s(n,p,C),s(n,y,C),s(n,T,C),s(n,i,C),s(n,v,C),s(n,b,C),s(n,$,C),w(B,n,C),q=!0},p:_,i(n){q||(U(B.$$.fragment,n),q=!0)},o(n){j(B.$$.fragment,n),q=!1},d(n){n&&(t(a),t(p),t(y),t(T),t(i),t(v),t(b),t($)),I(B,n)}}}function El(k){let a,f,p,y,d,T;return a=new V({props:{id:"python-clients",option:"huggingface_hub",$$slots:{default:[Hl]},$$scope:{ctx:k}}}),p=new V({props:{id:"python-clients",option:"openai",$$slots:{default:[Al]},$$scope:{ctx:k}}}),d=new V({props:{id:"python-clients",option:"requests",$$slots:{default:[Wl]},$$scope:{ctx:k}}}),{c(){J(a.$$.fragment),f=o(),J(p.$$.fragment),y=o(),J(d.$$.fragment)},l(i){g(a.$$.fragment,i),f=r(i),g(p.$$.fragment,i),y=r(i),g(d.$$.fragment,i)},m(i,m){w(a,i,m),s(i,f,m),w(p,i,m),s(i,y,m),w(d,i,m),T=!0},p(i,m){const v={};m&2&&(v.$$scope={dirty:m,ctx:i}),a.$set(v);const b={};m&2&&(b.$$scope={dirty:m,ctx:i}),p.$set(b);const x={};m&2&&(x.$$scope={dirty:m,ctx:i}),d.$set(x)},i(i){T||(U(a.$$.fragment,i),U(p.$$.fragment,i),U(d.$$.fragment,i),T=!0)},o(i){j(a.$$.fragment,i),j(p.$$.fragment,i),j(d.$$.fragment,i),T=!1},d(i){i&&(t(f),t(y)),I(a,i),I(p,i),I(d,i)}}}function Vl(k){let a,f="Our JavaScript SDK provides a convenient interface with automatic provider selection and TypeScript support.",p,y,d="Install with NPM:",T,i,m,v,b="Then use the client with Javascript.",x,$,B='By default, our system automatically routes your request to the first available provider for the specified model, following your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.',q,n,C="You can change the provider selection policy by appending <code>:fastest</code> (selects the provider with highest throughput) or <code>:cheapest</code> (selects the provider with lowest price per output token) to the model id (e.g., <code>openai/gpt-oss-120b:fastest</code>).",N,S,E="You can also select the provider of your choice by appending the provider name to the model id (e.g. <code>&quot;openai/gpt-oss-120b:sambanova&quot;</code>).",H,Q,W;return i=new A({props:{code:"bnBtJTIwaW5zdGFsbCUyMCU0MGh1Z2dpbmdmYWNlJTJGaW5mZXJlbmNl",highlighted:"npm install @huggingface/inference",wrap:!1}}),Q=new A({props:{code:"aW1wb3J0JTIwJTdCJTIwSW5mZXJlbmNlQ2xpZW50JTIwJTdEJTIwZnJvbSUyMCUyMiU0MGh1Z2dpbmdmYWNlJTJGaW5mZXJlbmNlJTIyJTNCJTBBJTBBY29uc3QlMjBjbGllbnQlMjAlM0QlMjBuZXclMjBJbmZlcmVuY2VDbGllbnQocHJvY2Vzcy5lbnYuSEZfVE9LRU4pJTNCJTBBJTBBY29uc3QlMjBjaGF0Q29tcGxldGlvbiUyMCUzRCUyMGF3YWl0JTIwY2xpZW50LmNoYXRDb21wbGV0aW9uKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIyb3BlbmFpJTJGZ3B0LW9zcy0xMjBiJTNBZmFzdGVzdCUyMiUyQyUwQSUyMCUyMG1lc3NhZ2VzJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjBjb250ZW50JTNBJTIwJTIySG93JTIwbWFueSUyMCdHJ3MlMjBpbiUyMCdodWdnaW5nZmFjZSclM0YlMjIlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlNUQlMkMlMEElN0QpJTNCJTBBJTBBY29uc29sZS5sb2coY2hhdENvbXBsZXRpb24uY2hvaWNlcyU1QjAlNUQubWVzc2FnZSklM0I=",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;openai/gpt-oss-120b:fastest&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(){a=u("p"),a.textContent=f,p=o(),y=u("p"),y.textContent=d,T=o(),J(i.$$.fragment),m=o(),v=u("p"),v.textContent=b,x=o(),$=u("p"),$.innerHTML=B,q=o(),n=u("p"),n.innerHTML=C,N=o(),S=u("p"),S.innerHTML=E,H=o(),J(Q.$$.fragment)},l(c){a=M(c,"P",{"data-svelte-h":!0}),h(a)!=="svelte-16qrv4b"&&(a.textContent=f),p=r(c),y=M(c,"P",{"data-svelte-h":!0}),h(y)!=="svelte-1n3pnv6"&&(y.textContent=d),T=r(c),g(i.$$.fragment,c),m=r(c),v=M(c,"P",{"data-svelte-h":!0}),h(v)!=="svelte-zu4ucn"&&(v.textContent=b),x=r(c),$=M(c,"P",{"data-svelte-h":!0}),h($)!=="svelte-59nu2d"&&($.innerHTML=B),q=r(c),n=M(c,"P",{"data-svelte-h":!0}),h(n)!=="svelte-1ij5aqo"&&(n.innerHTML=C),N=r(c),S=M(c,"P",{"data-svelte-h":!0}),h(S)!=="svelte-18ftv0p"&&(S.innerHTML=E),H=r(c),g(Q.$$.fragment,c)},m(c,Z){s(c,a,Z),s(c,p,Z),s(c,y,Z),s(c,T,Z),w(i,c,Z),s(c,m,Z),s(c,v,Z),s(c,x,Z),s(c,$,Z),s(c,q,Z),s(c,n,Z),s(c,N,Z),s(c,S,Z),s(c,H,Z),w(Q,c,Z),W=!0},p:_,i(c){W||(U(i.$$.fragment,c),U(Q.$$.fragment,c),W=!0)},o(c){j(i.$$.fragment,c),j(Q.$$.fragment,c),W=!1},d(c){c&&(t(a),t(p),t(y),t(T),t(m),t(v),t(x),t($),t(q),t(n),t(N),t(S),t(H)),I(i,c),I(Q,c)}}}function _l(k){let a,f="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.",p,y,d='By default, our system automatically routes your request to the first available provider for the specified model, following your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.',T,i,m="You can change the provider selection policy by appending <code>:fastest</code> (selects the provider with highest throughput) or <code>:cheapest</code> (selects the provider with lowest price per output token) to the model id (e.g., <code>openai/gpt-oss-120b:fastest</code>).",v,b,x="You can also select the provider of your choice by appending the provider name to the model id (e.g. <code>&quot;openai/gpt-oss-120b:sambanova&quot;</code>).",$,B,q;return B=new A({props:{code:"aW1wb3J0JTIwT3BlbkFJJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjBjb21wbGV0aW9uJTIwJTNEJTIwYXdhaXQlMjBjbGllbnQuY2hhdC5jb21wbGV0aW9ucy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJvcGVuYWklMkZncHQtb3NzLTEyMGIlM0FmYXN0ZXN0JTIyJTJDJTBBJTIwJTIwbWVzc2FnZXMlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjByb2xlJTNBJTIwJTIydXNlciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMGNvbnRlbnQlM0ElMjAlMjJIb3clMjBtYW55JTIwJ0cncyUyMGluJTIwJ2h1Z2dpbmdmYWNlJyUzRiUyMiUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCU1RCUyQyUwQSU3RCklM0IlMEElMEFjb25zb2xlLmxvZyhjb21wbGV0aW9uLmNob2ljZXMlNUIwJTVELm1lc3NhZ2UuY29udGVudCklM0I=",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;openai/gpt-oss-120b:fastest&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(){a=u("p"),a.innerHTML=f,p=o(),y=u("p"),y.innerHTML=d,T=o(),i=u("p"),i.innerHTML=m,v=o(),b=u("p"),b.innerHTML=x,$=o(),J(B.$$.fragment)},l(n){a=M(n,"P",{"data-svelte-h":!0}),h(a)!=="svelte-1d85rb2"&&(a.innerHTML=f),p=r(n),y=M(n,"P",{"data-svelte-h":!0}),h(y)!=="svelte-59nu2d"&&(y.innerHTML=d),T=r(n),i=M(n,"P",{"data-svelte-h":!0}),h(i)!=="svelte-1ij5aqo"&&(i.innerHTML=m),v=r(n),b=M(n,"P",{"data-svelte-h":!0}),h(b)!=="svelte-18ftv0p"&&(b.innerHTML=x),$=r(n),g(B.$$.fragment,n)},m(n,C){s(n,a,C),s(n,p,C),s(n,y,C),s(n,T,C),s(n,i,C),s(n,v,C),s(n,b,C),s(n,$,C),w(B,n,C),q=!0},p:_,i(n){q||(U(B.$$.fragment,n),q=!0)},o(n){j(B.$$.fragment,n),q=!1},d(n){n&&(t(a),t(p),t(y),t(T),t(i),t(v),t(b),t($)),I(B,n)}}}function Ll(k){let a,f="For lightweight applications or custom implementations, use our REST API directly with standard fetch.",p,y,d='By default, our system automatically routes your request to the first available provider for the specified model, following your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.',T,i,m="You can change the provider selection policy by appending <code>:fastest</code> (selects the provider with highest throughput) or <code>:cheapest</code> (selects the provider with lowest price per output token) to the model id (e.g., <code>openai/gpt-oss-120b:fastest</code>).",v,b,x="You can also select the provider of your choice by appending the provider name to the model id (e.g. <code>&quot;openai/gpt-oss-120b:sambanova&quot;</code>).",$,B,q;return B=new A({props:{code:"aW1wb3J0JTIwZmV0Y2glMjBmcm9tJTIwJTIybm9kZS1mZXRjaCUyMiUzQiUwQSUwQWNvbnN0JTIwcmVzcG9uc2UlMjAlM0QlMjBhd2FpdCUyMGZldGNoKCUwQSUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZjaGF0JTJGY29tcGxldGlvbnMlMjIlMkMlMEElMjAlMjAlN0IlMEElMjAlMjAlMjAlMjBtZXRob2QlM0ElMjAlMjJQT1NUJTIyJTJDJTBBJTIwJTIwJTIwJTIwaGVhZGVycyUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMEF1dGhvcml6YXRpb24lM0ElMjAlNjBCZWFyZXIlMjAlMjQlN0Jwcm9jZXNzLmVudi5IRl9UT0tFTiU3RCU2MCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMkNvbnRlbnQtVHlwZSUyMiUzQSUyMCUyMmFwcGxpY2F0aW9uJTJGanNvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMGJvZHklM0ElMjBKU09OLnN0cmluZ2lmeSglN0IlMEElMjAlMjAlMjAlMjAlMjAlMjBtb2RlbCUzQSUyMCUyMm9wZW5haSUyRmdwdC1vc3MtMTIwYiUzQWZhc3Rlc3QlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjBtZXNzYWdlcyUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJvbGUlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwY29udGVudCUzQSUyMCUyMkhvdyUyMG1hbnklMjAnRydzJTIwaW4lMjAnaHVnZ2luZ2ZhY2UnJTNGJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTdEKSUyQyUwQSUyMCUyMCU3RCUwQSklM0IlMEFjb25zb2xlLmxvZyhhd2FpdCUyMHJlc3BvbnNlLmpzb24oKSklM0I=",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;openai/gpt-oss-120b:fastest&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(){a=u("p"),a.textContent=f,p=o(),y=u("p"),y.innerHTML=d,T=o(),i=u("p"),i.innerHTML=m,v=o(),b=u("p"),b.innerHTML=x,$=o(),J(B.$$.fragment)},l(n){a=M(n,"P",{"data-svelte-h":!0}),h(a)!=="svelte-11uqtap"&&(a.textContent=f),p=r(n),y=M(n,"P",{"data-svelte-h":!0}),h(y)!=="svelte-59nu2d"&&(y.innerHTML=d),T=r(n),i=M(n,"P",{"data-svelte-h":!0}),h(i)!=="svelte-1ij5aqo"&&(i.innerHTML=m),v=r(n),b=M(n,"P",{"data-svelte-h":!0}),h(b)!=="svelte-18ftv0p"&&(b.innerHTML=x),$=r(n),g(B.$$.fragment,n)},m(n,C){s(n,a,C),s(n,p,C),s(n,y,C),s(n,T,C),s(n,i,C),s(n,v,C),s(n,b,C),s(n,$,C),w(B,n,C),q=!0},p:_,i(n){q||(U(B.$$.fragment,n),q=!0)},o(n){j(B.$$.fragment,n),q=!1},d(n){n&&(t(a),t(p),t(y),t(T),t(i),t(v),t(b),t($)),I(B,n)}}}function Rl(k){let a,f,p,y,d,T;return a=new V({props:{id:"javascript-clients",option:"huggingface.js",$$slots:{default:[Vl]},$$scope:{ctx:k}}}),p=new V({props:{id:"javascript-clients",option:"openai",$$slots:{default:[_l]},$$scope:{ctx:k}}}),d=new V({props:{id:"javascript-clients",option:"fetch",$$slots:{default:[Ll]},$$scope:{ctx:k}}}),{c(){J(a.$$.fragment),f=o(),J(p.$$.fragment),y=o(),J(d.$$.fragment)},l(i){g(a.$$.fragment,i),f=r(i),g(p.$$.fragment,i),y=r(i),g(d.$$.fragment,i)},m(i,m){w(a,i,m),s(i,f,m),w(p,i,m),s(i,y,m),w(d,i,m),T=!0},p(i,m){const v={};m&2&&(v.$$scope={dirty:m,ctx:i}),a.$set(v);const b={};m&2&&(b.$$scope={dirty:m,ctx:i}),p.$set(b);const x={};m&2&&(x.$$scope={dirty:m,ctx:i}),d.$set(x)},i(i){T||(U(a.$$.fragment,i),U(p.$$.fragment,i),U(d.$$.fragment,i),T=!0)},o(i){j(a.$$.fragment,i),j(p.$$.fragment,i),j(d.$$.fragment,i),T=!1},d(i){i&&(t(f),t(y)),I(a,i),I(p,i),I(d,i)}}}function Yl(k){let a,f;return a=new A({props:{code:"aW1wb3J0JTIwJTdCJTIwSW5mZXJlbmNlQ2xpZW50JTIwJTdEJTIwZnJvbSUyMCUyMiU0MGh1Z2dpbmdmYWNlJTJGaW5mZXJlbmNlJTIyJTNCJTBBJTBBY29uc3QlMjBjbGllbnQlMjAlM0QlMjBuZXclMjBJbmZlcmVuY2VDbGllbnQocHJvY2Vzcy5lbnYuSEZfVE9LRU4pJTNCJTBBJTBBJTJGJTJGJTIwRXhwbGljaXQlMjBwcm92aWRlciUyMHNlbGVjdGlvbiUwQWF3YWl0JTIwY2xpZW50LmNoYXRDb21wbGV0aW9uKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIyZGVlcHNlZWstYWklMkZEZWVwU2Vlay1SMSUyMiUyQyUwQSUyMCUyMHByb3ZpZGVyJTNBJTIwJTIyc2FtYmFub3ZhJTIyJTJDJTIwJTJGJTJGJTIwU3BlY2lmaWMlMjBwcm92aWRlciUwQSUyMCUyMG1lc3NhZ2VzJTNBJTIwJTVCJTdCJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMjBjb250ZW50JTNBJTIwJTIySGVsbG8hJTIyJTIwJTdEJTVEJTJDJTBBJTdEKSUzQiUwQSUwQSUyRiUyRiUyMEF1dG9tYXRpYyUyMHByb3ZpZGVyJTIwc2VsZWN0aW9uJTIwKGRlZmF1bHQlM0ElMjAlMjJhdXRvJTIyKSUwQWF3YWl0JTIwY2xpZW50LmNoYXRDb21wbGV0aW9uKCU3QiUwQSUyMCUyMG1vZGVsJTNBJTIwJTIyZGVlcHNlZWstYWklMkZEZWVwU2Vlay1SMSUyMiUyQyUwQSUyMCUyMCUyRiUyRiUyMERlZmF1bHRzJTIwdG8lMjAlMjJhdXRvJTIyJTIwc2VsZWN0aW9uJTIwb2YlMjB0aGUlMjBwcm92aWRlciUwQSUyMCUyMCUyRiUyRiUyMHByb3ZpZGVyJTNEJTIyYXV0byUyMiUyQyUwQSUyMCUyMG1lc3NhZ2VzJTNBJTIwJTVCJTdCJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMjBjb250ZW50JTNBJTIwJTIySGVsbG8hJTIyJTIwJTdEJTVEJTJDJTBBJTdEKSUzQg==",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;deepseek-ai/DeepSeek-R1&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;deepseek-ai/DeepSeek-R1&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(){J(a.$$.fragment)},l(p){g(a.$$.fragment,p)},m(p,y){w(a,p,y),f=!0},p:_,i(p){f||(U(a.$$.fragment,p),f=!0)},o(p){j(a.$$.fragment,p),f=!1},d(p){I(a,p)}}}function Pl(k){let a,f;return a=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBY2xpZW50JTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50KHRva2VuJTNEb3MuZW52aXJvbiU1QiUyMkhGX1RPS0VOJTIyJTVEKSUwQSUwQSUyMyUyMEV4cGxpY2l0JTIwcHJvdmlkZXIlMjBzZWxlY3Rpb24lMEFyZXN1bHQlMjAlM0QlMjBjbGllbnQuY2hhdF9jb21wbGV0aW9uKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyZGVlcHNlZWstYWklMkZEZWVwU2Vlay1SMSUyMiUyQyUwQSUyMCUyMCUyMCUyMHByb3ZpZGVyJTNEJTIyc2FtYmFub3ZhJTIyJTJDJTIwJTIwJTIzJTIwU3BlY2lmaWMlMjBwcm92aWRlciUwQSUyMCUyMCUyMCUyMG1lc3NhZ2VzJTNEJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySGVsbG8hJTIyJTdEJTVEJTJDJTBBKSUwQSUwQSUyMyUyMEF1dG9tYXRpYyUyMHByb3ZpZGVyJTIwc2VsZWN0aW9uJTIwKGRlZmF1bHQlM0ElMjAlMjJhdXRvJTIyKSUwQXJlc3VsdCUyMCUzRCUyMGNsaWVudC5jaGF0X2NvbXBsZXRpb24oJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0QlMjJkZWVwc2Vlay1haSUyRkRlZXBTZWVrLVIxJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIzJTIwRGVmYXVsdHMlMjB0byUyMCUyMmF1dG8lMjIlMjBzZWxlY3Rpb24lMjBvZiUyMHRoZSUyMHByb3ZpZGVyJTBBJTIwJTIwJTIwJTIwJTIzJTIwcHJvdmlkZXIlM0QlMjJhdXRvJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWVzc2FnZXMlM0QlNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIZWxsbyElMjIlN0QlNUQlMkMlMEEp",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;deepseek-ai/DeepSeek-R1&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;deepseek-ai/DeepSeek-R1&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(){J(a.$$.fragment)},l(p){g(a.$$.fragment,p)},m(p,y){w(a,p,y),f=!0},p:_,i(p){f||(U(a.$$.fragment,p),f=!0)},o(p){j(a.$$.fragment,p),f=!1},d(p){I(a,p)}}}function Fl(k){let a,f,p,y;return a=new V({props:{id:"client-side-provider-selection",option:"javascript",$$slots:{default:[Yl]},$$scope:{ctx:k}}}),p=new V({props:{id:"client-side-provider-selection",option:"python",$$slots:{default:[Pl]},$$scope:{ctx:k}}}),{c(){J(a.$$.fragment),f=o(),J(p.$$.fragment)},l(d){g(a.$$.fragment,d),f=r(d),g(p.$$.fragment,d)},m(d,T){w(a,d,T),s(d,f,T),w(p,d,T),y=!0},p(d,T){const i={};T&2&&(i.$$scope={dirty:T,ctx:d}),a.$set(i);const m={};T&2&&(m.$$scope={dirty:T,ctx:d}),p.$set(m)},i(d){y||(U(a.$$.fragment,d),U(p.$$.fragment,d),y=!0)},o(d){j(a.$$.fragment,d),j(p.$$.fragment,d),y=!1},d(d){d&&t(f),I(a,d),I(p,d)}}}function zl(k){let a,f;return a=new A({props:{code:"aW1wb3J0JTIwJTdCJTIwT3BlbkFJJTIwJTdEJTIwZnJvbSUyMCUyMm9wZW5haSUyMiUzQiUwQSUwQWNvbnN0JTIwY2xpZW50JTIwJTNEJTIwbmV3JTIwT3BlbkFJKCU3QiUwQSUyMCUyMGJhc2VVUkwlM0ElMjAlMjJodHRwcyUzQSUyRiUyRnJvdXRlci5odWdnaW5nZmFjZS5jbyUyRnYxJTIyJTJDJTBBJTIwJTIwYXBpS2V5JTNBJTIwcHJvY2Vzcy5lbnYuSEZfVE9LRU4lMkMlMEElN0QpJTNCJTBBJTBBY29uc3QlMjBjb21wbGV0aW9uJTIwJTNEJTIwYXdhaXQlMjBjbGllbnQuY2hhdC5jb21wbGV0aW9ucy5jcmVhdGUoJTdCJTBBJTIwJTIwbW9kZWwlM0ElMjAlMjJkZWVwc2Vlay1haSUyRkRlZXBTZWVrLVIxJTNBZmFzdGVzdCUyMiUyQyUwQSUyMCUyMG1lc3NhZ2VzJTNBJTIwJTVCJTdCJTIwcm9sZSUzQSUyMCUyMnVzZXIlMjIlMkMlMjBjb250ZW50JTNBJTIwJTIySGVsbG8hJTIyJTIwJTdEJTVEJTJDJTBBJTdEKSUzQg==",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-R1:fastest&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(){J(a.$$.fragment)},l(p){g(a.$$.fragment,p)},m(p,y){w(a,p,y),f=!0},p:_,i(p){f||(U(a.$$.fragment,p),f=!0)},o(p){j(a.$$.fragment,p),f=!1},d(p){I(a,p)}}}function Xl(k){let a,f;return a=new A({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwb3BlbmFpJTIwaW1wb3J0JTIwT3BlbkFJJTBBJTBBY2xpZW50JTIwJTNEJTIwT3BlbkFJKCUwQSUyMCUyMCUyMCUyMGJhc2VfdXJsJTNEJTIyaHR0cHMlM0ElMkYlMkZyb3V0ZXIuaHVnZ2luZ2ZhY2UuY28lMkZ2MSUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9rZXklM0Rvcy5lbnZpcm9uJTVCJTIySEZfVE9LRU4lMjIlNUQlMkMlMEEpJTBBJTBBY29tcGxldGlvbiUyMCUzRCUyMGNsaWVudC5jaGF0LmNvbXBsZXRpb25zLmNyZWF0ZSglMEElMjAlMjAlMjAlMjBtb2RlbCUzRCUyMmRlZXBzZWVrLWFpJTJGRGVlcFNlZWstUjElM0FmYXN0ZXN0JTIyJTJDJTBBJTIwJTIwJTIwJTIwbWVzc2FnZXMlM0QlNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIZWxsbyElMjIlN0QlNUQlMkMlMEEpJTBBJTBBcHJpbnQoY29tcGxldGlvbi5jaG9pY2VzJTVCMCU1RC5tZXNzYWdlLmNvbnRlbnQp",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-R1:fastest&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(){J(a.$$.fragment)},l(p){g(a.$$.fragment,p)},m(p,y){w(a,p,y),f=!0},p:_,i(p){f||(U(a.$$.fragment,p),f=!0)},o(p){j(a.$$.fragment,p),f=!1},d(p){I(a,p)}}}function Kl(k){let a,f,p,y;return a=new V({props:{id:"openai-compatible",option:"javascript",$$slots:{default:[zl]},$$scope:{ctx:k}}}),p=new V({props:{id:"openai-compatible",option:"python",$$slots:{default:[Xl]},$$scope:{ctx:k}}}),{c(){J(a.$$.fragment),f=o(),J(p.$$.fragment)},l(d){g(a.$$.fragment,d),f=r(d),g(p.$$.fragment,d)},m(d,T){w(a,d,T),s(d,f,T),w(p,d,T),y=!0},p(d,T){const i={};T&2&&(i.$$scope={dirty:T,ctx:d}),a.$set(i);const m={};T&2&&(m.$$scope={dirty:T,ctx:d}),p.$set(m)},i(d){y||(U(a.$$.fragment,d),U(p.$$.fragment,d),y=!0)},o(d){j(a.$$.fragment,d),j(p.$$.fragment,d),y=!1},d(d){d&&t(f),I(a,d),I(p,d)}}}function Ol(k){let a,f,p,y,d,T,i,m,v,b='<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"/>',x,$,B="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.",q,n,C,N,S="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:",E,H,Q='<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/wavespeed">WaveSpeedAI</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>',W,c,Z,z,xs="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:",dt,X,ks="<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.",ut,K,Gs="<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.",Mt,O,Ss="<strong>Production-Ready Performance</strong>: Built for enterprise workloads with the reliability your applications demand.",yt,D,Qs="Here’s what you can build:",ht,ee,Ns="<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>",ft,te,Hs='⚡ <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>.',Tt,se,mt,le,As="<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>",Jt,ne,gt,ae,Ws="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.",wt,ie,Es='We’ll walk through a practical example using <a href="https://huggingface.co/openai/gpt-oss-120b" rel="nofollow">openai/gpt-oss-120b</a>, a state-of-the-art open-weights conversational model.',Ut,oe,jt,re,Vs='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.',It,L,_s='<img src="https://cdn-uploads.huggingface.co/production/uploads/5f17f0a0925b9863e28ad517/9_Tgf0Tv65srhBirZQMTp.png" alt="Inference Playground thumbnail" style="max-width: 550px; width: 100%;"/>',vt,pe,Ct,ce,Ls='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.',bt,de,Rs='For complete token management details, see our <a href="https://huggingface.co/docs/hub/en/security-tokens" rel="nofollow">security tokens guide</a>.',$t,ue,Bt,Me,Ys="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.",Zt,ye,Ps="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.",qt,he,xt,fe,Fs="Here are three ways to integrate Inference Providers into your Python applications, from high-level convenience to low-level control:",kt,R,Gt,Te,St,me,zs="Integrate Inference Providers into your JavaScript applications with these flexible approaches:",Qt,Y,Nt,Je,Ht,ge,Xs="For testing, debugging, or integrating with any HTTP client, here’s the raw REST API format.",At,we,Ks='By default, our system automatically routes your request to the first available provider for the specified model, following your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.',Wt,Ue,Os="You can change the provider selection policy by appending <code>:fastest</code> (selects the provider with highest throughput) or <code>:cheapest</code> (selects the provider with lowest price per output token) to the model id (e.g., <code>openai/gpt-oss-120b:fastest</code>).",Et,je,Ds="You can also select the provider of your choice by appending the provider name to the model id (e.g. <code>&quot;openai/gpt-oss-120b:sambanova&quot;</code>).",Vt,Ie,_t,ve,Lt,Ce,el='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.',Rt,be,Yt,$e,tl="Use the <code>huggingface_hub</code> library for the simplest image generation experience with automatic provider selection:",Pt,Be,Ft,Ze,zt,qe,sl="Use our JavaScript SDK for streamlined image generation with TypeScript support:",Xt,xe,Kt,ke,Ot,Ge,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.",Dt,Se,es,Qe,nl="When using Inference Providers, your requests go through Hugging Face’s proxy infrastructure, which provides several key benefits:",ts,Ne,al="<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>",ss,He,il="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.",ls,Ae,ns,We,ol="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.",as,P,is,Ee,rl="<strong>Provider Selection Policy:</strong>",os,Ve,pl='<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>',rs,_e,ps,Le,cl="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.",cs,Re,dl=`By default, the selected provider is the first available provider for the selected model, sorted by your preference order in <a href="https://hf.co/settings/inference-providers" rel="nofollow">Inference Provider settings</a>.
You can change that policy by adding a suffix to the model name:`,ds,Ye,ul="<li><code>:fastest</code> selects the fastest provider for the model (highest throughput in tokens per second)</li> <li><code>:cheapest</code> selects the most cost-efficient provider for the model (lowest price per output tokens)</li>",us,Pe,Ml="<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.",Ms,F,ys,Fe,yl="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.",hs,ze,fs,Xe,hl="<strong>Key Features:</strong>",Ts,Ke,fl="<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>",ms,Oe,Js,De,Tl="<strong>Use Inference Clients when:</strong>",gs,et,ml="<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>",ws,tt,Jl="<strong>Use OpenAI-Compatible Endpoint when:</strong>",Us,st,gl="<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>",js,lt,wl="<strong>Use Direct HTTP when:</strong>",Is,nt,Ul="<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>",vs,at,Cs,it,jl="Now that you understand the basics, explore these resources to make the most of Inference Providers:",bs,ot,Il='<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>',$s,rt,Bs,pt,Zs;return d=new Ql({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),i=new G({props:{title:"Inference Providers",local:"inference-providers",headingTag:"h1"}}),n=new G({props:{title:"Partners",local:"partners",headingTag:"h2"}}),c=new G({props:{title:"Why Choose Inference Providers?",local:"why-choose-inference-providers",headingTag:"h2"}}),se=new G({props:{title:"Key Features",local:"key-features",headingTag:"h2"}}),ne=new G({props:{title:"Getting Started",local:"getting-started",headingTag:"h2"}}),oe=new G({props:{title:"Inference Playground",local:"inference-playground",headingTag:"h3"}}),pe=new G({props:{title:"Authentication",local:"authentication",headingTag:"h3"}}),ue=new G({props:{title:"Quick Start - LLM",local:"quick-start---llm",headingTag:"h3"}}),he=new G({props:{title:"Python",local:"python",headingTag:"h4"}}),R=new qs({props:{id:"python-clients",options:["huggingface_hub","openai","requests"],$$slots:{default:[El]},$$scope:{ctx:k}}}),Te=new G({props:{title:"JavaScript",local:"javascript",headingTag:"h4"}}),Y=new qs({props:{id:"javascript-clients",options:["huggingface.js","openai","fetch"],$$slots:{default:[Rl]},$$scope:{ctx:k}}}),Je=new G({props:{title:"HTTP / cURL",local:"http--curl",headingTag:"h4"}}),Ie=new A({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZjaGF0JTJGY29tcGxldGlvbnMlMjAlNUMlMEElMjAlMjAlMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC1IJTIwJ0NvbnRlbnQtVHlwZSUzQSUyMGFwcGxpY2F0aW9uJTJGanNvbiclMjAlNUMlMEElMjAlMjAlMjAlMjAtZCUyMCclN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtZXNzYWdlcyUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkhvdyUyMG1hbnklMjBHJTIwaW4lMjBodWdnaW5nZmFjZSUzRiUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1vZGVsJTIyJTNBJTIwJTIyb3BlbmFpJTJGZ3B0LW9zcy0xMjBiJTNBZmFzdGVzdCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnN0cmVhbSUyMiUzQSUyMGZhbHNlJTBBJTIwJTIwJTIwJTIwJTdEJw==",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;openai/gpt-oss-120b:fastest&quot;,
        &quot;stream&quot;: false
    }&#x27;</span>`,wrap:!1}}),ve=new G({props:{title:"Quick Start - Text-to-Image Generation",local:"quick-start---text-to-image-generation",headingTag:"h3"}}),be=new G({props:{title:"Python",local:"python",headingTag:"h4"}}),Be=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}}),Ze=new G({props:{title:"JavaScript",local:"javascript",headingTag:"h4"}}),xe=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}}),ke=new G({props:{title:"Provider Selection",local:"provider-selection",headingTag:"h2"}}),Se=new G({props:{title:"API as a Proxy Service",local:"api-as-a-proxy-service",headingTag:"h3"}}),Ae=new G({props:{title:"Client-Side Provider Selection (Inference Clients)",local:"client-side-provider-selection-inference-clients",headingTag:"h3"}}),P=new qs({props:{id:"client-side-provider-selection",options:["javascript","python"],$$slots:{default:[Fl]},$$scope:{ctx:k}}}),_e=new G({props:{title:"Alternative: OpenAI-Compatible Chat Completions Endpoint (Chat Only)",local:"alternative-openai-compatible-chat-completions-endpoint-chat-only",headingTag:"h3"}}),F=new qs({props:{id:"openai-compatible",options:["javascript","python"],$$slots:{default:[Kl]},$$scope:{ctx:k}}}),ze=new A({props:{code:"Y3VybCUyMGh0dHBzJTNBJTJGJTJGcm91dGVyLmh1Z2dpbmdmYWNlLmNvJTJGdjElMkZjaGF0JTJGY29tcGxldGlvbnMlMjAlNUMlMEElMjAlMjAtSCUyMCUyMkF1dGhvcml6YXRpb24lM0ElMjBCZWFyZXIlMjAlMjRIRl9UT0tFTiUyMiUyMCU1QyUwQSUyMCUyMC1IJTIwJTIyQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJTIyJTIwJTVDJTBBJTIwJTIwLWQlMjAnJTdCJTBBJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJkZWVwc2Vlay1haSUyRkRlZXBTZWVrLVIxJTNBZmFzdGVzdCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMm1lc3NhZ2VzJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySGVsbG8hJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTdEJw==",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;deepseek-ai/DeepSeek-R1:fastest&quot;,
    &quot;messages&quot;: [
      {
        &quot;role&quot;: &quot;user&quot;,
        &quot;content&quot;: &quot;Hello!&quot;
      }
    ]
  }&#x27;</span>`,wrap:!1}}),Oe=new G({props:{title:"Choosing the Right Approach",local:"choosing-the-right-approach",headingTag:"h3"}}),at=new G({props:{title:"Next Steps",local:"next-steps",headingTag:"h2"}}),rt=new Nl({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/inference-providers/index.md"}}),{c(){a=u("meta"),f=o(),p=u("p"),y=o(),J(d.$$.fragment),T=o(),J(i.$$.fragment),m=o(),v=u("div"),v.innerHTML=b,x=o(),$=u("p"),$.textContent=B,q=o(),J(n.$$.fragment),C=o(),N=u("p"),N.textContent=S,E=o(),H=u("table"),H.innerHTML=Q,W=o(),J(c.$$.fragment),Z=o(),z=u("p"),z.textContent=xs,dt=o(),X=u("p"),X.innerHTML=ks,ut=o(),K=u("p"),K.innerHTML=Gs,Mt=o(),O=u("p"),O.innerHTML=Ss,yt=o(),D=u("p"),D.textContent=Qs,ht=o(),ee=u("ul"),ee.innerHTML=Ns,ft=o(),te=u("p"),te.innerHTML=Hs,Tt=o(),J(se.$$.fragment),mt=o(),le=u("ul"),le.innerHTML=As,Jt=o(),J(ne.$$.fragment),gt=o(),ae=u("p"),ae.textContent=Ws,wt=o(),ie=u("p"),ie.innerHTML=Es,Ut=o(),J(oe.$$.fragment),jt=o(),re=u("p"),re.innerHTML=Vs,It=o(),L=u("a"),L.innerHTML=_s,vt=o(),J(pe.$$.fragment),Ct=o(),ce=u("p"),ce.innerHTML=Ls,bt=o(),de=u("p"),de.innerHTML=Rs,$t=o(),J(ue.$$.fragment),Bt=o(),Me=u("p"),Me.textContent=Ys,Zt=o(),ye=u("p"),ye.textContent=Ps,qt=o(),J(he.$$.fragment),xt=o(),fe=u("p"),fe.textContent=Fs,kt=o(),J(R.$$.fragment),Gt=o(),J(Te.$$.fragment),St=o(),me=u("p"),me.textContent=zs,Qt=o(),J(Y.$$.fragment),Nt=o(),J(Je.$$.fragment),Ht=o(),ge=u("p"),ge.textContent=Xs,At=o(),we=u("p"),we.innerHTML=Ks,Wt=o(),Ue=u("p"),Ue.innerHTML=Os,Et=o(),je=u("p"),je.innerHTML=Ds,Vt=o(),J(Ie.$$.fragment),_t=o(),J(ve.$$.fragment),Lt=o(),Ce=u("p"),Ce.innerHTML=el,Rt=o(),J(be.$$.fragment),Yt=o(),$e=u("p"),$e.innerHTML=tl,Pt=o(),J(Be.$$.fragment),Ft=o(),J(Ze.$$.fragment),zt=o(),qe=u("p"),qe.textContent=sl,Xt=o(),J(xe.$$.fragment),Kt=o(),J(ke.$$.fragment),Ot=o(),Ge=u("p"),Ge.textContent=ll,Dt=o(),J(Se.$$.fragment),es=o(),Qe=u("p"),Qe.textContent=nl,ts=o(),Ne=u("ul"),Ne.innerHTML=al,ss=o(),He=u("p"),He.innerHTML=il,ls=o(),J(Ae.$$.fragment),ns=o(),We=u("p"),We.textContent=ol,as=o(),J(P.$$.fragment),is=o(),Ee=u("p"),Ee.innerHTML=rl,os=o(),Ve=u("ul"),Ve.innerHTML=pl,rs=o(),J(_e.$$.fragment),ps=o(),Le=u("p"),Le.textContent=cl,cs=o(),Re=u("p"),Re.innerHTML=dl,ds=o(),Ye=u("ul"),Ye.innerHTML=ul,us=o(),Pe=u("p"),Pe.innerHTML=Ml,Ms=o(),J(F.$$.fragment),ys=o(),Fe=u("p"),Fe.textContent=yl,hs=o(),J(ze.$$.fragment),fs=o(),Xe=u("p"),Xe.innerHTML=hl,Ts=o(),Ke=u("ul"),Ke.innerHTML=fl,ms=o(),J(Oe.$$.fragment),Js=o(),De=u("p"),De.innerHTML=Tl,gs=o(),et=u("ul"),et.innerHTML=ml,ws=o(),tt=u("p"),tt.innerHTML=Jl,Us=o(),st=u("ul"),st.innerHTML=gl,js=o(),lt=u("p"),lt.innerHTML=wl,Is=o(),nt=u("ul"),nt.innerHTML=Ul,vs=o(),J(at.$$.fragment),Cs=o(),it=u("p"),it.textContent=jl,bs=o(),ot=u("ul"),ot.innerHTML=Il,$s=o(),J(rt.$$.fragment),Bs=o(),pt=u("p"),this.h()},l(e){const l=Gl("svelte-u9bgzb",document.head);a=M(l,"META",{name:!0,content:!0}),l.forEach(t),f=r(e),p=M(e,"P",{}),Bl(p).forEach(t),y=r(e),g(d.$$.fragment,e),T=r(e),g(i.$$.fragment,e),m=r(e),v=M(e,"DIV",{class:!0,"data-svelte-h":!0}),h(v)!=="svelte-11agwm4"&&(v.innerHTML=b),x=r(e),$=M(e,"P",{"data-svelte-h":!0}),h($)!=="svelte-mizacy"&&($.textContent=B),q=r(e),g(n.$$.fragment,e),C=r(e),N=M(e,"P",{"data-svelte-h":!0}),h(N)!=="svelte-1ed4twc"&&(N.textContent=S),E=r(e),H=M(e,"TABLE",{"data-svelte-h":!0}),h(H)!=="svelte-1ndhkdt"&&(H.innerHTML=Q),W=r(e),g(c.$$.fragment,e),Z=r(e),z=M(e,"P",{"data-svelte-h":!0}),h(z)!=="svelte-fg40bn"&&(z.textContent=xs),dt=r(e),X=M(e,"P",{"data-svelte-h":!0}),h(X)!=="svelte-xatg1d"&&(X.innerHTML=ks),ut=r(e),K=M(e,"P",{"data-svelte-h":!0}),h(K)!=="svelte-h2iiik"&&(K.innerHTML=Gs),Mt=r(e),O=M(e,"P",{"data-svelte-h":!0}),h(O)!=="svelte-1k689uw"&&(O.innerHTML=Ss),yt=r(e),D=M(e,"P",{"data-svelte-h":!0}),h(D)!=="svelte-60lnnv"&&(D.textContent=Qs),ht=r(e),ee=M(e,"UL",{"data-svelte-h":!0}),h(ee)!=="svelte-jacsil"&&(ee.innerHTML=Ns),ft=r(e),te=M(e,"P",{"data-svelte-h":!0}),h(te)!=="svelte-sreoza"&&(te.innerHTML=Hs),Tt=r(e),g(se.$$.fragment,e),mt=r(e),le=M(e,"UL",{"data-svelte-h":!0}),h(le)!=="svelte-qntfxk"&&(le.innerHTML=As),Jt=r(e),g(ne.$$.fragment,e),gt=r(e),ae=M(e,"P",{"data-svelte-h":!0}),h(ae)!=="svelte-8qewzy"&&(ae.textContent=Ws),wt=r(e),ie=M(e,"P",{"data-svelte-h":!0}),h(ie)!=="svelte-199e99l"&&(ie.innerHTML=Es),Ut=r(e),g(oe.$$.fragment,e),jt=r(e),re=M(e,"P",{"data-svelte-h":!0}),h(re)!=="svelte-1kvf1l6"&&(re.innerHTML=Vs),It=r(e),L=M(e,"A",{href:!0,target:!0,"data-svelte-h":!0}),h(L)!=="svelte-nl4fks"&&(L.innerHTML=_s),vt=r(e),g(pe.$$.fragment,e),Ct=r(e),ce=M(e,"P",{"data-svelte-h":!0}),h(ce)!=="svelte-p5g40u"&&(ce.innerHTML=Ls),bt=r(e),de=M(e,"P",{"data-svelte-h":!0}),h(de)!=="svelte-111b79b"&&(de.innerHTML=Rs),$t=r(e),g(ue.$$.fragment,e),Bt=r(e),Me=M(e,"P",{"data-svelte-h":!0}),h(Me)!=="svelte-ya5dcf"&&(Me.textContent=Ys),Zt=r(e),ye=M(e,"P",{"data-svelte-h":!0}),h(ye)!=="svelte-18cvct0"&&(ye.textContent=Ps),qt=r(e),g(he.$$.fragment,e),xt=r(e),fe=M(e,"P",{"data-svelte-h":!0}),h(fe)!=="svelte-b4svk"&&(fe.textContent=Fs),kt=r(e),g(R.$$.fragment,e),Gt=r(e),g(Te.$$.fragment,e),St=r(e),me=M(e,"P",{"data-svelte-h":!0}),h(me)!=="svelte-1j7dkjh"&&(me.textContent=zs),Qt=r(e),g(Y.$$.fragment,e),Nt=r(e),g(Je.$$.fragment,e),Ht=r(e),ge=M(e,"P",{"data-svelte-h":!0}),h(ge)!=="svelte-ampwgx"&&(ge.textContent=Xs),At=r(e),we=M(e,"P",{"data-svelte-h":!0}),h(we)!=="svelte-59nu2d"&&(we.innerHTML=Ks),Wt=r(e),Ue=M(e,"P",{"data-svelte-h":!0}),h(Ue)!=="svelte-1ij5aqo"&&(Ue.innerHTML=Os),Et=r(e),je=M(e,"P",{"data-svelte-h":!0}),h(je)!=="svelte-18ftv0p"&&(je.innerHTML=Ds),Vt=r(e),g(Ie.$$.fragment,e),_t=r(e),g(ve.$$.fragment,e),Lt=r(e),Ce=M(e,"P",{"data-svelte-h":!0}),h(Ce)!=="svelte-104cbnb"&&(Ce.innerHTML=el),Rt=r(e),g(be.$$.fragment,e),Yt=r(e),$e=M(e,"P",{"data-svelte-h":!0}),h($e)!=="svelte-k7ro1o"&&($e.innerHTML=tl),Pt=r(e),g(Be.$$.fragment,e),Ft=r(e),g(Ze.$$.fragment,e),zt=r(e),qe=M(e,"P",{"data-svelte-h":!0}),h(qe)!=="svelte-1e8s5p0"&&(qe.textContent=sl),Xt=r(e),g(xe.$$.fragment,e),Kt=r(e),g(ke.$$.fragment,e),Ot=r(e),Ge=M(e,"P",{"data-svelte-h":!0}),h(Ge)!=="svelte-1xog8yx"&&(Ge.textContent=ll),Dt=r(e),g(Se.$$.fragment,e),es=r(e),Qe=M(e,"P",{"data-svelte-h":!0}),h(Qe)!=="svelte-1spbtw4"&&(Qe.textContent=nl),ts=r(e),Ne=M(e,"UL",{"data-svelte-h":!0}),h(Ne)!=="svelte-7jdm5r"&&(Ne.innerHTML=al),ss=r(e),He=M(e,"P",{"data-svelte-h":!0}),h(He)!=="svelte-13kg8nq"&&(He.innerHTML=il),ls=r(e),g(Ae.$$.fragment,e),ns=r(e),We=M(e,"P",{"data-svelte-h":!0}),h(We)!=="svelte-2xagg0"&&(We.textContent=ol),as=r(e),g(P.$$.fragment,e),is=r(e),Ee=M(e,"P",{"data-svelte-h":!0}),h(Ee)!=="svelte-1x1ysu4"&&(Ee.innerHTML=rl),os=r(e),Ve=M(e,"UL",{"data-svelte-h":!0}),h(Ve)!=="svelte-9wsg5u"&&(Ve.innerHTML=pl),rs=r(e),g(_e.$$.fragment,e),ps=r(e),Le=M(e,"P",{"data-svelte-h":!0}),h(Le)!=="svelte-slyst7"&&(Le.textContent=cl),cs=r(e),Re=M(e,"P",{"data-svelte-h":!0}),h(Re)!=="svelte-d8qj83"&&(Re.innerHTML=dl),ds=r(e),Ye=M(e,"UL",{"data-svelte-h":!0}),h(Ye)!=="svelte-ujchrw"&&(Ye.innerHTML=ul),us=r(e),Pe=M(e,"P",{"data-svelte-h":!0}),h(Pe)!=="svelte-rak2w9"&&(Pe.innerHTML=Ml),Ms=r(e),g(F.$$.fragment,e),ys=r(e),Fe=M(e,"P",{"data-svelte-h":!0}),h(Fe)!=="svelte-1hqb6hm"&&(Fe.textContent=yl),hs=r(e),g(ze.$$.fragment,e),fs=r(e),Xe=M(e,"P",{"data-svelte-h":!0}),h(Xe)!=="svelte-dcww01"&&(Xe.innerHTML=hl),Ts=r(e),Ke=M(e,"UL",{"data-svelte-h":!0}),h(Ke)!=="svelte-1ll4xf5"&&(Ke.innerHTML=fl),ms=r(e),g(Oe.$$.fragment,e),Js=r(e),De=M(e,"P",{"data-svelte-h":!0}),h(De)!=="svelte-t3us3z"&&(De.innerHTML=Tl),gs=r(e),et=M(e,"UL",{"data-svelte-h":!0}),h(et)!=="svelte-13s5asy"&&(et.innerHTML=ml),ws=r(e),tt=M(e,"P",{"data-svelte-h":!0}),h(tt)!=="svelte-c2rkew"&&(tt.innerHTML=Jl),Us=r(e),st=M(e,"UL",{"data-svelte-h":!0}),h(st)!=="svelte-7uci6x"&&(st.innerHTML=gl),js=r(e),lt=M(e,"P",{"data-svelte-h":!0}),h(lt)!=="svelte-vidaw3"&&(lt.innerHTML=wl),Is=r(e),nt=M(e,"UL",{"data-svelte-h":!0}),h(nt)!=="svelte-73asmq"&&(nt.innerHTML=Ul),vs=r(e),g(at.$$.fragment,e),Cs=r(e),it=M(e,"P",{"data-svelte-h":!0}),h(it)!=="svelte-1pnlwxm"&&(it.textContent=jl),bs=r(e),ot=M(e,"UL",{"data-svelte-h":!0}),h(ot)!=="svelte-djn6lh"&&(ot.innerHTML=Il),$s=r(e),g(rt.$$.fragment,e),Bs=r(e),pt=M(e,"P",{}),Bl(pt).forEach(t),this.h()},h(){ct(a,"name","hf:doc:metadata"),ct(a,"content",Dl),ct(v,"class","flex justify-center"),ct(L,"href","https://huggingface.co/playground"),ct(L,"target","blank")},m(e,l){Sl(document.head,a),s(e,f,l),s(e,p,l),s(e,y,l),w(d,e,l),s(e,T,l),w(i,e,l),s(e,m,l),s(e,v,l),s(e,x,l),s(e,$,l),s(e,q,l),w(n,e,l),s(e,C,l),s(e,N,l),s(e,E,l),s(e,H,l),s(e,W,l),w(c,e,l),s(e,Z,l),s(e,z,l),s(e,dt,l),s(e,X,l),s(e,ut,l),s(e,K,l),s(e,Mt,l),s(e,O,l),s(e,yt,l),s(e,D,l),s(e,ht,l),s(e,ee,l),s(e,ft,l),s(e,te,l),s(e,Tt,l),w(se,e,l),s(e,mt,l),s(e,le,l),s(e,Jt,l),w(ne,e,l),s(e,gt,l),s(e,ae,l),s(e,wt,l),s(e,ie,l),s(e,Ut,l),w(oe,e,l),s(e,jt,l),s(e,re,l),s(e,It,l),s(e,L,l),s(e,vt,l),w(pe,e,l),s(e,Ct,l),s(e,ce,l),s(e,bt,l),s(e,de,l),s(e,$t,l),w(ue,e,l),s(e,Bt,l),s(e,Me,l),s(e,Zt,l),s(e,ye,l),s(e,qt,l),w(he,e,l),s(e,xt,l),s(e,fe,l),s(e,kt,l),w(R,e,l),s(e,Gt,l),w(Te,e,l),s(e,St,l),s(e,me,l),s(e,Qt,l),w(Y,e,l),s(e,Nt,l),w(Je,e,l),s(e,Ht,l),s(e,ge,l),s(e,At,l),s(e,we,l),s(e,Wt,l),s(e,Ue,l),s(e,Et,l),s(e,je,l),s(e,Vt,l),w(Ie,e,l),s(e,_t,l),w(ve,e,l),s(e,Lt,l),s(e,Ce,l),s(e,Rt,l),w(be,e,l),s(e,Yt,l),s(e,$e,l),s(e,Pt,l),w(Be,e,l),s(e,Ft,l),w(Ze,e,l),s(e,zt,l),s(e,qe,l),s(e,Xt,l),w(xe,e,l),s(e,Kt,l),w(ke,e,l),s(e,Ot,l),s(e,Ge,l),s(e,Dt,l),w(Se,e,l),s(e,es,l),s(e,Qe,l),s(e,ts,l),s(e,Ne,l),s(e,ss,l),s(e,He,l),s(e,ls,l),w(Ae,e,l),s(e,ns,l),s(e,We,l),s(e,as,l),w(P,e,l),s(e,is,l),s(e,Ee,l),s(e,os,l),s(e,Ve,l),s(e,rs,l),w(_e,e,l),s(e,ps,l),s(e,Le,l),s(e,cs,l),s(e,Re,l),s(e,ds,l),s(e,Ye,l),s(e,us,l),s(e,Pe,l),s(e,Ms,l),w(F,e,l),s(e,ys,l),s(e,Fe,l),s(e,hs,l),w(ze,e,l),s(e,fs,l),s(e,Xe,l),s(e,Ts,l),s(e,Ke,l),s(e,ms,l),w(Oe,e,l),s(e,Js,l),s(e,De,l),s(e,gs,l),s(e,et,l),s(e,ws,l),s(e,tt,l),s(e,Us,l),s(e,st,l),s(e,js,l),s(e,lt,l),s(e,Is,l),s(e,nt,l),s(e,vs,l),w(at,e,l),s(e,Cs,l),s(e,it,l),s(e,bs,l),s(e,ot,l),s(e,$s,l),w(rt,e,l),s(e,Bs,l),s(e,pt,l),Zs=!0},p(e,[l]){const vl={};l&2&&(vl.$$scope={dirty:l,ctx:e}),R.$set(vl);const Cl={};l&2&&(Cl.$$scope={dirty:l,ctx:e}),Y.$set(Cl);const bl={};l&2&&(bl.$$scope={dirty:l,ctx:e}),P.$set(bl);const $l={};l&2&&($l.$$scope={dirty:l,ctx:e}),F.$set($l)},i(e){Zs||(U(d.$$.fragment,e),U(i.$$.fragment,e),U(n.$$.fragment,e),U(c.$$.fragment,e),U(se.$$.fragment,e),U(ne.$$.fragment,e),U(oe.$$.fragment,e),U(pe.$$.fragment,e),U(ue.$$.fragment,e),U(he.$$.fragment,e),U(R.$$.fragment,e),U(Te.$$.fragment,e),U(Y.$$.fragment,e),U(Je.$$.fragment,e),U(Ie.$$.fragment,e),U(ve.$$.fragment,e),U(be.$$.fragment,e),U(Be.$$.fragment,e),U(Ze.$$.fragment,e),U(xe.$$.fragment,e),U(ke.$$.fragment,e),U(Se.$$.fragment,e),U(Ae.$$.fragment,e),U(P.$$.fragment,e),U(_e.$$.fragment,e),U(F.$$.fragment,e),U(ze.$$.fragment,e),U(Oe.$$.fragment,e),U(at.$$.fragment,e),U(rt.$$.fragment,e),Zs=!0)},o(e){j(d.$$.fragment,e),j(i.$$.fragment,e),j(n.$$.fragment,e),j(c.$$.fragment,e),j(se.$$.fragment,e),j(ne.$$.fragment,e),j(oe.$$.fragment,e),j(pe.$$.fragment,e),j(ue.$$.fragment,e),j(he.$$.fragment,e),j(R.$$.fragment,e),j(Te.$$.fragment,e),j(Y.$$.fragment,e),j(Je.$$.fragment,e),j(Ie.$$.fragment,e),j(ve.$$.fragment,e),j(be.$$.fragment,e),j(Be.$$.fragment,e),j(Ze.$$.fragment,e),j(xe.$$.fragment,e),j(ke.$$.fragment,e),j(Se.$$.fragment,e),j(Ae.$$.fragment,e),j(P.$$.fragment,e),j(_e.$$.fragment,e),j(F.$$.fragment,e),j(ze.$$.fragment,e),j(Oe.$$.fragment,e),j(at.$$.fragment,e),j(rt.$$.fragment,e),Zs=!1},d(e){e&&(t(f),t(p),t(y),t(T),t(m),t(v),t(x),t($),t(q),t(C),t(N),t(E),t(H),t(W),t(Z),t(z),t(dt),t(X),t(ut),t(K),t(Mt),t(O),t(yt),t(D),t(ht),t(ee),t(ft),t(te),t(Tt),t(mt),t(le),t(Jt),t(gt),t(ae),t(wt),t(ie),t(Ut),t(jt),t(re),t(It),t(L),t(vt),t(Ct),t(ce),t(bt),t(de),t($t),t(Bt),t(Me),t(Zt),t(ye),t(qt),t(xt),t(fe),t(kt),t(Gt),t(St),t(me),t(Qt),t(Nt),t(Ht),t(ge),t(At),t(we),t(Wt),t(Ue),t(Et),t(je),t(Vt),t(_t),t(Lt),t(Ce),t(Rt),t(Yt),t($e),t(Pt),t(Ft),t(zt),t(qe),t(Xt),t(Kt),t(Ot),t(Ge),t(Dt),t(es),t(Qe),t(ts),t(Ne),t(ss),t(He),t(ls),t(ns),t(We),t(as),t(is),t(Ee),t(os),t(Ve),t(rs),t(ps),t(Le),t(cs),t(Re),t(ds),t(Ye),t(us),t(Pe),t(Ms),t(ys),t(Fe),t(hs),t(fs),t(Xe),t(Ts),t(Ke),t(ms),t(Js),t(De),t(gs),t(et),t(ws),t(tt),t(Us),t(st),t(js),t(lt),t(Is),t(nt),t(vs),t(Cs),t(it),t(bs),t(ot),t($s),t(Bs),t(pt)),t(a),I(d,e),I(i,e),I(n,e),I(c,e),I(se,e),I(ne,e),I(oe,e),I(pe,e),I(ue,e),I(he,e),I(R,e),I(Te,e),I(Y,e),I(Je,e),I(Ie,e),I(ve,e),I(be,e),I(Be,e),I(Ze,e),I(xe,e),I(ke,e),I(Se,e),I(Ae,e),I(P,e),I(_e,e),I(F,e),I(ze,e),I(Oe,e),I(at,e),I(rt,e)}}}const Dl='{"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 en(k){return ql(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rn extends xl{constructor(a){super(),kl(this,a,en,Ol,Zl,{})}}export{rn as component};
