Buckets:

rtrm's picture
download
raw
44.4 kB
import{s as rt,n as it,f as bn,r as wn,o as Jn}from"../chunks/scheduler.b108d059.js";import{S as ct,i as ut,A as Ul,B as jl,j as k,f as l,k as C,a as n,y as v,g as i,s as a,m as Un,h as r,c as o,n as jn,l as Tn,o as Cn,r as y,u as g,v as T,C as ot,d as b,t as w,w as J,H as vn,D as In,E as $n,x as M}from"../chunks/index.77b310b1.js";import{H as W,E as Gn}from"../chunks/EditOnGithub.cc6c5d73.js";function Nn(p){const s=document.createElement("textarea");document.body.appendChild(s),s.value=p,s.select(),document.execCommand("copy"),document.body.removeChild(s)}function kn(p){let s,c,h,d;return{c(){s=Ul("svg"),c=Ul("path"),h=Ul("path"),d=Ul("rect"),this.h()},l(m){s=jl(m,"svg",{class:!0,xmlns:!0,"aria-hidden":!0,fill:!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var u=k(s);c=jl(u,"path",{d:!0,transform:!0}),k(c).forEach(l),h=jl(u,"path",{d:!0,transform:!0}),k(h).forEach(l),d=jl(u,"rect",{fill:!0,width:!0,height:!0}),k(d).forEach(l),u.forEach(l),this.h()},h(){C(c,"d","M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z"),C(c,"transform","translate(0)"),C(h,"d","M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z"),C(h,"transform","translate(0)"),C(d,"fill","none"),C(d,"width","32"),C(d,"height","32"),C(s,"class",p[0]),C(s,"xmlns","http://www.w3.org/2000/svg"),C(s,"aria-hidden","true"),C(s,"fill","currentColor"),C(s,"focusable","false"),C(s,"role","img"),C(s,"width","1em"),C(s,"height","1em"),C(s,"preserveAspectRatio","xMidYMid meet"),C(s,"viewBox","0 0 32 32")},m(m,u){n(m,s,u),v(s,c),v(s,h),v(s,d)},p(m,[u]){u&1&&C(s,"class",m[0])},i:it,o:it,d(m){m&&l(s)}}}function Zn(p,s,c){let{classNames:h=""}=s;return p.$$set=d=>{"classNames"in d&&c(0,h=d.classNames)},[h]}class _n extends ct{constructor(s){super(),ut(this,s,Zn,kn,rt,{classNames:0})}}function xn(p){let s,c,h,d,m;return{c(){s=i("div"),c=i("div"),h=a(),d=Un(p[1]),this.h()},l(u){s=r(u,"DIV",{class:!0});var U=k(s);c=r(U,"DIV",{class:!0,style:!0}),k(c).forEach(l),h=o(U),d=jn(U,p[1]),U.forEach(l),this.h()},h(){C(c,"class","absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0"),Tn(c,"border-left-color","transparent"),Tn(c,"border-right-color","transparent"),C(s,"class",m="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow "+p[2]+" "+p[0])},m(u,U){n(u,s,U),v(s,c),v(s,h),v(s,d)},p(u,[U]){U&2&&Cn(d,u[1]),U&5&&m!==(m="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow "+u[2]+" "+u[0])&&C(s,"class",m)},i:it,o:it,d(u){u&&l(s)}}}function Wn(p,s,c){let{classNames:h=""}=s,{label:d="Copied"}=s,{position:m="left-1/2 top-full transform -translate-x-1/2 translate-y-2"}=s;return p.$$set=u=>{"classNames"in u&&c(0,h=u.classNames),"label"in u&&c(1,d=u.label),"position"in u&&c(2,m=u.position)},[h,d,m]}class En extends ct{constructor(s){super(),ut(this,s,Wn,xn,rt,{classNames:0,label:1,position:2})}}function Vn(p){let s,c,h,d,m,u,U,N,I;return c=new _n({}),d=new En({props:{classNames:p[4]?"opacity-100":"opacity-0"}}),{c(){s=i("button"),y(c.$$.fragment),h=a(),y(d.$$.fragment),this.h()},l(j){s=r(j,"BUTTON",{class:!0,title:!0,type:!0});var f=k(s);g(c.$$.fragment,f),h=o(f),g(d.$$.fragment,f),f.forEach(l),this.h()},h(){C(s,"class",m="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none "+p[0]+" "+(p[2]==="text"?"mx-0.5":"")+" "+(p[2]==="button"?"btn":"")+" "+(p[2]==="button-clear"?"py-1 px-2 border rounded-lg shadow-sm":"")+" "+(!p[4]&&["button-clear","text"].includes(p[2])?"text-gray-600":"")+" "+(p[4]?"text-green-500":"")),C(s,"title",u=p[3]||p[1]||"Copy to clipboard"),C(s,"type","button")},m(j,f){n(j,s,f),T(c,s,null),v(s,h),T(d,s,null),U=!0,N||(I=ot(s,"click",p[5]),N=!0)},p(j,[f]){const G={};f&16&&(G.classNames=j[4]?"opacity-100":"opacity-0"),d.$set(G),(!U||f&21&&m!==(m="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none "+j[0]+" "+(j[2]==="text"?"mx-0.5":"")+" "+(j[2]==="button"?"btn":"")+" "+(j[2]==="button-clear"?"py-1 px-2 border rounded-lg shadow-sm":"")+" "+(!j[4]&&["button-clear","text"].includes(j[2])?"text-gray-600":"")+" "+(j[4]?"text-green-500":"")))&&C(s,"class",m),(!U||f&10&&u!==(u=j[3]||j[1]||"Copy to clipboard"))&&C(s,"title",u)},i(j){U||(b(c.$$.fragment,j),b(d.$$.fragment,j),U=!0)},o(j){w(c.$$.fragment,j),w(d.$$.fragment,j),U=!1},d(j){j&&l(s),J(c),J(d),N=!1,I()}}}function Qn(p,s,c){let{classNames:h=""}=s,{label:d=""}=s,{style:m="text"}=s,{title:u=""}=s,{value:U}=s,N=!1,I;bn(()=>{I&&clearTimeout(I)});function j(){Nn(decodeURIComponent(atob(U))),c(4,N=!0),I&&clearTimeout(I),I=setTimeout(()=>{c(4,N=!1)},1e3)}return p.$$set=f=>{"classNames"in f&&c(0,h=f.classNames),"label"in f&&c(1,d=f.label),"style"in f&&c(2,m=f.style),"title"in f&&c(3,u=f.title),"value"in f&&c(6,U=f.value)},[h,d,m,u,N,j,U]}class Bn extends ct{constructor(s){super(),ut(this,s,Qn,Vn,rt,{classNames:0,label:1,style:2,title:3,value:6})}}function Ln(p){let s,c,h,d,m,u,U,N,I,j;return h=new Bn({props:{classNames:"transition duration-200 ease-in-out "+(p[3]&&"opacity-0"),label:"code excerpt",value:p[0]}}),{c(){s=i("div"),c=i("div"),y(h.$$.fragment),d=a(),m=i("pre"),u=new vn(!1),this.h()},l(f){s=r(f,"DIV",{class:!0});var G=k(s);c=r(G,"DIV",{class:!0});var x=k(c);g(h.$$.fragment,x),x.forEach(l),d=o(G),m=r(G,"PRE",{class:!0});var B=k(m);u=In(B,!1),B.forEach(l),G.forEach(l),this.h()},h(){C(c,"class","absolute top-2.5 right-4"),u.a=null,C(m,"class",U=p[2]?"whitespace-pre-wrap":""),C(s,"class","code-block relative")},m(f,G){n(f,s,G),v(s,c),T(h,c,null),v(s,d),v(s,m),u.m(p[1],m),N=!0,I||(j=[ot(s,"mouseover",p[4]),ot(s,"focus",p[4]),ot(s,"mouseout",p[5]),ot(s,"blur",p[5])],I=!0)},p(f,[G]){const x={};G&8&&(x.classNames="transition duration-200 ease-in-out "+(f[3]&&"opacity-0")),G&1&&(x.value=f[0]),h.$set(x),(!N||G&2)&&u.p(f[1]),(!N||G&4&&U!==(U=f[2]?"whitespace-pre-wrap":""))&&C(m,"class",U)},i(f){N||(b(h.$$.fragment,f),N=!0)},o(f){w(h.$$.fragment,f),N=!1},d(f){f&&l(s),J(h),I=!1,wn(j)}}}function Rn(p,s,c){let h=!0,{code:d=""}=s,{highlighted:m=""}=s,{wrap:u=!1}=s;function U(){c(3,h=!1)}function N(){c(3,h=!0)}return p.$$set=I=>{"code"in I&&c(0,d=I.code),"highlighted"in I&&c(1,m=I.highlighted),"wrap"in I&&c(2,u=I.wrap)},[d,m,u,h,U,N]}class $ extends ct{constructor(s){super(),ut(this,s,Rn,Ln,rt,{code:0,highlighted:1,wrap:2})}}function An(p){let s,c,h,d,m,u,U,N="Meta Llama 3 is the latest LLM from the Llama family, released by Meta; coming in two sizes 8B and 70B, including both the base model and the instruction-tuned model. Text Generation Inference (TGI) is a toolkit developed by Hugging Face for deploying and serving LLMs, with high performance text generation. And, Google Kubernetes Engine (GKE) is a fully-managed Kubernetes service in Google Cloud that can be used to deploy and operate containerized applications at scale using GCP’s infrastructure. This post explains how to deploy an LLM from the Hugging Face Hub, as Llama3 8B Instruct, on a GKE Cluster running a purpose-built container to deploy LLMs in a secure and managed environment with the Hugging Face DLC for TGI.",I,j,f,G,x="First, you need to install both <code>gcloud</code> and <code>kubectl</code> in your local machine, which are the command-line tools for Google Cloud and Kubernetes, respectively, to interact with the GCP and the GKE Cluster.",B,L,xl='<li>To install <code>gcloud</code>, follow the instructions at <a href="https://cloud.google.com/sdk/docs/install" rel="nofollow">Cloud SDK Documentation - Install the gcloud CLI</a>.</li> <li>To install <code>kubectl</code>, follow the instructions at <a href="https://kubernetes.io/docs/tasks/tools/#kubectl" rel="nofollow">Kubernetes Documentation - Install Tools</a>.</li>',pt,R,Wl="Optionally, to ease the usage of the commands within this tutorial, you need to set the following environment variables for GCP:",ht,A,dt,X,El="Then you need to login into your GCP account and set the project ID to the one you want to use for the deployment of the GKE Cluster.",mt,H,ft,F,Vl="Once you are logged in, you need to enable the necessary service APIs in GCP, such as the Google Kubernetes Engine API, the Google Container Registry API, and the Google Container File System API, which are necessary for the deployment of the GKE Cluster and the Hugging Face DLC for TGI.",Mt,Y,yt,q,Ql="Additionally, to use <code>kubectl</code> with the GKE Cluster credentials, you also need to install the <code>gke-gcloud-auth-plugin</code>, that can be installed with <code>gcloud</code> as follows:",gt,S,Tt,D,Bl=`<p>[!NOTE]
Installing the <code>gke-gcloud-auth-plugin</code> does not need to be installed via <code>gcloud</code> specifically, to read more about the alternative installation methods, please visit <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin" rel="nofollow">https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl#install_plugin</a>.</p>`,bt,z,wt,P,Ll="Once everything’s set up, you can proceed with the creation of the GKE Cluster and the node pool, which in this case will be a single GPU node, in order to use the GPU accelerator for high performance inference, also following TGI recommendations based on their internal optimizations for GPUs.",Jt,K,Rl="To deploy the GKE Cluster, the “Autopilot” mode will be used as it is the recommended one for most of the workloads, since the underlying infrastructure is managed by Google. Alternatively, you can also use the “Standard” mode.",Ut,O,Al=`<p>[!NOTE]
Important to check before creating the GKE Autopilot Cluster the <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/performance-pods" rel="nofollow">GKE Documentation - Optimize Autopilot Pod performance by choosing a machine series</a>, since not all the versions support GPU accelerators e.g. <code>nvidia-l4</code> is not supported in the GKE cluster versions 1.28.3 or lower.</p>`,jt,ee,Ct,_,Pe,Xl=`[!NOTE]
To select the specific version in your location of the GKE Cluster, you can run the following command:`,Cl,te,vl,Ke,Hl='For more information please visit <a href="https://cloud.google.com/kubernetes-engine/versioning#specifying_cluster_version" rel="nofollow">https://cloud.google.com/kubernetes-engine/versioning#specifying_cluster_version</a>.',vt,le,Fl='<img src="./imgs/gke-cluster.png" alt="GKE Cluster in the GCP Console"/>',It,ne,Yl="Once the GKE Cluster is created, you can get the credentials to access it via <code>kubectl</code> with the following command:",$t,se,Gt,ae,Nt,oe,ql='As <a href="https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct" rel="nofollow"><code>meta-llama/Meta-Llama-3.1-8B-Instruct</code></a> is a gated model, you need to set a Kubernetes secret with the Hugging Face Hub token via <code>kubectl</code>.',kt,ie,Sl='To generate a custom token for the Hugging Face Hub, you can follow the instructions at <a href="https://huggingface.co/docs/hub/en/security-tokens" rel="nofollow">https://huggingface.co/docs/hub/en/security-tokens</a>; and the recommended way of setting it is to install the <code>huggingface_hub</code> Python SDK as follows:',Zt,re,_t,ce,Dl="And then login in with the generated token with read-access over the gated/private model:",xt,ue,Wt,pe,zl="Finally, you can create the Kubernetes secret with the generated token for the Hugging Face Hub as follows using the <code>huggingface_hub</code> Python SDK to retrieve the token:",Et,he,Vt,de,Pl="Or, alternatively, you can directly set the token as follows:",Qt,me,Bt,fe,Kl='<img src="./imgs/gke-secrets.png" alt="GKE Secret in the GCP Console"/>',Lt,Me,Ol='More information on how to set Kubernetes secrets in a GKE Cluster at <a href="https://cloud.google.com/secret-manager/docs/secret-manager-managed-csi-component" rel="nofollow">https://cloud.google.com/secret-manager/docs/secret-manager-managed-csi-component</a>.',Rt,ye,At,ge,en='Now you can proceed to the Kubernetes deployment of the Hugging Face DLC for TGI, serving the <a href="https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct" rel="nofollow"><code>meta-llama/Meta-Llama-3.1-8B-Instruct</code></a> model from the Hugging Face Hub.',Xt,Te,tn=`<p>[!NOTE]
To explore all the models that can be served via TGI, you can explore the models tagged with <code>text-generation-inference</code> in the Hub at <a href="https://huggingface.co/models?other=text-generation-inference" rel="nofollow">https://huggingface.co/models?other=text-generation-inference</a>.</p>`,Ht,be,ln="The Hugging Face DLC for TGI will be deployed via <code>kubectl</code>, from the configuration files in the <code>config/</code> directory:",Ft,we,nn='<li><p><code>deployment.yaml</code>: contains the deployment details of the pod including the reference to the Hugging Face DLC for TGI setting the <code>MODEL_ID</code> to <a href="https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct" rel="nofollow"><code>meta-llama/Meta-Llama-3.1-8B-Instruct</code></a>.</p></li> <li><p><code>service.yaml</code>: contains the service details of the pod, exposing the port 80 for the TGI service.</p></li> <li><p>(optional) <code>ingress.yaml</code>: contains the ingress details of the pod, exposing the service to the external world so that it can be accessed via the ingress IP.</p></li>',Yt,Je,qt,Ue,sn='<img src="./imgs/gke-deployment.png" alt="GKE Deployment in the GCP Console"/>',St,Z,Oe,an=`[!NOTE]
The Kubernetes deployment may take a few minutes to be ready, so you can check the status of the deployment with the following command:`,Il,je,$l,et,on="Alternatively, you can just wait for the deployment to be ready with the following command:",Gl,Ce,Dt,ve,zt,Ie,rn="To run the inference over the deployed TGI service, you can either:",Pt,E,$e,tt,cn="Port-forwarding the deployed TGI service to the port 8080, so as to access via <code>localhost</code> with the command:",Nl,Ge,kl,Ne,lt,un="Accessing the TGI service via the external IP of the ingress, which is the default scenario here since you have defined the ingress configuration in the <code>config/ingress.yaml</code> file (but it can be skipped in favour of the port-forwarding), that can be retrieved with the following command:",Zl,ke,Kt,Ze,Ot,_e,pn="To send a POST request to the TGI service using <code>cURL</code>, you can run the following command:",el,xe,tl,We,hn="Or send a POST request to the ingress IP instead:",ll,Ee,nl,Ve,dn="Which produces the following output:",sl,Qe,al,V,nt,mn=`[!NOTE]
To generate the <code>inputs</code> with the expected chat template formatting, you could use the following snippet:`,_l,Be,ol,Le,il,Re,fn='To run the inference using Python, you can use the <code>openai</code> Python SDK (see the installation notes at <a href="https://platform.openai.com/docs/quickstart" rel="nofollow">https://platform.openai.com/docs/quickstart</a>), setting either the localhost or the ingress IP as the <code>base_url</code> for the client, and then running the following code:',rl,Ae,cl,Xe,Mn="Which produces the following output:",ul,He,pl,Fe,hl,Ye,yn="Finally, once you are done using TGI on the GKE Cluster, you can safely delete the GKE Cluster to avoid incurring in unnecessary costs.",dl,qe,ml,Se,gn="Alternatively, you can also downscale the replicas of the deployed pod to 0 in case you want to preserve the cluster, since the default GKE Cluster deployed with GKE Autopilot mode is running just a single <code>e2-small</code> instance.",fl,De,Ml,ze,yl,at,gl;return m=new W({props:{title:"Deploy Meta Llama 3 8B with Text Generation Inference (TGI) on GKE",local:"deploy-meta-llama-3-8b-with-text-generation-inference-tgi-on-gke",headingTag:"h1"}}),j=new W({props:{title:"Setup / Configuration",local:"setup--configuration",headingTag:"h2"}}),A=new $({props:{code:"ZXhwb3J0JTIwUFJPSkVDVF9JRCUzRHlvdXItcHJvamVjdC1pZCUwQWV4cG9ydCUyMExPQ0FUSU9OJTNEeW91ci1sb2NhdGlvbiUwQWV4cG9ydCUyMENMVVNURVJfTkFNRSUzRHlvdXItY2x1c3Rlci1uYW1l",highlighted:`<span class="hljs-built_in">export</span> PROJECT_ID=your-project-id
<span class="hljs-built_in">export</span> LOCATION=your-location
<span class="hljs-built_in">export</span> CLUSTER_NAME=your-cluster-name`,wrap:!1}}),H=new $({props:{code:"Z2Nsb3VkJTIwYXV0aCUyMGxvZ2luJTBBZ2Nsb3VkJTIwYXV0aCUyMGFwcGxpY2F0aW9uLWRlZmF1bHQlMjBsb2dpbiUyMCUyMCUyMyUyMEZvciUyMGxvY2FsJTIwZGV2ZWxvcG1lbnQlMEFnY2xvdWQlMjBjb25maWclMjBzZXQlMjBwcm9qZWN0JTIwJTI0UFJPSkVDVF9JRA==",highlighted:`gcloud auth login
gcloud auth application-default login <span class="hljs-comment"># For local development</span>
gcloud config <span class="hljs-built_in">set</span> project <span class="hljs-variable">$PROJECT_ID</span>`,wrap:!1}}),Y=new $({props:{code:"Z2Nsb3VkJTIwc2VydmljZXMlMjBlbmFibGUlMjBjb250YWluZXIuZ29vZ2xlYXBpcy5jb20lMEFnY2xvdWQlMjBzZXJ2aWNlcyUyMGVuYWJsZSUyMGNvbnRhaW5lcnJlZ2lzdHJ5Lmdvb2dsZWFwaXMuY29tJTBBZ2Nsb3VkJTIwc2VydmljZXMlMjBlbmFibGUlMjBjb250YWluZXJmaWxlc3lzdGVtLmdvb2dsZWFwaXMuY29t",highlighted:`gcloud services <span class="hljs-built_in">enable</span> container.googleapis.com
gcloud services <span class="hljs-built_in">enable</span> containerregistry.googleapis.com
gcloud services <span class="hljs-built_in">enable</span> containerfilesystem.googleapis.com`,wrap:!1}}),S=new $({props:{code:"Z2Nsb3VkJTIwY29tcG9uZW50cyUyMGluc3RhbGwlMjBna2UtZ2Nsb3VkLWF1dGgtcGx1Z2lu",highlighted:"gcloud components install gke-gcloud-auth-plugin",wrap:!1}}),z=new W({props:{title:"Create GKE Cluster",local:"create-gke-cluster",headingTag:"h2"}}),ee=new $({props:{code:"Z2Nsb3VkJTIwY29udGFpbmVyJTIwY2x1c3RlcnMlMjBjcmVhdGUtYXV0byUyMCUyNENMVVNURVJfTkFNRSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJvamVjdCUzRCUyNFBST0pFQ1RfSUQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWxvY2F0aW9uJTNEJTI0TE9DQVRJT04lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXJlbGVhc2UtY2hhbm5lbCUzRHN0YWJsZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tY2x1c3Rlci12ZXJzaW9uJTNEMS4yOA==",highlighted:`gcloud container clusters create-auto <span class="hljs-variable">$CLUSTER_NAME</span> \\
--project=<span class="hljs-variable">$PROJECT_ID</span> \\
--location=<span class="hljs-variable">$LOCATION</span> \\
--release-channel=stable \\
--cluster-version=1.28`,wrap:!1}}),te=new $({props:{code:"Z2Nsb3VkJTIwY29udGFpbmVyJTIwZ2V0LXNlcnZlci1jb25maWclMjAlNUMlMEElMjAlMjAlMjAlMjAtLWZsYXR0ZW4lM0QlMjJjaGFubmVscyUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZmlsdGVyJTNEJTIyY2hhbm5lbHMuY2hhbm5lbCUzRFNUQUJMRSUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZm9ybWF0JTNEJTIyeWFtbChjaGFubmVscy5jaGFubmVsJTJDY2hhbm5lbHMuZGVmYXVsdFZlcnNpb24pJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1sb2NhdGlvbiUzRCUyNExPQ0FUSU9O",highlighted:`gcloud container get-server-config \\
--flatten=<span class="hljs-string">&quot;channels&quot;</span> \\
--filter=<span class="hljs-string">&quot;channels.channel=STABLE&quot;</span> \\
--format=<span class="hljs-string">&quot;yaml(channels.channel,channels.defaultVersion)&quot;</span> \\
--location=<span class="hljs-variable">$LOCATION</span>`,wrap:!1}}),se=new $({props:{code:"Z2Nsb3VkJTIwY29udGFpbmVyJTIwY2x1c3RlcnMlMjBnZXQtY3JlZGVudGlhbHMlMjAlMjRDTFVTVEVSX05BTUUlMjAtLWxvY2F0aW9uJTNEJTI0TE9DQVRJT04=",highlighted:'gcloud container clusters get-credentials <span class="hljs-variable">$CLUSTER_NAME</span> --location=<span class="hljs-variable">$LOCATION</span>',wrap:!1}}),ae=new W({props:{title:"Optional: Set Secrets in GKE",local:"optional-set-secrets-in-gke",headingTag:"h2"}}),re=new $({props:{code:"cGlwJTIwaW5zdGFsbCUyMC0tdXBncmFkZSUyMC0tcXVpZXQlMjBodWdnaW5nZmFjZV9odWI=",highlighted:"pip install --upgrade --quiet huggingface_hub",wrap:!1}}),ue=new $({props:{code:"aHVnZ2luZ2ZhY2UtY2xpJTIwbG9naW4=",highlighted:"huggingface-cli login",wrap:!1}}),he=new $({props:{code:"a3ViZWN0bCUyMGNyZWF0ZSUyMHNlY3JldCUyMGdlbmVyaWMlMjBoZi1zZWNyZXQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWZyb20tbGl0ZXJhbCUzRGhmX3Rva2VuJTNEJTI0KHB5dGhvbiUyMC1jJTIwJTIyZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGdldF90b2tlbiUzQiUyMHByaW50KGdldF90b2tlbigpKSUyMiklMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRyeS1ydW4lM0RjbGllbnQlMjAtbyUyMHlhbWwlMjAlN0MlMjBrdWJlY3RsJTIwYXBwbHklMjAtZiUyMC0=",highlighted:`kubectl create secret generic hf-secret \\
--from-literal=hf_token=$(python -c <span class="hljs-string">&quot;from huggingface_hub import get_token; print(get_token())&quot;</span>) \\
--dry-run=client -o yaml | kubectl apply -f -`,wrap:!1}}),me=new $({props:{code:"a3ViZWN0bCUyMGNyZWF0ZSUyMHNlY3JldCUyMGdlbmVyaWMlMjBoZi1zZWNyZXQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWZyb20tbGl0ZXJhbCUzRGhmX3Rva2VuJTNEaGZfKioqJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kcnktcnVuJTNEY2xpZW50JTIwLW8lMjB5YW1sJTIwJTdDJTIwa3ViZWN0bCUyMGFwcGx5JTIwLWYlMjAt",highlighted:`kubectl create secret generic hf-secret \\
--from-literal=hf_token=hf_*** \\
--dry-run=client -o yaml | kubectl apply -f -`,wrap:!1}}),ye=new W({props:{title:"Deploy TGI",local:"deploy-tgi",headingTag:"h2"}}),Je=new $({props:{code:"a3ViZWN0bCUyMGFwcGx5JTIwLWYlMjBjb25maWclMkY=",highlighted:"kubectl apply -f config/",wrap:!1}}),je=new $({props:{code:"a3ViZWN0bCUyMGdldCUyMHBvZHM=",highlighted:"kubectl get pods",wrap:!1}}),Ce=new $({props:{code:"a3ViZWN0bCUyMHdhaXQlMjAtLWZvciUzRGNvbmRpdGlvbiUzREF2YWlsYWJsZSUyMC0tdGltZW91dCUzRDcwMHMlMjBkZXBsb3ltZW50JTJGdGVpLWRlcGxveW1lbnQ=",highlighted:'kubectl <span class="hljs-built_in">wait</span> --<span class="hljs-keyword">for</span>=condition=Available --<span class="hljs-built_in">timeout</span>=700s deployment/tei-deployment',wrap:!1}}),ve=new W({props:{title:"Inference with TGI",local:"inference-with-tgi",headingTag:"h2"}}),Ge=new $({props:{code:"a3ViZWN0bCUyMHBvcnQtZm9yd2FyZCUyMHNlcnZpY2UlMkZ0Z2ktc2VydmljZSUyMDgwODAlM0E4MDgw",highlighted:"kubectl port-forward service/tgi-service 8080:8080",wrap:!1}}),ke=new $({props:{code:"a3ViZWN0bCUyMGdldCUyMGluZ3Jlc3MlMjB0Z2ktaW5ncmVzcyUyMC1vJTIwanNvbnBhdGglM0QnJTdCLnN0YXR1cy5sb2FkQmFsYW5jZXIuaW5ncmVzcyU1QjAlNUQuaXAlN0Qn",highlighted:'kubectl get ingress tgi-ingress -o jsonpath=<span class="hljs-string">&#x27;{.status.loadBalancer.ingress[0].ip}&#x27;</span>',wrap:!1}}),Ze=new W({props:{title:"Via cURL",local:"via-curl",headingTag:"h3"}}),xe=new $({props:{code:"Y3VybCUyMGh0dHAlM0ElMkYlMkZsb2NhbGhvc3QlM0E4MDgwJTJGZ2VuZXJhdGUlMjAlNUMlMEElMjAlMjAlMjAlMjAtWCUyMFBPU1QlMjAlNUMlMEElMjAlMjAlMjAlMjAtZCUyMCclN0IlMjJpbnB1dHMlMjIlM0ElMjIlM0MlN0NiZWdpbl9vZl90ZXh0JTdDJTNFJTNDJTdDc3RhcnRfaGVhZGVyX2lkJTdDJTNFc3lzdGVtJTNDJTdDZW5kX2hlYWRlcl9pZCU3QyUzRSU1Q24lNUNuWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTNDJTdDZW90X2lkJTdDJTNFJTNDJTdDc3RhcnRfaGVhZGVyX2lkJTdDJTNFdXNlciUzQyU3Q2VuZF9oZWFkZXJfaWQlN0MlM0UlNUNuJTVDbldoYXQlMjBpcyUyMDIlMkIyJTNGJTNDJTdDZW90X2lkJTdDJTNFJTNDJTdDc3RhcnRfaGVhZGVyX2lkJTdDJTNFYXNzaXN0YW50JTNDJTdDZW5kX2hlYWRlcl9pZCU3QyUzRSU1Q24lNUNuJTIyJTJDJTIycGFyYW1ldGVycyUyMiUzQSU3QiUyMnRlbXBlcmF0dXJlJTIyJTNBMC43JTJDJTIwJTIydG9wX3AlMjIlM0ElMjAwLjk1JTJDJTIwJTIybWF4X25ld190b2tlbnMlMjIlM0ElMjAxMjglN0QlN0QnJTIwJTVDJTBBJTIwJTIwJTIwJTIwLUglMjAnQ29udGVudC1UeXBlJTNBJTIwYXBwbGljYXRpb24lMkZqc29uJw==",highlighted:`curl http://localhost:8080/generate \\
-X POST \\
-d <span class="hljs-string">&#x27;{&quot;inputs&quot;:&quot;&lt;|begin_of_text|&gt;&lt;|start_header_id|&gt;system&lt;|end_header_id|&gt;\\n\\nYou are a helpful assistant.&lt;|eot_id|&gt;&lt;|start_header_id|&gt;user&lt;|end_header_id|&gt;\\n\\nWhat is 2+2?&lt;|eot_id|&gt;&lt;|start_header_id|&gt;assistant&lt;|end_header_id|&gt;\\n\\n&quot;,&quot;parameters&quot;:{&quot;temperature&quot;:0.7, &quot;top_p&quot;: 0.95, &quot;max_new_tokens&quot;: 128}}&#x27;</span> \\
-H <span class="hljs-string">&#x27;Content-Type: application/json&#x27;</span>`,wrap:!1}}),Ee=new $({props:{code:"Y3VybCUyMGh0dHAlM0ElMkYlMkYlMjQoa3ViZWN0bCUyMGdldCUyMGluZ3Jlc3MlMjB0Z2ktaW5ncmVzcyUyMC1vJTIwanNvbnBhdGglM0QnJTdCLnN0YXR1cy5sb2FkQmFsYW5jZXIuaW5ncmVzcyU1QjAlNUQuaXAlN0QnKSUyRmdlbmVyYXRlJTIwJTVDJTBBJTIwJTIwJTIwJTIwLVglMjBQT1NUJTIwJTVDJTBBJTIwJTIwJTIwJTIwLWQlMjAnJTdCJTIyaW5wdXRzJTIyJTNBJTIyJTNDJTdDYmVnaW5fb2ZfdGV4dCU3QyUzRSUzQyU3Q3N0YXJ0X2hlYWRlcl9pZCU3QyUzRXN5c3RlbSUzQyU3Q2VuZF9oZWFkZXJfaWQlN0MlM0UlNUNuJTVDbllvdSUyMGFyZSUyMGElMjBoZWxwZnVsJTIwYXNzaXN0YW50LiUzQyU3Q2VvdF9pZCU3QyUzRSUzQyU3Q3N0YXJ0X2hlYWRlcl9pZCU3QyUzRXVzZXIlM0MlN0NlbmRfaGVhZGVyX2lkJTdDJTNFJTVDbiU1Q25XaGF0JTIwaXMlMjAyJTJCMiUzRiUzQyU3Q2VvdF9pZCU3QyUzRSUzQyU3Q3N0YXJ0X2hlYWRlcl9pZCU3QyUzRWFzc2lzdGFudCUzQyU3Q2VuZF9oZWFkZXJfaWQlN0MlM0UlNUNuJTVDbiUyMiUyQyUyMnBhcmFtZXRlcnMlMjIlM0ElN0IlMjJ0ZW1wZXJhdHVyZSUyMiUzQTAuNyUyQyUyMCUyMnRvcF9wJTIyJTNBJTIwMC45NSUyQyUyMCUyMm1heF9uZXdfdG9rZW5zJTIyJTNBJTIwMTI4JTdEJTdEJyUyMCU1QyUwQSUyMCUyMCUyMCUyMC1IJTIwJ0NvbnRlbnQtVHlwZSUzQSUyMGFwcGxpY2F0aW9uJTJGanNvbic=",highlighted:`curl http://$(kubectl get ingress tgi-ingress -o jsonpath=<span class="hljs-string">&#x27;{.status.loadBalancer.ingress[0].ip}&#x27;</span>)/generate \\
-X POST \\
-d <span class="hljs-string">&#x27;{&quot;inputs&quot;:&quot;&lt;|begin_of_text|&gt;&lt;|start_header_id|&gt;system&lt;|end_header_id|&gt;\\n\\nYou are a helpful assistant.&lt;|eot_id|&gt;&lt;|start_header_id|&gt;user&lt;|end_header_id|&gt;\\n\\nWhat is 2+2?&lt;|eot_id|&gt;&lt;|start_header_id|&gt;assistant&lt;|end_header_id|&gt;\\n\\n&quot;,&quot;parameters&quot;:{&quot;temperature&quot;:0.7, &quot;top_p&quot;: 0.95, &quot;max_new_tokens&quot;: 128}}&#x27;</span> \\
-H <span class="hljs-string">&#x27;Content-Type: application/json&#x27;</span>`,wrap:!1}}),Qe=new $({props:{code:"JTdCJTIyZ2VuZXJhdGVkX3RleHQlMjIlM0ElMjJUaGUlMjBhbnN3ZXIlMjB0byUyMDIlMkIyJTIwaXMlMjA0LiUyMiU3RA==",highlighted:'<span class="hljs-punctuation">{</span><span class="hljs-attr">&quot;generated_text&quot;</span><span class="hljs-punctuation">:</span><span class="hljs-string">&quot;The answer to 2+2 is 4.&quot;</span><span class="hljs-punctuation">}</span>',wrap:!1}}),Be=new $({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJtZXRhLWxsYW1hJTJGTWV0YS1MbGFtYS0zLThCLUluc3RydWN0JTIyKSUwQXRva2VuaXplci5hcHBseV9jaGF0X3RlbXBsYXRlKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJzeXN0ZW0lMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyWW91JTIwYXJlJTIwYSUyMGhlbHBmdWwlMjBhc3Npc3RhbnQuJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyV2hhdCUyMGlzJTIwMiUyQjIlM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZSUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwYWRkX2dlbmVyYXRpb25fcHJvbXB0JTNEVHJ1ZSUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;meta-llama/Meta-Llama-3-8B-Instruct&quot;</span>)
tokenizer.apply_chat_template(
[
{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;You are a helpful assistant.&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;What is 2+2?&quot;</span>},
],
tokenize=<span class="hljs-literal">False</span>,
add_generation_prompt=<span class="hljs-literal">True</span>,
)`,wrap:!1}}),Le=new W({props:{title:"Via Python",local:"via-python",headingTag:"h3"}}),Ae=new $({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGdldF90b2tlbiUwQWZyb20lMjBvcGVuYWklMjBpbXBvcnQlMjBPcGVuQUklMEElMEFjbGllbnQlMjAlM0QlMjBPcGVuQUkoJTBBJTIwJTIwJTIwJTIwYmFzZV91cmwlM0QlMjJodHRwJTNBJTJGJTJGbG9jYWxob3N0JTNBODA4MCUyRnYxJTJGJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRGdldF90b2tlbigpJTIwb3IlMjAlMjItJTIyJTJDJTBBKSUwQSUwQWNoYXRfY29tcGxldGlvbiUyMCUzRCUyMGNsaWVudC5jaGF0LmNvbXBsZXRpb25zLmNyZWF0ZSglMEElMjAlMjAlMjAlMjBtb2RlbCUzRCUyMnRnaSUyMiUyQyUwQSUyMCUyMCUyMCUyMG1lc3NhZ2VzJTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnN5c3RlbSUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJZb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJXaGF0JTIwaXMlMjAyJTJCMiUzRiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMG1heF90b2tlbnMlM0QxMjglMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> get_token
<span class="hljs-keyword">from</span> openai <span class="hljs-keyword">import</span> OpenAI
client = OpenAI(
base_url=<span class="hljs-string">&quot;http://localhost:8080/v1/&quot;</span>,
api_key=get_token() <span class="hljs-keyword">or</span> <span class="hljs-string">&quot;-&quot;</span>,
)
chat_completion = client.chat.completions.create(
model=<span class="hljs-string">&quot;tgi&quot;</span>,
messages=[
{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;You are a helpful assistant.&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;What is 2+2?&quot;</span>},
],
max_tokens=<span class="hljs-number">128</span>,
)`,wrap:!1}}),He=new $({props:{code:"Q2hhdENvbXBsZXRpb24oaWQlM0QnJyUyQyUyMGNob2ljZXMlM0QlNUJDaG9pY2UoZmluaXNoX3JlYXNvbiUzRCdlb3NfdG9rZW4nJTJDJTIwaW5kZXglM0QwJTJDJTIwbG9ncHJvYnMlM0ROb25lJTJDJTIwbWVzc2FnZSUzRENoYXRDb21wbGV0aW9uTWVzc2FnZShjb250ZW50JTNEJ1RoZSUyMGFuc3dlciUyMHRvJTIwMiUyQjIlMjBpcyUyMDQhJyUyQyUyMHJvbGUlM0QnYXNzaXN0YW50JyUyQyUyMGZ1bmN0aW9uX2NhbGwlM0ROb25lJTJDJTIwdG9vbF9jYWxscyUzRE5vbmUpKSU1RCUyQyUyMGNyZWF0ZWQlM0QxNzE4MTA4NTIyJTJDJTIwbW9kZWwlM0QnbWV0YS1sbGFtYSUyRk1ldGEtTGxhbWEtMy04Qi1JbnN0cnVjdCclMkMlMjBvYmplY3QlM0QndGV4dF9jb21wbGV0aW9uJyUyQyUyMHN5c3RlbV9maW5nZXJwcmludCUzRCcyLjAuMi1zaGEtNjA3M2VjZSclMkMlMjB1c2FnZSUzRENvbXBsZXRpb25Vc2FnZShjb21wbGV0aW9uX3Rva2VucyUzRDEyJTJDJTIwcHJvbXB0X3Rva2VucyUzRDI4JTJDJTIwdG90YWxfdG9rZW5zJTNENDApKQ==",highlighted:'<span class="hljs-constructor">ChatCompletion(<span class="hljs-params">id</span>=&#x27;&#x27;, <span class="hljs-params">choices</span>=[Choice(<span class="hljs-params">finish_reason</span>=&#x27;<span class="hljs-params">eos_token</span>&#x27;, <span class="hljs-params">index</span>=0, <span class="hljs-params">logprobs</span>=None, <span class="hljs-params">message</span>=ChatCompletionMessage(<span class="hljs-params">content</span>=&#x27;The <span class="hljs-params">answer</span> <span class="hljs-params">to</span> 2+2 <span class="hljs-params">is</span> 4!&#x27;, <span class="hljs-params">role</span>=&#x27;<span class="hljs-params">assistant</span>&#x27;, <span class="hljs-params">function_call</span>=None, <span class="hljs-params">tool_calls</span>=None)</span>)], created=<span class="hljs-number">1718108522</span>, model=&#x27;meta-llama/Meta-Llama-<span class="hljs-number">3</span>-<span class="hljs-number">8</span>B-Instruct&#x27;, <span class="hljs-keyword">object</span>=&#x27;text_completion&#x27;, system_fingerprint=&#x27;<span class="hljs-number">2.0</span>.<span class="hljs-number">2</span>-sha-<span class="hljs-number">6073</span>ece&#x27;, usage=<span class="hljs-constructor">CompletionUsage(<span class="hljs-params">completion_tokens</span>=12, <span class="hljs-params">prompt_tokens</span>=28, <span class="hljs-params">total_tokens</span>=40)</span>)',wrap:!1}}),Fe=new W({props:{title:"Delete GKE Cluster",local:"delete-gke-cluster",headingTag:"h2"}}),qe=new $({props:{code:"Z2Nsb3VkJTIwY29udGFpbmVyJTIwY2x1c3RlcnMlMjBkZWxldGUlMjAlMjRDTFVTVEVSX05BTUUlMjAtLWxvY2F0aW9uJTNEJTI0TE9DQVRJT04=",highlighted:'gcloud container clusters delete <span class="hljs-variable">$CLUSTER_NAME</span> --location=<span class="hljs-variable">$LOCATION</span>',wrap:!1}}),De=new $({props:{code:"a3ViZWN0bCUyMHNjYWxlJTIwLS1yZXBsaWNhcyUzRDAlMjBkZXBsb3ltZW50JTJGdGdpLWRlcGxveW1lbnQ=",highlighted:"kubectl scale --replicas=0 deployment/tgi-deployment",wrap:!1}}),ze=new Gn({props:{source:"https://github.com/huggingface/Google-Cloud-Containers/blob/main/docs/source/examples/gke-tgi-deployment.mdx"}}),{c(){s=i("meta"),c=a(),h=i("p"),d=a(),y(m.$$.fragment),u=a(),U=i("p"),U.textContent=N,I=a(),y(j.$$.fragment),f=a(),G=i("p"),G.innerHTML=x,B=a(),L=i("ul"),L.innerHTML=xl,pt=a(),R=i("p"),R.textContent=Wl,ht=a(),y(A.$$.fragment),dt=a(),X=i("p"),X.textContent=El,mt=a(),y(H.$$.fragment),ft=a(),F=i("p"),F.textContent=Vl,Mt=a(),y(Y.$$.fragment),yt=a(),q=i("p"),q.innerHTML=Ql,gt=a(),y(S.$$.fragment),Tt=a(),D=i("blockquote"),D.innerHTML=Bl,bt=a(),y(z.$$.fragment),wt=a(),P=i("p"),P.textContent=Ll,Jt=a(),K=i("p"),K.textContent=Rl,Ut=a(),O=i("blockquote"),O.innerHTML=Al,jt=a(),y(ee.$$.fragment),Ct=a(),_=i("blockquote"),Pe=i("p"),Pe.textContent=Xl,Cl=a(),y(te.$$.fragment),vl=a(),Ke=i("p"),Ke.innerHTML=Hl,vt=a(),le=i("p"),le.innerHTML=Fl,It=a(),ne=i("p"),ne.innerHTML=Yl,$t=a(),y(se.$$.fragment),Gt=a(),y(ae.$$.fragment),Nt=a(),oe=i("p"),oe.innerHTML=ql,kt=a(),ie=i("p"),ie.innerHTML=Sl,Zt=a(),y(re.$$.fragment),_t=a(),ce=i("p"),ce.textContent=Dl,xt=a(),y(ue.$$.fragment),Wt=a(),pe=i("p"),pe.innerHTML=zl,Et=a(),y(he.$$.fragment),Vt=a(),de=i("p"),de.textContent=Pl,Qt=a(),y(me.$$.fragment),Bt=a(),fe=i("p"),fe.innerHTML=Kl,Lt=a(),Me=i("p"),Me.innerHTML=Ol,Rt=a(),y(ye.$$.fragment),At=a(),ge=i("p"),ge.innerHTML=en,Xt=a(),Te=i("blockquote"),Te.innerHTML=tn,Ht=a(),be=i("p"),be.innerHTML=ln,Ft=a(),we=i("ul"),we.innerHTML=nn,Yt=a(),y(Je.$$.fragment),qt=a(),Ue=i("p"),Ue.innerHTML=sn,St=a(),Z=i("blockquote"),Oe=i("p"),Oe.textContent=an,Il=a(),y(je.$$.fragment),$l=a(),et=i("p"),et.textContent=on,Gl=a(),y(Ce.$$.fragment),Dt=a(),y(ve.$$.fragment),zt=a(),Ie=i("p"),Ie.textContent=rn,Pt=a(),E=i("ul"),$e=i("li"),tt=i("p"),tt.innerHTML=cn,Nl=a(),y(Ge.$$.fragment),kl=a(),Ne=i("li"),lt=i("p"),lt.innerHTML=un,Zl=a(),y(ke.$$.fragment),Kt=a(),y(Ze.$$.fragment),Ot=a(),_e=i("p"),_e.innerHTML=pn,el=a(),y(xe.$$.fragment),tl=a(),We=i("p"),We.textContent=hn,ll=a(),y(Ee.$$.fragment),nl=a(),Ve=i("p"),Ve.textContent=dn,sl=a(),y(Qe.$$.fragment),al=a(),V=i("blockquote"),nt=i("p"),nt.innerHTML=mn,_l=a(),y(Be.$$.fragment),ol=a(),y(Le.$$.fragment),il=a(),Re=i("p"),Re.innerHTML=fn,rl=a(),y(Ae.$$.fragment),cl=a(),Xe=i("p"),Xe.textContent=Mn,ul=a(),y(He.$$.fragment),pl=a(),y(Fe.$$.fragment),hl=a(),Ye=i("p"),Ye.textContent=yn,dl=a(),y(qe.$$.fragment),ml=a(),Se=i("p"),Se.innerHTML=gn,fl=a(),y(De.$$.fragment),Ml=a(),y(ze.$$.fragment),yl=a(),at=i("p"),this.h()},l(e){const t=$n("svelte-u9bgzb",document.head);s=r(t,"META",{name:!0,content:!0}),t.forEach(l),c=o(e),h=r(e,"P",{}),k(h).forEach(l),d=o(e),g(m.$$.fragment,e),u=o(e),U=r(e,"P",{"data-svelte-h":!0}),M(U)!=="svelte-nlj3kr"&&(U.textContent=N),I=o(e),g(j.$$.fragment,e),f=o(e),G=r(e,"P",{"data-svelte-h":!0}),M(G)!=="svelte-1qnmo38"&&(G.innerHTML=x),B=o(e),L=r(e,"UL",{"data-svelte-h":!0}),M(L)!=="svelte-a8ymuw"&&(L.innerHTML=xl),pt=o(e),R=r(e,"P",{"data-svelte-h":!0}),M(R)!=="svelte-1i8n6rq"&&(R.textContent=Wl),ht=o(e),g(A.$$.fragment,e),dt=o(e),X=r(e,"P",{"data-svelte-h":!0}),M(X)!=="svelte-1g39t6p"&&(X.textContent=El),mt=o(e),g(H.$$.fragment,e),ft=o(e),F=r(e,"P",{"data-svelte-h":!0}),M(F)!=="svelte-1c0v0sp"&&(F.textContent=Vl),Mt=o(e),g(Y.$$.fragment,e),yt=o(e),q=r(e,"P",{"data-svelte-h":!0}),M(q)!=="svelte-wjaltb"&&(q.innerHTML=Ql),gt=o(e),g(S.$$.fragment,e),Tt=o(e),D=r(e,"BLOCKQUOTE",{"data-svelte-h":!0}),M(D)!=="svelte-1pnyjy4"&&(D.innerHTML=Bl),bt=o(e),g(z.$$.fragment,e),wt=o(e),P=r(e,"P",{"data-svelte-h":!0}),M(P)!=="svelte-lja57p"&&(P.textContent=Ll),Jt=o(e),K=r(e,"P",{"data-svelte-h":!0}),M(K)!=="svelte-l7bdz6"&&(K.textContent=Rl),Ut=o(e),O=r(e,"BLOCKQUOTE",{"data-svelte-h":!0}),M(O)!=="svelte-s50359"&&(O.innerHTML=Al),jt=o(e),g(ee.$$.fragment,e),Ct=o(e),_=r(e,"BLOCKQUOTE",{});var st=k(_);Pe=r(st,"P",{"data-svelte-h":!0}),M(Pe)!=="svelte-1clrfws"&&(Pe.textContent=Xl),Cl=o(st),g(te.$$.fragment,st),vl=o(st),Ke=r(st,"P",{"data-svelte-h":!0}),M(Ke)!=="svelte-1y4gd42"&&(Ke.innerHTML=Hl),st.forEach(l),vt=o(e),le=r(e,"P",{"data-svelte-h":!0}),M(le)!=="svelte-xcqxov"&&(le.innerHTML=Fl),It=o(e),ne=r(e,"P",{"data-svelte-h":!0}),M(ne)!=="svelte-f29e6h"&&(ne.innerHTML=Yl),$t=o(e),g(se.$$.fragment,e),Gt=o(e),g(ae.$$.fragment,e),Nt=o(e),oe=r(e,"P",{"data-svelte-h":!0}),M(oe)!=="svelte-ghu0vo"&&(oe.innerHTML=ql),kt=o(e),ie=r(e,"P",{"data-svelte-h":!0}),M(ie)!=="svelte-zags7d"&&(ie.innerHTML=Sl),Zt=o(e),g(re.$$.fragment,e),_t=o(e),ce=r(e,"P",{"data-svelte-h":!0}),M(ce)!=="svelte-4hmhsl"&&(ce.textContent=Dl),xt=o(e),g(ue.$$.fragment,e),Wt=o(e),pe=r(e,"P",{"data-svelte-h":!0}),M(pe)!=="svelte-cqv9s0"&&(pe.innerHTML=zl),Et=o(e),g(he.$$.fragment,e),Vt=o(e),de=r(e,"P",{"data-svelte-h":!0}),M(de)!=="svelte-o99xdc"&&(de.textContent=Pl),Qt=o(e),g(me.$$.fragment,e),Bt=o(e),fe=r(e,"P",{"data-svelte-h":!0}),M(fe)!=="svelte-1oo8lui"&&(fe.innerHTML=Kl),Lt=o(e),Me=r(e,"P",{"data-svelte-h":!0}),M(Me)!=="svelte-1dqrub5"&&(Me.innerHTML=Ol),Rt=o(e),g(ye.$$.fragment,e),At=o(e),ge=r(e,"P",{"data-svelte-h":!0}),M(ge)!=="svelte-kglcl8"&&(ge.innerHTML=en),Xt=o(e),Te=r(e,"BLOCKQUOTE",{"data-svelte-h":!0}),M(Te)!=="svelte-6r1mwk"&&(Te.innerHTML=tn),Ht=o(e),be=r(e,"P",{"data-svelte-h":!0}),M(be)!=="svelte-1a7ij1s"&&(be.innerHTML=ln),Ft=o(e),we=r(e,"UL",{"data-svelte-h":!0}),M(we)!=="svelte-1qj2dty"&&(we.innerHTML=nn),Yt=o(e),g(Je.$$.fragment,e),qt=o(e),Ue=r(e,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-18eqeo1"&&(Ue.innerHTML=sn),St=o(e),Z=r(e,"BLOCKQUOTE",{});var Q=k(Z);Oe=r(Q,"P",{"data-svelte-h":!0}),M(Oe)!=="svelte-15z5c64"&&(Oe.textContent=an),Il=o(Q),g(je.$$.fragment,Q),$l=o(Q),et=r(Q,"P",{"data-svelte-h":!0}),M(et)!=="svelte-16v3quh"&&(et.textContent=on),Gl=o(Q),g(Ce.$$.fragment,Q),Q.forEach(l),Dt=o(e),g(ve.$$.fragment,e),zt=o(e),Ie=r(e,"P",{"data-svelte-h":!0}),M(Ie)!=="svelte-1wzt8py"&&(Ie.textContent=rn),Pt=o(e),E=r(e,"UL",{});var Tl=k(E);$e=r(Tl,"LI",{});var bl=k($e);tt=r(bl,"P",{"data-svelte-h":!0}),M(tt)!=="svelte-k3movz"&&(tt.innerHTML=cn),Nl=o(bl),g(Ge.$$.fragment,bl),bl.forEach(l),kl=o(Tl),Ne=r(Tl,"LI",{});var wl=k(Ne);lt=r(wl,"P",{"data-svelte-h":!0}),M(lt)!=="svelte-1uskw9x"&&(lt.innerHTML=un),Zl=o(wl),g(ke.$$.fragment,wl),wl.forEach(l),Tl.forEach(l),Kt=o(e),g(Ze.$$.fragment,e),Ot=o(e),_e=r(e,"P",{"data-svelte-h":!0}),M(_e)!=="svelte-1ks8djk"&&(_e.innerHTML=pn),el=o(e),g(xe.$$.fragment,e),tl=o(e),We=r(e,"P",{"data-svelte-h":!0}),M(We)!=="svelte-1u6gmmt"&&(We.textContent=hn),ll=o(e),g(Ee.$$.fragment,e),nl=o(e),Ve=r(e,"P",{"data-svelte-h":!0}),M(Ve)!=="svelte-ddr8r5"&&(Ve.textContent=dn),sl=o(e),g(Qe.$$.fragment,e),al=o(e),V=r(e,"BLOCKQUOTE",{});var Jl=k(V);nt=r(Jl,"P",{"data-svelte-h":!0}),M(nt)!=="svelte-j7zhva"&&(nt.innerHTML=mn),_l=o(Jl),g(Be.$$.fragment,Jl),Jl.forEach(l),ol=o(e),g(Le.$$.fragment,e),il=o(e),Re=r(e,"P",{"data-svelte-h":!0}),M(Re)!=="svelte-w0229l"&&(Re.innerHTML=fn),rl=o(e),g(Ae.$$.fragment,e),cl=o(e),Xe=r(e,"P",{"data-svelte-h":!0}),M(Xe)!=="svelte-ddr8r5"&&(Xe.textContent=Mn),ul=o(e),g(He.$$.fragment,e),pl=o(e),g(Fe.$$.fragment,e),hl=o(e),Ye=r(e,"P",{"data-svelte-h":!0}),M(Ye)!=="svelte-1laf0m8"&&(Ye.textContent=yn),dl=o(e),g(qe.$$.fragment,e),ml=o(e),Se=r(e,"P",{"data-svelte-h":!0}),M(Se)!=="svelte-qo8r7n"&&(Se.innerHTML=gn),fl=o(e),g(De.$$.fragment,e),Ml=o(e),g(ze.$$.fragment,e),yl=o(e),at=r(e,"P",{}),k(at).forEach(l),this.h()},h(){C(s,"name","hf:doc:metadata"),C(s,"content",Xn)},m(e,t){v(document.head,s),n(e,c,t),n(e,h,t),n(e,d,t),T(m,e,t),n(e,u,t),n(e,U,t),n(e,I,t),T(j,e,t),n(e,f,t),n(e,G,t),n(e,B,t),n(e,L,t),n(e,pt,t),n(e,R,t),n(e,ht,t),T(A,e,t),n(e,dt,t),n(e,X,t),n(e,mt,t),T(H,e,t),n(e,ft,t),n(e,F,t),n(e,Mt,t),T(Y,e,t),n(e,yt,t),n(e,q,t),n(e,gt,t),T(S,e,t),n(e,Tt,t),n(e,D,t),n(e,bt,t),T(z,e,t),n(e,wt,t),n(e,P,t),n(e,Jt,t),n(e,K,t),n(e,Ut,t),n(e,O,t),n(e,jt,t),T(ee,e,t),n(e,Ct,t),n(e,_,t),v(_,Pe),v(_,Cl),T(te,_,null),v(_,vl),v(_,Ke),n(e,vt,t),n(e,le,t),n(e,It,t),n(e,ne,t),n(e,$t,t),T(se,e,t),n(e,Gt,t),T(ae,e,t),n(e,Nt,t),n(e,oe,t),n(e,kt,t),n(e,ie,t),n(e,Zt,t),T(re,e,t),n(e,_t,t),n(e,ce,t),n(e,xt,t),T(ue,e,t),n(e,Wt,t),n(e,pe,t),n(e,Et,t),T(he,e,t),n(e,Vt,t),n(e,de,t),n(e,Qt,t),T(me,e,t),n(e,Bt,t),n(e,fe,t),n(e,Lt,t),n(e,Me,t),n(e,Rt,t),T(ye,e,t),n(e,At,t),n(e,ge,t),n(e,Xt,t),n(e,Te,t),n(e,Ht,t),n(e,be,t),n(e,Ft,t),n(e,we,t),n(e,Yt,t),T(Je,e,t),n(e,qt,t),n(e,Ue,t),n(e,St,t),n(e,Z,t),v(Z,Oe),v(Z,Il),T(je,Z,null),v(Z,$l),v(Z,et),v(Z,Gl),T(Ce,Z,null),n(e,Dt,t),T(ve,e,t),n(e,zt,t),n(e,Ie,t),n(e,Pt,t),n(e,E,t),v(E,$e),v($e,tt),v($e,Nl),T(Ge,$e,null),v(E,kl),v(E,Ne),v(Ne,lt),v(Ne,Zl),T(ke,Ne,null),n(e,Kt,t),T(Ze,e,t),n(e,Ot,t),n(e,_e,t),n(e,el,t),T(xe,e,t),n(e,tl,t),n(e,We,t),n(e,ll,t),T(Ee,e,t),n(e,nl,t),n(e,Ve,t),n(e,sl,t),T(Qe,e,t),n(e,al,t),n(e,V,t),v(V,nt),v(V,_l),T(Be,V,null),n(e,ol,t),T(Le,e,t),n(e,il,t),n(e,Re,t),n(e,rl,t),T(Ae,e,t),n(e,cl,t),n(e,Xe,t),n(e,ul,t),T(He,e,t),n(e,pl,t),T(Fe,e,t),n(e,hl,t),n(e,Ye,t),n(e,dl,t),T(qe,e,t),n(e,ml,t),n(e,Se,t),n(e,fl,t),T(De,e,t),n(e,Ml,t),T(ze,e,t),n(e,yl,t),n(e,at,t),gl=!0},p:it,i(e){gl||(b(m.$$.fragment,e),b(j.$$.fragment,e),b(A.$$.fragment,e),b(H.$$.fragment,e),b(Y.$$.fragment,e),b(S.$$.fragment,e),b(z.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(se.$$.fragment,e),b(ae.$$.fragment,e),b(re.$$.fragment,e),b(ue.$$.fragment,e),b(he.$$.fragment,e),b(me.$$.fragment,e),b(ye.$$.fragment,e),b(Je.$$.fragment,e),b(je.$$.fragment,e),b(Ce.$$.fragment,e),b(ve.$$.fragment,e),b(Ge.$$.fragment,e),b(ke.$$.fragment,e),b(Ze.$$.fragment,e),b(xe.$$.fragment,e),b(Ee.$$.fragment,e),b(Qe.$$.fragment,e),b(Be.$$.fragment,e),b(Le.$$.fragment,e),b(Ae.$$.fragment,e),b(He.$$.fragment,e),b(Fe.$$.fragment,e),b(qe.$$.fragment,e),b(De.$$.fragment,e),b(ze.$$.fragment,e),gl=!0)},o(e){w(m.$$.fragment,e),w(j.$$.fragment,e),w(A.$$.fragment,e),w(H.$$.fragment,e),w(Y.$$.fragment,e),w(S.$$.fragment,e),w(z.$$.fragment,e),w(ee.$$.fragment,e),w(te.$$.fragment,e),w(se.$$.fragment,e),w(ae.$$.fragment,e),w(re.$$.fragment,e),w(ue.$$.fragment,e),w(he.$$.fragment,e),w(me.$$.fragment,e),w(ye.$$.fragment,e),w(Je.$$.fragment,e),w(je.$$.fragment,e),w(Ce.$$.fragment,e),w(ve.$$.fragment,e),w(Ge.$$.fragment,e),w(ke.$$.fragment,e),w(Ze.$$.fragment,e),w(xe.$$.fragment,e),w(Ee.$$.fragment,e),w(Qe.$$.fragment,e),w(Be.$$.fragment,e),w(Le.$$.fragment,e),w(Ae.$$.fragment,e),w(He.$$.fragment,e),w(Fe.$$.fragment,e),w(qe.$$.fragment,e),w(De.$$.fragment,e),w(ze.$$.fragment,e),gl=!1},d(e){e&&(l(c),l(h),l(d),l(u),l(U),l(I),l(f),l(G),l(B),l(L),l(pt),l(R),l(ht),l(dt),l(X),l(mt),l(ft),l(F),l(Mt),l(yt),l(q),l(gt),l(Tt),l(D),l(bt),l(wt),l(P),l(Jt),l(K),l(Ut),l(O),l(jt),l(Ct),l(_),l(vt),l(le),l(It),l(ne),l($t),l(Gt),l(Nt),l(oe),l(kt),l(ie),l(Zt),l(_t),l(ce),l(xt),l(Wt),l(pe),l(Et),l(Vt),l(de),l(Qt),l(Bt),l(fe),l(Lt),l(Me),l(Rt),l(At),l(ge),l(Xt),l(Te),l(Ht),l(be),l(Ft),l(we),l(Yt),l(qt),l(Ue),l(St),l(Z),l(Dt),l(zt),l(Ie),l(Pt),l(E),l(Kt),l(Ot),l(_e),l(el),l(tl),l(We),l(ll),l(nl),l(Ve),l(sl),l(al),l(V),l(ol),l(il),l(Re),l(rl),l(cl),l(Xe),l(ul),l(pl),l(hl),l(Ye),l(dl),l(ml),l(Se),l(fl),l(Ml),l(yl),l(at)),l(s),J(m,e),J(j,e),J(A,e),J(H,e),J(Y,e),J(S,e),J(z,e),J(ee,e),J(te),J(se,e),J(ae,e),J(re,e),J(ue,e),J(he,e),J(me,e),J(ye,e),J(Je,e),J(je),J(Ce),J(ve,e),J(Ge),J(ke),J(Ze,e),J(xe,e),J(Ee,e),J(Qe,e),J(Be),J(Le,e),J(Ae,e),J(He,e),J(Fe,e),J(qe,e),J(De,e),J(ze,e)}}}const Xn='{"title":"Deploy Meta Llama 3 8B with Text Generation Inference (TGI) on GKE","local":"deploy-meta-llama-3-8b-with-text-generation-inference-tgi-on-gke","sections":[{"title":"Setup / Configuration","local":"setup--configuration","sections":[],"depth":2},{"title":"Create GKE Cluster","local":"create-gke-cluster","sections":[],"depth":2},{"title":"Optional: Set Secrets in GKE","local":"optional-set-secrets-in-gke","sections":[],"depth":2},{"title":"Deploy TGI","local":"deploy-tgi","sections":[],"depth":2},{"title":"Inference with TGI","local":"inference-with-tgi","sections":[{"title":"Via cURL","local":"via-curl","sections":[],"depth":3},{"title":"Via Python","local":"via-python","sections":[],"depth":3}],"depth":2},{"title":"Delete GKE Cluster","local":"delete-gke-cluster","sections":[],"depth":2}],"depth":1}';function Hn(p){return Jn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Sn extends ct{constructor(s){super(),ut(this,s,Hn,An,rt,{})}}export{Sn as component};

Xet Storage Details

Size:
44.4 kB
·
Xet hash:
34429a1e6299b249041851915bff30fe9c090e2e2e02f5160589018e01bff371

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.