import{s as vt,o as xt,n as $t}from"../chunks/scheduler.6062bdaf.js";import{S as yt,i as wt,g as o,s as t,r as u,A as Tt,h as c,f as r,c as a,j as $,u as h,x as g,k as v,y as n,a as s,v as l,d as m,t as _,w as b}from"../chunks/index.4bca734e.js";import{T as kt}from"../chunks/Tip.b9ac1f03.js";import{D as y}from"../chunks/Docstring.81ba5e3c.js";import{C as Ct}from"../chunks/CodeBlock.fa01571c.js";import{E as Ht}from"../chunks/ExampleCodeBlock.30e7542f.js";import{H as Oe,E as Lt}from"../chunks/EditOnGithub.74ab2baa.js";function Mt(be){let f,M='Check out the <a href="../guides/inference_endpoints">related guide</a> to learn how to use <code>huggingface_hub</code> to manage your Inference Endpoints programmatically.';return{c(){f=o("p"),f.innerHTML=M},l(I){f=c(I,"P",{"data-svelte-h":!0}),g(f)!=="svelte-tmb85g"&&(f.innerHTML=M)},m(I,x){s(I,f,x)},p:$t,d(I){I&&r(f)}}}function Pt(be){let f,M="Example:",I,x,w;return x=new Ct({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGdldF9pbmZlcmVuY2VfZW5kcG9pbnQlMEFlbmRwb2ludCUyMCUzRCUyMGdldF9pbmZlcmVuY2VfZW5kcG9pbnQoJTIybXktdGV4dC10by1pbWFnZSUyMiklMEFlbmRwb2ludCUwQSUwQWVuZHBvaW50LnN0YXR1cyUwQWVuZHBvaW50LnVybCUwQSUwQWVuZHBvaW50LmNsaWVudC50ZXh0X3RvX2ltYWdlKC4uLiklMEElMEFlbmRwb2ludC5wYXVzZSgpJTBBJTBBZW5kcG9pbnQucmVzdW1lKCklMEFlbmRwb2ludC53YWl0KCklMEFlbmRwb2ludC5jbGllbnQudGV4dF90b19pbWFnZSguLi4p",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> get_inference_endpoint
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint = get_inference_endpoint(<span class="hljs-string">&quot;my-text-to-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint
InferenceEndpoint(name=<span class="hljs-string">&#x27;my-text-to-image&#x27;</span>, ...)

<span class="hljs-comment"># Get status</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint.status
<span class="hljs-string">&#x27;running&#x27;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint.url
<span class="hljs-string">&#x27;https://my-text-to-image.region.vendor.endpoints.huggingface.cloud&#x27;</span>

<span class="hljs-comment"># Run inference</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint.client.text_to_image(...)

<span class="hljs-comment"># Pause endpoint to save $$$</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint.pause()

<span class="hljs-comment"># ...</span>
<span class="hljs-comment"># Resume and wait for deployment</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint.resume()
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint.wait()
<span class="hljs-meta">&gt;&gt;&gt; </span>endpoint.client.text_to_image(...)`,wrap:!1}}),{c(){f=o("p"),f.textContent=M,I=t(),u(x.$$.fragment)},l(E){f=c(E,"P",{"data-svelte-h":!0}),g(f)!=="svelte-11lpom8"&&(f.textContent=M),I=a(E),h(x.$$.fragment,E)},m(E,L){s(E,f,L),s(E,I,L),l(x,E,L),w=!0},p:$t,i(E){w||(m(x.$$.fragment,E),w=!0)},o(E){_(x.$$.fragment,E),w=!1},d(E){E&&(r(f),r(I)),b(x,E)}}}function Dt(be){let f,M,I,x,w,E,L,Fn='Inference Endpoints provides a secure production solution to easily deploy models on a dedicated and autoscaling infrastructure managed by Hugging Face. An Inference Endpoint is built from a model from the <a href="https://huggingface.co/models" rel="nofollow">Hub</a>. This page is a reference for <code>huggingface_hub</code>’s integration with Inference Endpoints. For more information about the Inference Endpoints product, check out its <a href="https://huggingface.co/docs/inference-endpoints/index" rel="nofollow">official documentation</a>.',Ge,j,Fe,G,Zn='Inference Endpoints can be fully managed via API. The endpoints are documented with <a href="https://api.endpoints.huggingface.cloud/" rel="nofollow">Swagger</a>. The <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint">InferenceEndpoint</a> class is a simple wrapper built on top on this API.',Ze,F,Be,Z,Bn='A subset of the Inference Endpoint features are implemented in <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi">HfApi</a>:',Qe,B,Qn='<li><a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.get_inference_endpoint">get_inference_endpoint()</a> and <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.list_inference_endpoints">list_inference_endpoints()</a> to get information about your Inference Endpoints</li> <li><a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.create_inference_endpoint">create_inference_endpoint()</a>, <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.update_inference_endpoint">update_inference_endpoint()</a> and <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.delete_inference_endpoint">delete_inference_endpoint()</a> to deploy and manage Inference Endpoints</li> <li><a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.pause_inference_endpoint">pause_inference_endpoint()</a> and <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.resume_inference_endpoint">resume_inference_endpoint()</a> to pause and resume an Inference Endpoint</li> <li><a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.scale_to_zero_inference_endpoint">scale_to_zero_inference_endpoint()</a> to manually scale an Endpoint to 0 replicas</li>',Ye,Q,Xe,Y,Yn='The main dataclass is <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint">InferenceEndpoint</a>. It contains information about a deployed <code>InferenceEndpoint</code>, including its configuration and current state. Once deployed, you can run inference on the Endpoint using the  <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.client">InferenceEndpoint.client</a> and <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.async_client">InferenceEndpoint.async_client</a> properties that respectively return an <a href="/docs/huggingface_hub/main/en/package_reference/inference_client#huggingface_hub.InferenceClient">InferenceClient</a> and an <a href="/docs/huggingface_hub/main/en/package_reference/inference_client#huggingface_hub.AsyncInferenceClient">AsyncInferenceClient</a> object.',Je,p,X,un,Ee,Xn="Contains information about a deployed Inference Endpoint.",hn,z,ln,q,J,mn,Ie,Jn="Initialize object from raw dictionary.",_n,V,K,bn,$e,Kn="Returns a client to make predictions on this Inference Endpoint.",En,S,ee,In,ve,et="Returns a client to make predictions on this Inference Endpoint.",$n,T,ne,vn,xe,nt="Delete the Inference Endpoint.",xn,ye,tt=`This operation is not reversible. If you don’t want to be charged for an Inference Endpoint, it is preferable
to pause it with <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.pause">InferenceEndpoint.pause()</a> or scale it to zero with <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.scale_to_zero">InferenceEndpoint.scale_to_zero()</a>.`,yn,we,at='This is an alias for <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.delete_inference_endpoint">HfApi.delete_inference_endpoint()</a>.',wn,N,te,Tn,Te,rt="Fetch latest information about the Inference Endpoint.",kn,k,ae,Cn,ke,it="Pause the Inference Endpoint.",Hn,Ce,ot=`A paused Inference Endpoint will not be charged. It can be resumed at any time using <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.resume">InferenceEndpoint.resume()</a>.
This is different than scaling the Inference Endpoint to zero with <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.scale_to_zero">InferenceEndpoint.scale_to_zero()</a>, which
would be automatically restarted when a request is made to it.`,Ln,He,ct=`This is an alias for <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.pause_inference_endpoint">HfApi.pause_inference_endpoint()</a>. The current object is mutated in place with the
latest data from the server.`,Mn,P,re,Pn,Le,st="Resume the Inference Endpoint.",Dn,Me,pt=`This is an alias for <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.resume_inference_endpoint">HfApi.resume_inference_endpoint()</a>. The current object is mutated in place with the
latest data from the server.`,An,C,ie,jn,Pe,dt="Scale Inference Endpoint to zero.",zn,De,gt=`An Inference Endpoint scaled to zero will not be charged. It will be resume on the next request to it, with a
cold start delay. This is different than pausing the Inference Endpoint with <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.pause">InferenceEndpoint.pause()</a>, which
would require a manual resume with <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint.resume">InferenceEndpoint.resume()</a>.`,qn,Ae,ft=`This is an alias for <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.scale_to_zero_inference_endpoint">HfApi.scale_to_zero_inference_endpoint()</a>. The current object is mutated in place with the
latest data from the server.`,Vn,H,oe,Sn,je,ut="Update the Inference Endpoint.",Nn,ze,ht=`This method allows the update of either the compute configuration, the deployed model, or both. All arguments are
optional but at least one must be provided.`,Un,qe,lt=`This is an alias for <a href="/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.update_inference_endpoint">HfApi.update_inference_endpoint()</a>. The current object is mutated in place with the
latest data from the server.`,Wn,D,ce,On,Ve,mt="Wait for the Inference Endpoint to be deployed.",Rn,Se,_t=`Information from the server will be fetched every 1s. If the Inference Endpoint is not deployed after <code>timeout</code>
seconds, a <code>InferenceEndpointTimeoutError</code> will be raised. The <a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint">InferenceEndpoint</a> will be mutated in place with the latest
data.`,Ke,se,en,pe,de,nn,ge,tn,fe,ue,an,he,rn,A,le,Gn,Ne,bt="Generic exception when dealing with Inference Endpoints.",on,me,cn,Re,sn;return w=new Oe({props:{title:"Inference Endpoints",local:"inference-endpoints",headingTag:"h1"}}),j=new kt({props:{$$slots:{default:[Mt]},$$scope:{ctx:be}}}),F=new Oe({props:{title:"Methods",local:"methods",headingTag:"h2"}}),Q=new Oe({props:{title:"InferenceEndpoint",local:"huggingface_hub.InferenceEndpoint",headingTag:"h2"}}),X=new y({props:{name:"class huggingface_hub.InferenceEndpoint",anchor:"huggingface_hub.InferenceEndpoint",parameters:[{name:"namespace",val:": str"},{name:"raw",val:": Dict"},{name:"_token",val:": Union"},{name:"_api",val:": HfApi"}],parametersDescription:[{anchor:"huggingface_hub.InferenceEndpoint.name",description:`<strong>name</strong> (<code>str</code>) &#x2014;
The unique name of the Inference Endpoint.`,name:"name"},{anchor:"huggingface_hub.InferenceEndpoint.namespace",description:`<strong>namespace</strong> (<code>str</code>) &#x2014;
The namespace where the Inference Endpoint is located.`,name:"namespace"},{anchor:"huggingface_hub.InferenceEndpoint.repository",description:`<strong>repository</strong> (<code>str</code>) &#x2014;
The name of the model repository deployed on this Inference Endpoint.`,name:"repository"},{anchor:"huggingface_hub.InferenceEndpoint.status",description:`<strong>status</strong> (<a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointStatus">InferenceEndpointStatus</a>) &#x2014;
The current status of the Inference Endpoint.`,name:"status"},{anchor:"huggingface_hub.InferenceEndpoint.url",description:`<strong>url</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The URL of the Inference Endpoint, if available. Only a deployed Inference Endpoint will have a URL.`,name:"url"},{anchor:"huggingface_hub.InferenceEndpoint.framework",description:`<strong>framework</strong> (<code>str</code>) &#x2014;
The machine learning framework used for the model.`,name:"framework"},{anchor:"huggingface_hub.InferenceEndpoint.revision",description:`<strong>revision</strong> (<code>str</code>) &#x2014;
The specific model revision deployed on the Inference Endpoint.`,name:"revision"},{anchor:"huggingface_hub.InferenceEndpoint.task",description:`<strong>task</strong> (<code>str</code>) &#x2014;
The task associated with the deployed model.`,name:"task"},{anchor:"huggingface_hub.InferenceEndpoint.created_at",description:`<strong>created_at</strong> (<code>datetime.datetime</code>) &#x2014;
The timestamp when the Inference Endpoint was created.`,name:"created_at"},{anchor:"huggingface_hub.InferenceEndpoint.updated_at",description:`<strong>updated_at</strong> (<code>datetime.datetime</code>) &#x2014;
The timestamp of the last update of the Inference Endpoint.`,name:"updated_at"},{anchor:"huggingface_hub.InferenceEndpoint.type",description:`<strong>type</strong> (<a href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointType">InferenceEndpointType</a>) &#x2014;
The type of the Inference Endpoint (public, protected, private).`,name:"type"},{anchor:"huggingface_hub.InferenceEndpoint.raw",description:`<strong>raw</strong> (<code>Dict</code>) &#x2014;
The raw dictionary data returned from the API.`,name:"raw"},{anchor:"huggingface_hub.InferenceEndpoint.token",description:`<strong>token</strong> (<code>str</code> or <code>bool</code>, <em>optional</em>) &#x2014;
Authentication token for the Inference Endpoint, if set when requesting the API. Will default to the
locally saved token if not provided. Pass <code>token=False</code> if you don&#x2019;t want to send your token to the server.`,name:"token"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L38"}}),z=new Ht({props:{anchor:"huggingface_hub.InferenceEndpoint.example",$$slots:{default:[Pt]},$$scope:{ctx:be}}}),J=new y({props:{name:"from_raw",anchor:"huggingface_hub.InferenceEndpoint.from_raw",parameters:[{name:"raw",val:": Dict"},{name:"namespace",val:": str"},{name:"token",val:": Union = None"},{name:"api",val:": Optional = None"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L121"}}),K=new y({props:{name:"client",anchor:"huggingface_hub.InferenceEndpoint.client",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L140",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>an inference client pointing to the deployed endpoint.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_client#huggingface_hub.InferenceClient"
>InferenceClient</a></p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError"
>InferenceEndpointError</a> — If the Inference Endpoint is not yet deployed.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError"
>InferenceEndpointError</a></p>
`}}),ee=new y({props:{name:"async_client",anchor:"huggingface_hub.InferenceEndpoint.async_client",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L157",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>an asyncio-compatible inference client pointing to the deployed endpoint.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_client#huggingface_hub.AsyncInferenceClient"
>AsyncInferenceClient</a></p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError"
>InferenceEndpointError</a> — If the Inference Endpoint is not yet deployed.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError"
>InferenceEndpointError</a></p>
`}}),ne=new y({props:{name:"delete",anchor:"huggingface_hub.InferenceEndpoint.delete",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L369"}}),te=new y({props:{name:"fetch",anchor:"huggingface_hub.InferenceEndpoint.fetch",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L221",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>the same Inference Endpoint, mutated in place with the latest data.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint"
>InferenceEndpoint</a></p>
`}}),ae=new y({props:{name:"pause",anchor:"huggingface_hub.InferenceEndpoint.pause",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L312",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>the same Inference Endpoint, mutated in place with the latest data.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint"
>InferenceEndpoint</a></p>
`}}),re=new y({props:{name:"resume",anchor:"huggingface_hub.InferenceEndpoint.resume",parameters:[{name:"running_ok",val:": bool = True"}],parametersDescription:[{anchor:"huggingface_hub.InferenceEndpoint.resume.running_ok",description:`<strong>running_ok</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If <code>True</code>, the method will not raise an error if the Inference Endpoint is already running. Defaults to
<code>True</code>.`,name:"running_ok"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L330",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>the same Inference Endpoint, mutated in place with the latest data.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint"
>InferenceEndpoint</a></p>
`}}),ie=new y({props:{name:"scale_to_zero",anchor:"huggingface_hub.InferenceEndpoint.scale_to_zero",parameters:[],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L351",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>the same Inference Endpoint, mutated in place with the latest data.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint"
>InferenceEndpoint</a></p>
`}}),oe=new y({props:{name:"update",anchor:"huggingface_hub.InferenceEndpoint.update",parameters:[{name:"accelerator",val:": Optional = None"},{name:"instance_size",val:": Optional = None"},{name:"instance_type",val:": Optional = None"},{name:"min_replica",val:": Optional = None"},{name:"max_replica",val:": Optional = None"},{name:"scale_to_zero_timeout",val:": Optional = None"},{name:"repository",val:": Optional = None"},{name:"framework",val:": Optional = None"},{name:"revision",val:": Optional = None"},{name:"task",val:": Optional = None"},{name:"custom_image",val:": Optional = None"},{name:"secrets",val:": Optional = None"}],parametersDescription:[{anchor:"huggingface_hub.InferenceEndpoint.update.accelerator",description:`<strong>accelerator</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The hardware accelerator to be used for inference (e.g. <code>&quot;cpu&quot;</code>).`,name:"accelerator"},{anchor:"huggingface_hub.InferenceEndpoint.update.instance_size",description:`<strong>instance_size</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The size or type of the instance to be used for hosting the model (e.g. <code>&quot;x4&quot;</code>).`,name:"instance_size"},{anchor:"huggingface_hub.InferenceEndpoint.update.instance_type",description:`<strong>instance_type</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The cloud instance type where the Inference Endpoint will be deployed (e.g. <code>&quot;intel-icl&quot;</code>).`,name:"instance_type"},{anchor:"huggingface_hub.InferenceEndpoint.update.min_replica",description:`<strong>min_replica</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The minimum number of replicas (instances) to keep running for the Inference Endpoint.`,name:"min_replica"},{anchor:"huggingface_hub.InferenceEndpoint.update.max_replica",description:`<strong>max_replica</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum number of replicas (instances) to scale to for the Inference Endpoint.`,name:"max_replica"},{anchor:"huggingface_hub.InferenceEndpoint.update.scale_to_zero_timeout",description:`<strong>scale_to_zero_timeout</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The duration in minutes before an inactive endpoint is scaled to zero.`,name:"scale_to_zero_timeout"},{anchor:"huggingface_hub.InferenceEndpoint.update.repository",description:`<strong>repository</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of the model repository associated with the Inference Endpoint (e.g. <code>&quot;gpt2&quot;</code>).`,name:"repository"},{anchor:"huggingface_hub.InferenceEndpoint.update.framework",description:`<strong>framework</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The machine learning framework used for the model (e.g. <code>&quot;custom&quot;</code>).`,name:"framework"},{anchor:"huggingface_hub.InferenceEndpoint.update.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The specific model revision to deploy on the Inference Endpoint (e.g. <code>&quot;6c0e6080953db56375760c0471a8c5f2929baf11&quot;</code>).`,name:"revision"},{anchor:"huggingface_hub.InferenceEndpoint.update.task",description:`<strong>task</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The task on which to deploy the model (e.g. <code>&quot;text-classification&quot;</code>).`,name:"task"},{anchor:"huggingface_hub.InferenceEndpoint.update.custom_image",description:`<strong>custom_image</strong> (<code>Dict</code>, <em>optional</em>) &#x2014;
A custom Docker image to use for the Inference Endpoint. This is useful if you want to deploy an
Inference Endpoint running on the <code>text-generation-inference</code> (TGI) framework (see examples).`,name:"custom_image"},{anchor:"huggingface_hub.InferenceEndpoint.update.secrets",description:`<strong>secrets</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
Secret values to inject in the container environment.`,name:"secrets"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L232",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>the same Inference Endpoint, mutated in place with the latest data.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint"
>InferenceEndpoint</a></p>
`}}),ce=new y({props:{name:"wait",anchor:"huggingface_hub.InferenceEndpoint.wait",parameters:[{name:"timeout",val:": Optional = None"},{name:"refresh_every",val:": int = 5"}],parametersDescription:[{anchor:"huggingface_hub.InferenceEndpoint.wait.timeout",description:`<strong>timeout</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum time to wait for the Inference Endpoint to be deployed, in seconds. If <code>None</code>, will wait
indefinitely.`,name:"timeout"},{anchor:"huggingface_hub.InferenceEndpoint.wait.refresh_every",description:`<strong>refresh_every</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The time to wait between each fetch of the Inference Endpoint status, in seconds. Defaults to 5s.`,name:"refresh_every"}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L174",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>the same Inference Endpoint, mutated in place with the latest data.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpoint"
>InferenceEndpoint</a></p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError"
>InferenceEndpointError</a> —
If the Inference Endpoint ended up in a failed state.</li>
<li><code>InferenceEndpointTimeoutError</code> —
If the Inference Endpoint is not deployed after <code>timeout</code> seconds.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/huggingface_hub/main/en/package_reference/inference_endpoints#huggingface_hub.InferenceEndpointError"
>InferenceEndpointError</a> or <code>InferenceEndpointTimeoutError</code></p>
`}}),se=new Oe({props:{title:"InferenceEndpointStatus",local:"huggingface_hub.InferenceEndpointStatus",headingTag:"h2"}}),de=new y({props:{name:"class huggingface_hub.InferenceEndpointStatus",anchor:"huggingface_hub.InferenceEndpointStatus",parameters:[{name:"*values",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L21"}}),ge=new Oe({props:{title:"InferenceEndpointType",local:"huggingface_hub.InferenceEndpointType",headingTag:"h2"}}),ue=new y({props:{name:"class huggingface_hub.InferenceEndpointType",anchor:"huggingface_hub.InferenceEndpointType",parameters:[{name:"*values",val:""}],source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/_inference_endpoints.py#L32"}}),he=new Oe({props:{title:"InferenceEndpointError",local:"huggingface_hub.InferenceEndpointError",headingTag:"h2"}}),le=new y({props:{name:"class huggingface_hub.InferenceEndpointError",anchor:"huggingface_hub.InferenceEndpointError",parameters:"",source:"https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/errors.py#L99"}}),me=new Lt({props:{source:"https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/inference_endpoints.md"}}),{c(){f=o("meta"),M=t(),I=o("p"),x=t(),u(w.$$.fragment),E=t(),L=o("p"),L.innerHTML=Fn,Ge=t(),u(j.$$.fragment),Fe=t(),G=o("p"),G.innerHTML=Zn,Ze=t(),u(F.$$.fragment),Be=t(),Z=o("p"),Z.innerHTML=Bn,Qe=t(),B=o("ul"),B.innerHTML=Qn,Ye=t(),u(Q.$$.fragment),Xe=t(),Y=o("p"),Y.innerHTML=Yn,Je=t(),p=o("div"),u(X.$$.fragment),un=t(),Ee=o("p"),Ee.textContent=Xn,hn=t(),u(z.$$.fragment),ln=t(),q=o("div"),u(J.$$.fragment),mn=t(),Ie=o("p"),Ie.textContent=Jn,_n=t(),V=o("div"),u(K.$$.fragment),bn=t(),$e=o("p"),$e.textContent=Kn,En=t(),S=o("div"),u(ee.$$.fragment),In=t(),ve=o("p"),ve.textContent=et,$n=t(),T=o("div"),u(ne.$$.fragment),vn=t(),xe=o("p"),xe.textContent=nt,xn=t(),ye=o("p"),ye.innerHTML=tt,yn=t(),we=o("p"),we.innerHTML=at,wn=t(),N=o("div"),u(te.$$.fragment),Tn=t(),Te=o("p"),Te.textContent=rt,kn=t(),k=o("div"),u(ae.$$.fragment),Cn=t(),ke=o("p"),ke.textContent=it,Hn=t(),Ce=o("p"),Ce.innerHTML=ot,Ln=t(),He=o("p"),He.innerHTML=ct,Mn=t(),P=o("div"),u(re.$$.fragment),Pn=t(),Le=o("p"),Le.textContent=st,Dn=t(),Me=o("p"),Me.innerHTML=pt,An=t(),C=o("div"),u(ie.$$.fragment),jn=t(),Pe=o("p"),Pe.textContent=dt,zn=t(),De=o("p"),De.innerHTML=gt,qn=t(),Ae=o("p"),Ae.innerHTML=ft,Vn=t(),H=o("div"),u(oe.$$.fragment),Sn=t(),je=o("p"),je.textContent=ut,Nn=t(),ze=o("p"),ze.textContent=ht,Un=t(),qe=o("p"),qe.innerHTML=lt,Wn=t(),D=o("div"),u(ce.$$.fragment),On=t(),Ve=o("p"),Ve.textContent=mt,Rn=t(),Se=o("p"),Se.innerHTML=_t,Ke=t(),u(se.$$.fragment),en=t(),pe=o("div"),u(de.$$.fragment),nn=t(),u(ge.$$.fragment),tn=t(),fe=o("div"),u(ue.$$.fragment),an=t(),u(he.$$.fragment),rn=t(),A=o("div"),u(le.$$.fragment),Gn=t(),Ne=o("p"),Ne.textContent=bt,on=t(),u(me.$$.fragment),cn=t(),Re=o("p"),this.h()},l(e){const i=Tt("svelte-u9bgzb",document.head);f=c(i,"META",{name:!0,content:!0}),i.forEach(r),M=a(e),I=c(e,"P",{}),$(I).forEach(r),x=a(e),h(w.$$.fragment,e),E=a(e),L=c(e,"P",{"data-svelte-h":!0}),g(L)!=="svelte-1bwc3b2"&&(L.innerHTML=Fn),Ge=a(e),h(j.$$.fragment,e),Fe=a(e),G=c(e,"P",{"data-svelte-h":!0}),g(G)!=="svelte-1ook8pb"&&(G.innerHTML=Zn),Ze=a(e),h(F.$$.fragment,e),Be=a(e),Z=c(e,"P",{"data-svelte-h":!0}),g(Z)!=="svelte-gr0aub"&&(Z.innerHTML=Bn),Qe=a(e),B=c(e,"UL",{"data-svelte-h":!0}),g(B)!=="svelte-1n53imw"&&(B.innerHTML=Qn),Ye=a(e),h(Q.$$.fragment,e),Xe=a(e),Y=c(e,"P",{"data-svelte-h":!0}),g(Y)!=="svelte-1yhwkew"&&(Y.innerHTML=Yn),Je=a(e),p=c(e,"DIV",{class:!0});var d=$(p);h(X.$$.fragment,d),un=a(d),Ee=c(d,"P",{"data-svelte-h":!0}),g(Ee)!=="svelte-1bmjqnv"&&(Ee.textContent=Xn),hn=a(d),h(z.$$.fragment,d),ln=a(d),q=c(d,"DIV",{class:!0});var _e=$(q);h(J.$$.fragment,_e),mn=a(_e),Ie=c(_e,"P",{"data-svelte-h":!0}),g(Ie)!=="svelte-gljdbx"&&(Ie.textContent=Jn),_e.forEach(r),_n=a(d),V=c(d,"DIV",{class:!0});var pn=$(V);h(K.$$.fragment,pn),bn=a(pn),$e=c(pn,"P",{"data-svelte-h":!0}),g($e)!=="svelte-jw5rtn"&&($e.textContent=Kn),pn.forEach(r),En=a(d),S=c(d,"DIV",{class:!0});var dn=$(S);h(ee.$$.fragment,dn),In=a(dn),ve=c(dn,"P",{"data-svelte-h":!0}),g(ve)!=="svelte-jw5rtn"&&(ve.textContent=et),dn.forEach(r),$n=a(d),T=c(d,"DIV",{class:!0});var U=$(T);h(ne.$$.fragment,U),vn=a(U),xe=c(U,"P",{"data-svelte-h":!0}),g(xe)!=="svelte-1awp4uu"&&(xe.textContent=nt),xn=a(U),ye=c(U,"P",{"data-svelte-h":!0}),g(ye)!=="svelte-4lmb5p"&&(ye.innerHTML=tt),yn=a(U),we=c(U,"P",{"data-svelte-h":!0}),g(we)!=="svelte-1kr19ul"&&(we.innerHTML=at),U.forEach(r),wn=a(d),N=c(d,"DIV",{class:!0});var gn=$(N);h(te.$$.fragment,gn),Tn=a(gn),Te=c(gn,"P",{"data-svelte-h":!0}),g(Te)!=="svelte-1dh96nb"&&(Te.textContent=rt),gn.forEach(r),kn=a(d),k=c(d,"DIV",{class:!0});var W=$(k);h(ae.$$.fragment,W),Cn=a(W),ke=c(W,"P",{"data-svelte-h":!0}),g(ke)!=="svelte-1bfttgz"&&(ke.textContent=it),Hn=a(W),Ce=c(W,"P",{"data-svelte-h":!0}),g(Ce)!=="svelte-1c175wq"&&(Ce.innerHTML=ot),Ln=a(W),He=c(W,"P",{"data-svelte-h":!0}),g(He)!=="svelte-18i7q4g"&&(He.innerHTML=ct),W.forEach(r),Mn=a(d),P=c(d,"DIV",{class:!0});var Ue=$(P);h(re.$$.fragment,Ue),Pn=a(Ue),Le=c(Ue,"P",{"data-svelte-h":!0}),g(Le)!=="svelte-akp3j2"&&(Le.textContent=st),Dn=a(Ue),Me=c(Ue,"P",{"data-svelte-h":!0}),g(Me)!=="svelte-1m76tq0"&&(Me.innerHTML=pt),Ue.forEach(r),An=a(d),C=c(d,"DIV",{class:!0});var O=$(C);h(ie.$$.fragment,O),jn=a(O),Pe=c(O,"P",{"data-svelte-h":!0}),g(Pe)!=="svelte-6vx93v"&&(Pe.textContent=dt),zn=a(O),De=c(O,"P",{"data-svelte-h":!0}),g(De)!=="svelte-1rhv9ms"&&(De.innerHTML=gt),qn=a(O),Ae=c(O,"P",{"data-svelte-h":!0}),g(Ae)!=="svelte-3v5am2"&&(Ae.innerHTML=ft),O.forEach(r),Vn=a(d),H=c(d,"DIV",{class:!0});var R=$(H);h(oe.$$.fragment,R),Sn=a(R),je=c(R,"P",{"data-svelte-h":!0}),g(je)!=="svelte-16hllis"&&(je.textContent=ut),Nn=a(R),ze=c(R,"P",{"data-svelte-h":!0}),g(ze)!=="svelte-llxqqu"&&(ze.textContent=ht),Un=a(R),qe=c(R,"P",{"data-svelte-h":!0}),g(qe)!=="svelte-i2krcs"&&(qe.innerHTML=lt),R.forEach(r),Wn=a(d),D=c(d,"DIV",{class:!0});var We=$(D);h(ce.$$.fragment,We),On=a(We),Ve=c(We,"P",{"data-svelte-h":!0}),g(Ve)!=="svelte-15saqtl"&&(Ve.textContent=mt),Rn=a(We),Se=c(We,"P",{"data-svelte-h":!0}),g(Se)!=="svelte-zp8tqi"&&(Se.innerHTML=_t),We.forEach(r),d.forEach(r),Ke=a(e),h(se.$$.fragment,e),en=a(e),pe=c(e,"DIV",{class:!0});var Et=$(pe);h(de.$$.fragment,Et),Et.forEach(r),nn=a(e),h(ge.$$.fragment,e),tn=a(e),fe=c(e,"DIV",{class:!0});var It=$(fe);h(ue.$$.fragment,It),It.forEach(r),an=a(e),h(he.$$.fragment,e),rn=a(e),A=c(e,"DIV",{class:!0});var fn=$(A);h(le.$$.fragment,fn),Gn=a(fn),Ne=c(fn,"P",{"data-svelte-h":!0}),g(Ne)!=="svelte-dy4pdd"&&(Ne.textContent=bt),fn.forEach(r),on=a(e),h(me.$$.fragment,e),cn=a(e),Re=c(e,"P",{}),$(Re).forEach(r),this.h()},h(){v(f,"name","hf:doc:metadata"),v(f,"content",At),v(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(p,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),v(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,i){n(document.head,f),s(e,M,i),s(e,I,i),s(e,x,i),l(w,e,i),s(e,E,i),s(e,L,i),s(e,Ge,i),l(j,e,i),s(e,Fe,i),s(e,G,i),s(e,Ze,i),l(F,e,i),s(e,Be,i),s(e,Z,i),s(e,Qe,i),s(e,B,i),s(e,Ye,i),l(Q,e,i),s(e,Xe,i),s(e,Y,i),s(e,Je,i),s(e,p,i),l(X,p,null),n(p,un),n(p,Ee),n(p,hn),l(z,p,null),n(p,ln),n(p,q),l(J,q,null),n(q,mn),n(q,Ie),n(p,_n),n(p,V),l(K,V,null),n(V,bn),n(V,$e),n(p,En),n(p,S),l(ee,S,null),n(S,In),n(S,ve),n(p,$n),n(p,T),l(ne,T,null),n(T,vn),n(T,xe),n(T,xn),n(T,ye),n(T,yn),n(T,we),n(p,wn),n(p,N),l(te,N,null),n(N,Tn),n(N,Te),n(p,kn),n(p,k),l(ae,k,null),n(k,Cn),n(k,ke),n(k,Hn),n(k,Ce),n(k,Ln),n(k,He),n(p,Mn),n(p,P),l(re,P,null),n(P,Pn),n(P,Le),n(P,Dn),n(P,Me),n(p,An),n(p,C),l(ie,C,null),n(C,jn),n(C,Pe),n(C,zn),n(C,De),n(C,qn),n(C,Ae),n(p,Vn),n(p,H),l(oe,H,null),n(H,Sn),n(H,je),n(H,Nn),n(H,ze),n(H,Un),n(H,qe),n(p,Wn),n(p,D),l(ce,D,null),n(D,On),n(D,Ve),n(D,Rn),n(D,Se),s(e,Ke,i),l(se,e,i),s(e,en,i),s(e,pe,i),l(de,pe,null),s(e,nn,i),l(ge,e,i),s(e,tn,i),s(e,fe,i),l(ue,fe,null),s(e,an,i),l(he,e,i),s(e,rn,i),s(e,A,i),l(le,A,null),n(A,Gn),n(A,Ne),s(e,on,i),l(me,e,i),s(e,cn,i),s(e,Re,i),sn=!0},p(e,[i]){const d={};i&2&&(d.$$scope={dirty:i,ctx:e}),j.$set(d);const _e={};i&2&&(_e.$$scope={dirty:i,ctx:e}),z.$set(_e)},i(e){sn||(m(w.$$.fragment,e),m(j.$$.fragment,e),m(F.$$.fragment,e),m(Q.$$.fragment,e),m(X.$$.fragment,e),m(z.$$.fragment,e),m(J.$$.fragment,e),m(K.$$.fragment,e),m(ee.$$.fragment,e),m(ne.$$.fragment,e),m(te.$$.fragment,e),m(ae.$$.fragment,e),m(re.$$.fragment,e),m(ie.$$.fragment,e),m(oe.$$.fragment,e),m(ce.$$.fragment,e),m(se.$$.fragment,e),m(de.$$.fragment,e),m(ge.$$.fragment,e),m(ue.$$.fragment,e),m(he.$$.fragment,e),m(le.$$.fragment,e),m(me.$$.fragment,e),sn=!0)},o(e){_(w.$$.fragment,e),_(j.$$.fragment,e),_(F.$$.fragment,e),_(Q.$$.fragment,e),_(X.$$.fragment,e),_(z.$$.fragment,e),_(J.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(ne.$$.fragment,e),_(te.$$.fragment,e),_(ae.$$.fragment,e),_(re.$$.fragment,e),_(ie.$$.fragment,e),_(oe.$$.fragment,e),_(ce.$$.fragment,e),_(se.$$.fragment,e),_(de.$$.fragment,e),_(ge.$$.fragment,e),_(ue.$$.fragment,e),_(he.$$.fragment,e),_(le.$$.fragment,e),_(me.$$.fragment,e),sn=!1},d(e){e&&(r(M),r(I),r(x),r(E),r(L),r(Ge),r(Fe),r(G),r(Ze),r(Be),r(Z),r(Qe),r(B),r(Ye),r(Xe),r(Y),r(Je),r(p),r(Ke),r(en),r(pe),r(nn),r(tn),r(fe),r(an),r(rn),r(A),r(on),r(cn),r(Re)),r(f),b(w,e),b(j,e),b(F,e),b(Q,e),b(X),b(z),b(J),b(K),b(ee),b(ne),b(te),b(ae),b(re),b(ie),b(oe),b(ce),b(se,e),b(de),b(ge,e),b(ue),b(he,e),b(le),b(me,e)}}}const At='{"title":"Inference Endpoints","local":"inference-endpoints","sections":[{"title":"Methods","local":"methods","sections":[],"depth":2},{"title":"InferenceEndpoint","local":"huggingface_hub.InferenceEndpoint","sections":[],"depth":2},{"title":"InferenceEndpointStatus","local":"huggingface_hub.InferenceEndpointStatus","sections":[],"depth":2},{"title":"InferenceEndpointType","local":"huggingface_hub.InferenceEndpointType","sections":[],"depth":2},{"title":"InferenceEndpointError","local":"huggingface_hub.InferenceEndpointError","sections":[],"depth":2}],"depth":1}';function jt(be){return xt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ot extends yt{constructor(f){super(),wt(this,f,jt,Dt,vt,{})}}export{Ot as component};
