import{s as hs,o as fs,n as A}from"../chunks/scheduler.6efaaf90.js";import{S as Ms,i as ds,e as i,s as n,c as r,h as gs,a as p,d as l,b as a,f as nt,g as u,j as d,k as ms,l as Q,m as s,n as m,t as h,o as f,p as M}from"../chunks/index.eb3e1f0f.js";import{T as F}from"../chunks/Tip.292c2c3d.js";import{C as ys,H as N,E as $s}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4cfb23c9.js";import{C as U}from"../chunks/CodeBlock.8c036e47.js";function bs(w){let o,C='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>.';return{c(){o=i("p"),o.innerHTML=C},l(c){o=p(c,"P",{"data-svelte-h":!0}),d(o)!=="svelte-sm1xw4"&&(o.innerHTML=C)},m(c,g){s(c,o,g)},p:A,d(c){c&&l(o)}}}function Cs(w){let o,C='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.';return{c(){o=i("p"),o.innerHTML=C},l(c){o=p(c,"P",{"data-svelte-h":!0}),d(o)!=="svelte-1cdm5nv"&&(o.innerHTML=C)},m(c,g){s(c,o,g)},p:A,d(c){c&&l(o)}}}function Us(w){let o,C="To select the specific version in your location of the GKE Cluster, you can run the following command:",c,g,T,y,J='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>.',G;return g=new U({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}}),{c(){o=i("p"),o.textContent=C,c=n(),r(g.$$.fragment),T=n(),y=i("p"),y.innerHTML=J},l($){o=p($,"P",{"data-svelte-h":!0}),d(o)!=="svelte-a3yff9"&&(o.textContent=C),c=a($),u(g.$$.fragment,$),T=a($),y=p($,"P",{"data-svelte-h":!0}),d(y)!=="svelte-1y4gd42"&&(y.innerHTML=J)},m($,v){s($,o,v),s($,c,v),m(g,$,v),s($,T,v),s($,y,v),G=!0},p:A,i($){G||(h(g.$$.fragment,$),G=!0)},o($){f(g.$$.fragment,$),G=!1},d($){$&&(l(o),l(c),l(T),l(y)),M(g,$)}}}function Ts(w){let o,C="Make sure to set the proper permissions to run the script i.e. <code>chmod +x scripts/upload_model_to_gcs.sh</code>.";return{c(){o=i("p"),o.innerHTML=C},l(c){o=p(c,"P",{"data-svelte-h":!0}),d(o)!=="svelte-1wjj60h"&&(o.innerHTML=C)},m(c,g){s(c,o,g)},p:A,d(c){c&&l(o)}}}function ws(w){let o,C='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>.';return{c(){o=i("p"),o.innerHTML=C},l(c){o=p(c,"P",{"data-svelte-h":!0}),d(o)!=="svelte-1yok7mw"&&(o.innerHTML=C)},m(c,g){s(c,o,g)},p:A,d(c){c&&l(o)}}}function Js(w){let o,C="The Kubernetes deployment may take a few minutes to be ready, so you can check the status of the deployment with the following command:",c,g,T,y,J="Alternatively, you can just wait for the deployment to be ready with the following command:",G,$,v;return g=new U({props:{code:"a3ViZWN0bCUyMGdldCUyMHBvZHMlMjAtLW5hbWVzcGFjZSUyMCUyNE5BTUVTUEFDRQ==",highlighted:'kubectl get pods --namespace <span class="hljs-variable">$NAMESPACE</span>',wrap:!1}}),$=new U({props:{code:"a3ViZWN0bCUyMHdhaXQlMjAtLWZvciUzRGNvbmRpdGlvbiUzREF2YWlsYWJsZSUyMC0tdGltZW91dCUzRDcwMHMlMjAtLW5hbWVzcGFjZSUyMCUyNE5BTUVTUEFDRSUyMGRlcGxveW1lbnQlMkZ0Z2ktZGVwbG95bWVudA==",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 --namespace <span class="hljs-variable">$NAMESPACE</span> deployment/tgi-deployment',wrap:!1}}),{c(){o=i("p"),o.textContent=C,c=n(),r(g.$$.fragment),T=n(),y=i("p"),y.textContent=J,G=n(),r($.$$.fragment)},l(b){o=p(b,"P",{"data-svelte-h":!0}),d(o)!=="svelte-qgh43p"&&(o.textContent=C),c=a(b),u(g.$$.fragment,b),T=a(b),y=p(b,"P",{"data-svelte-h":!0}),d(y)!=="svelte-16v3quh"&&(y.textContent=J),G=a(b),u($.$$.fragment,b)},m(b,j){s(b,o,j),s(b,c,j),m(g,b,j),s(b,T,j),s(b,y,j),s(b,G,j),m($,b,j),v=!0},p:A,i(b){v||(h(g.$$.fragment,b),h($.$$.fragment,b),v=!0)},o(b){f(g.$$.fragment,b),f($.$$.fragment,b),v=!1},d(b){b&&(l(o),l(c),l(T),l(y),l(G)),M(g,b),M($,b)}}}function js(w){let o,C="To generate the <code>inputs</code> with the expected chat template formatting, you could use the following snippet:",c,g,T;return g=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJRd2VuJTJGUXdlbjItN0ItSW5zdHJ1Y3QlMjIpJTBBdG9rZW5pemVyLmFwcGx5X2NoYXRfdGVtcGxhdGUoJTBBJTIwJTIwJTIwJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnN5c3RlbSUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJZb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJXaGF0JTIwaXMlMjAyJTJCMiUzRiUyMiU3RCUyQyUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBhZGRfZ2VuZXJhdGlvbl9wcm9tcHQlM0RUcnVlJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;Qwen/Qwen2-7B-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}}),{c(){o=i("p"),o.innerHTML=C,c=n(),r(g.$$.fragment)},l(y){o=p(y,"P",{"data-svelte-h":!0}),d(o)!=="svelte-mve1xj"&&(o.innerHTML=C),c=a(y),u(g.$$.fragment,y)},m(y,J){s(y,o,J),s(y,c,J),m(g,y,J),T=!0},p:A,i(y){T||(h(g.$$.fragment,y),T=!0)},o(y){f(g.$$.fragment,y),T=!1},d(y){y&&(l(o),l(c)),M(g,y)}}}function Gs(w){let o,C='📍 Find the complete example on GitHub <a href="https://github.com/huggingface/Google-Cloud-Containers/tree/main/examples/gke/tgi-from-gcs-deployment" rel="nofollow">here</a>!';return{c(){o=i("p"),o.innerHTML=C},l(c){o=p(c,"P",{"data-svelte-h":!0}),d(o)!=="svelte-14jmklj"&&(o.innerHTML=C)},m(c,g){s(c,o,g)},p:A,d(c){c&&l(o)}}}function vs(w){let o,C,c,g,T,y,J,G,$,v="Qwen2 is the new series of Qwen Large Language Models (LLMs) built by Alibaba Cloud, with both base and instruction-tuned language models ranging from 0.5 to 72 billion parameters, including a Mixture-of-Experts model; the 7B variant sitting in the second place in the 7B size range in the Open LLM Leaderboard by Hugging Face and the 72B one in the first place amongst any size. 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.",b,j,Gl="This example showcases how to deploy an LLM from a Google Cloud Storage (GCS) Bucket 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.",at,S,ot,B,vl="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.",it,L,Nl='<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,H,Il="Optionally, to ease the usage of the commands within this tutorial, you need to set the following environment variables for GCP:",ct,Y,rt,z,kl="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.",ut,X,mt,q,xl="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.",ht,P,ft,D,Zl="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:",Mt,O,dt,I,gt,K,yt,ee,Vl="Once everything is 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.",$t,te,El="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.",bt,k,Ct,le,Ut,x,Tt,se,Rl='<img src="https://raw.githubusercontent.com/huggingface/Google-Cloud-Containers/main/examples/gke/tgi-from-gcs-deployment/imgs/gke-cluster.png" alt="GKE Cluster in the GCP Console"/>',wt,ne,_l="Once the GKE Cluster is created, you can get the credentials to access it via <code>kubectl</code> with the following command:",Jt,ae,jt,oe,Gt,ie,Wl="This is an optional step in the tutorial, since you may want to reuse an existing model on a GCS Bucket, if that is the case, then feel free to jump to the next step of the tutorial on how to configure the IAM for GCS so that you can access the bucket from a pod in the GKE Cluster.",vt,pe,Ql='Otherwise, to upload a model from the Hugging Face Hub to a GCS Bucket, you can use the script <a href="https://github.com/huggingface/Google-Cloud-Containers/blob/main/scripts/upload_model_to_gcs.sh" rel="nofollow">scripts/upload_model_to_gcs.sh</a>, which will download the model from the Hugging Face Hub and upload it to the GCS Bucket (and create the bucket if not created already).',Nt,ce,Fl="The <code>gsutil</code> component should be installed via <code>gcloud</code>, and the Python packages <code>huggingface_hub</code> with the extra <code>hf_transfer</code>, and the package <code>crcmod</code> should also be installed.",It,re,kt,ue,Al="Then, you can run the script to download the model from the Hugging Face Hub and then upload it to the GCS Bucket:",xt,Z,Zt,me,Vt,he,Sl='<img src="https://raw.githubusercontent.com/huggingface/Google-Cloud-Containers/main/examples/gke/tgi-from-gcs-deployment/imgs/gcs-bucket.png" alt="GCS Bucket in the GCP Console"/>',Et,fe,Rt,Me,Bl="Before you proceed with the deployment of the Hugging Face DLC for TGI on the GKE Cluster, you need to set the IAM permissions for the GCS Bucket so that the pod in the GKE Cluster can access the bucket. To do so, you need to create a namespace and a service account in the GKE Cluster, and then set the IAM permissions for the GCS Bucket that contains the model, either as uploaded from the Hugging Face Hub or as already existing in the GCS Bucket.",_t,de,Ll="For convenience, as the reference to both the namespace and the service account will be used within the following steps, the environment variables <code>NAMESPACE</code> and <code>SERVICE_ACCOUNT</code> will be set.",Wt,ge,Qt,ye,Hl="Then you can create the namespace and the service account in the GKE Cluster, enabling the creation of the IAM permissions for the pods in that namespace to access the GCS Bucket when using that service account.",Ft,$e,At,be,Yl="Then you need to add the IAM policy binding to the bucket as follows:",St,Ce,Bt,Ue,Lt,Te,zl='Now you can proceed to the Kubernetes deployment of the Hugging Face DLC for TGI, serving the <a href="https://huggingface.co/Qwen/Qwen2-7B-Instruct" rel="nofollow"><code>Qwen/Qwen2-7B-Instruct</code></a> model, from a volume mounted in <code>/data</code>, copied from the GCS Bucket where the model is located.',Ht,V,Yt,we,Xl='The Hugging Face DLC for TGI will be deployed via <code>kubectl</code>, from the configuration files in the <a href="https://github.com/huggingface/Google-Cloud-Containers/tree/main/examples/gke/tgi-from-gcs-deployment/config/" rel="nofollow"><code>config/</code></a> directory:',zt,Je,ql='<li><a href="https://github.com/huggingface/Google-Cloud-Containers/tree/main/examples/gke/tgi-from-gcs-deployment/config/deployment.yaml" rel="nofollow"><code>deployment.yaml</code></a>: contains the deployment details of the pod including the reference to the Hugging Face DLC for TGI setting the <code>MODEL_ID</code> to the model path in the volume mount, in this case <code>/data/Qwen2-7B-Instruct</code>.</li> <li><a href="https://github.com/huggingface/Google-Cloud-Containers/tree/main/examples/gke/tgi-from-gcs-deployment/config/service.yaml" rel="nofollow"><code>service.yaml</code></a>: contains the service details of the pod, exposing the port 8080 for the TGI service.</li> <li><a href="https://github.com/huggingface/Google-Cloud-Containers/tree/main/examples/gke/tgi-from-gcs-deployment/config/storageclass.yaml" rel="nofollow"><code>storageclass.yaml</code></a>: contains the storage class details of the pod, defining the storage class for the volume mount.</li> <li>(optional) <a href="https://github.com/huggingface/Google-Cloud-Containers/tree/main/examples/gke/tgi-from-gcs-deployment/config/ingress.yaml" rel="nofollow"><code>ingress.yaml</code></a>: contains the ingress details of the pod, exposing the service to the external world so that it can be accessed via the ingress IP.</li>',Xt,je,qt,Ge,Pl='<img src="https://raw.githubusercontent.com/huggingface/Google-Cloud-Containers/main/examples/gke/tgi-from-gcs-deployment/imgs/gke-deployment.png" alt="GKE Deployment in the GCP Console"/>',Pt,E,Dt,ve,Ot,Ne,Dl="To run the inference over the deployed TGI service, you can either:",Kt,R,Ie,tt,Ol="Port-forwarding the deployed TGI service to the port 8080, so as to access via <code>localhost</code> with the command:",wl,ke,Jl,xe,lt,Kl="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:",jl,Ze,el,Ve,tl,Ee,es="To send a POST request to the TGI service using <code>cURL</code>, you can run the following command:",ll,Re,sl,_e,ts="Or send a POST request to the ingress IP instead:",nl,We,al,Qe,ls="Which produces the following output:",ol,Fe,il,_,pl,Ae,cl,Se,ss='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,Be,ul,Le,ns="Which produces the following output:",ml,He,hl,Ye,fl,ze,as="Finally, once you are done using TGI on the GKE Cluster, you can safely delete the GKE Cluster to avoid incurring in unnecessary costs.",Ml,Xe,dl,qe,os="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.",gl,Pe,yl,$l,bl,W,Cl,De,Ul,st,Tl;return T=new ys({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),J=new N({props:{title:"Deploy Qwen2 7B with TGI DLC from GCS on GKE",local:"deploy-qwen2-7b-with-tgi-dlc-from-gcs-on-gke",headingTag:"h1"}}),S=new N({props:{title:"Setup / Configuration",local:"setup--configuration",headingTag:"h2"}}),Y=new U({props:{code:"ZXhwb3J0JTIwUFJPSkVDVF9JRCUzRHlvdXItcHJvamVjdC1pZCUwQWV4cG9ydCUyMExPQ0FUSU9OJTNEeW91ci1sb2NhdGlvbiUwQWV4cG9ydCUyMENMVVNURVJfTkFNRSUzRHlvdXItY2x1c3Rlci1uYW1lJTBBZXhwb3J0JTIwQlVDS0VUX05BTUUlM0R5b3VyLWJ1Y2tldC1uYW1l",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
<span class="hljs-built_in">export</span> BUCKET_NAME=your-bucket-name`,wrap:!1}}),X=new U({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}}),P=new U({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}}),O=new U({props:{code:"Z2Nsb3VkJTIwY29tcG9uZW50cyUyMGluc3RhbGwlMjBna2UtZ2Nsb3VkLWF1dGgtcGx1Z2lu",highlighted:"gcloud components install gke-gcloud-auth-plugin",wrap:!1}}),I=new F({props:{$$slots:{default:[bs]},$$scope:{ctx:w}}}),K=new N({props:{title:"Create GKE Cluster",local:"create-gke-cluster",headingTag:"h2"}}),k=new F({props:{$$slots:{default:[Cs]},$$scope:{ctx:w}}}),le=new U({props:{code:"Z2Nsb3VkJTIwY29udGFpbmVyJTIwY2x1c3RlcnMlMjBjcmVhdGUtYXV0byUyMCUyNENMVVNURVJfTkFNRSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcHJvamVjdCUzRCUyNFBST0pFQ1RfSUQlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWxvY2F0aW9uJTNEJTI0TE9DQVRJT04lMjAlNUMlMEElMjAlMjAlMjAlMjAtLXJlbGVhc2UtY2hhbm5lbCUzRHN0YWJsZSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tY2x1c3Rlci12ZXJzaW9uJTNEMS4yOCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbm8tYXV0b3Byb3Zpc2lvbmluZy1lbmFibGUtaW5zZWN1cmUta3ViZWxldC1yZWFkb25seS1wb3J0",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 \\
    --no-autoprovisioning-enable-insecure-kubelet-readonly-port`,wrap:!1}}),x=new F({props:{$$slots:{default:[Us]},$$scope:{ctx:w}}}),ae=new U({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}}),oe=new N({props:{title:"Optional: Upload a model from the Hugging Face Hub to GCS",local:"optional-upload-a-model-from-the-hugging-face-hub-to-gcs",headingTag:"h2"}}),re=new U({props:{code:"Z2Nsb3VkJTIwY29tcG9uZW50cyUyMGluc3RhbGwlMjBnc3V0aWwlMEFwaXAlMjBpbnN0YWxsJTIwLS11cGdyYWRlJTIwLS1xdWlldCUyMCUyMmh1Z2dpbmdmYWNlX2h1YiU1QmhmX3RyYW5zZmVyJTVEJTIyJTIwY3JjbW9k",highlighted:`gcloud components install gsutil
pip install --upgrade --quiet <span class="hljs-string">&quot;huggingface_hub[hf_transfer]&quot;</span> crcmod`,wrap:!1}}),Z=new F({props:{$$slots:{default:[Ts]},$$scope:{ctx:w}}}),me=new U({props:{code:"LiUyRnNjcmlwdHMlMkZ1cGxvYWRfbW9kZWxfdG9fZ2NzLnNoJTIwLS1tb2RlbC1pZCUyMFF3ZW4lMkZRd2VuMi03Qi1JbnN0cnVjdCUyMC0tZ2NzJTIwZ3MlM0ElMkYlMkYlMjRCVUNLRVRfTkFNRSUyRlF3ZW4yLTdCLUluc3RydWN0",highlighted:'./scripts/upload_model_to_gcs.sh --model-id Qwen/Qwen2-7B-Instruct --gcs gs://<span class="hljs-variable">$BUCKET_NAME</span>/Qwen2-7B-Instruct',wrap:!1}}),fe=new N({props:{title:"Configure IAM for GCS",local:"configure-iam-for-gcs",headingTag:"h2"}}),ge=new U({props:{code:"ZXhwb3J0JTIwTkFNRVNQQUNFJTNEaGYtZ2tlLW5hbWVzcGFjZSUwQWV4cG9ydCUyMFNFUlZJQ0VfQUNDT1VOVCUzRGhmLWdrZS1zZXJ2aWNlLWFjY291bnQ=",highlighted:`<span class="hljs-built_in">export</span> NAMESPACE=hf-gke-namespace
<span class="hljs-built_in">export</span> SERVICE_ACCOUNT=hf-gke-service-account`,wrap:!1}}),$e=new U({props:{code:"a3ViZWN0bCUyMGNyZWF0ZSUyMG5hbWVzcGFjZSUyMCUyNE5BTUVTUEFDRSUwQWt1YmVjdGwlMjBjcmVhdGUlMjBzZXJ2aWNlYWNjb3VudCUyMCUyNFNFUlZJQ0VfQUNDT1VOVCUyMC0tbmFtZXNwYWNlJTIwJTI0TkFNRVNQQUNF",highlighted:`kubectl create namespace <span class="hljs-variable">$NAMESPACE</span>
kubectl create serviceaccount <span class="hljs-variable">$SERVICE_ACCOUNT</span> --namespace <span class="hljs-variable">$NAMESPACE</span>`,wrap:!1}}),Ce=new U({props:{code:"Z2Nsb3VkJTIwc3RvcmFnZSUyMGJ1Y2tldHMlMjBhZGQtaWFtLXBvbGljeS1iaW5kaW5nJTIwJTVDJTBBJTIwJTIwJTIwJTIwZ3MlM0ElMkYlMkYlMjRCVUNLRVRfTkFNRSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWVtYmVyJTIwJTIycHJpbmNpcGFsJTNBJTJGJTJGaWFtLmdvb2dsZWFwaXMuY29tJTJGcHJvamVjdHMlMkYlMjQoZ2Nsb3VkJTIwcHJvamVjdHMlMjBkZXNjcmliZSUyMCUyNFBST0pFQ1RfSUQlMjAtLWZvcm1hdCUzRCUyMnZhbHVlKHByb2plY3ROdW1iZXIpJTIyKSUyRmxvY2F0aW9ucyUyRmdsb2JhbCUyRndvcmtsb2FkSWRlbnRpdHlQb29scyUyRiUyNFBST0pFQ1RfSUQuc3ZjLmlkLmdvb2clMkZzdWJqZWN0JTJGbnMlMkYlMjROQU1FU1BBQ0UlMkZzYSUyRiUyNFNFUlZJQ0VfQUNDT1VOVCUyMiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcm9sZSUyMCUyMnJvbGVzJTJGc3RvcmFnZS5vYmplY3RVc2VyJTIy",highlighted:`gcloud storage buckets add-iam-policy-binding \\
    gs://<span class="hljs-variable">$BUCKET_NAME</span> \\
    --member <span class="hljs-string">&quot;principal://iam.googleapis.com/projects/<span class="hljs-subst">$(gcloud projects describe $PROJECT_ID --format=<span class="hljs-string">&quot;value(projectNumber)&quot;</span>)</span>/locations/global/workloadIdentityPools/<span class="hljs-variable">$PROJECT_ID</span>.svc.id.goog/subject/ns/<span class="hljs-variable">$NAMESPACE</span>/sa/<span class="hljs-variable">$SERVICE_ACCOUNT</span>&quot;</span> \\
    --role <span class="hljs-string">&quot;roles/storage.objectUser&quot;</span>`,wrap:!1}}),Ue=new N({props:{title:"Deploy TGI",local:"deploy-tgi",headingTag:"h2"}}),V=new F({props:{$$slots:{default:[ws]},$$scope:{ctx:w}}}),je=new U({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRkdvb2dsZS1DbG91ZC1Db250YWluZXJzJTBBa3ViZWN0bCUyMGFwcGx5JTIwLWYlMjBHb29nbGUtQ2xvdWQtQ29udGFpbmVycyUyRmV4YW1wbGVzJTJGZ2tlJTJGdGdpLWZyb20tZ2NzLWRlcGxveW1lbnQlMkZjb25maWc=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/Google-Cloud-Containers
kubectl apply -f Google-Cloud-Containers/examples/gke/tgi-from-gcs-deployment/config`,wrap:!1}}),E=new F({props:{$$slots:{default:[Js]},$$scope:{ctx:w}}}),ve=new N({props:{title:"Inference with TGI",local:"inference-with-tgi",headingTag:"h2"}}),ke=new U({props:{code:"a3ViZWN0bCUyMHBvcnQtZm9yd2FyZCUyMC0tbmFtZXNwYWNlJTIwJTI0TkFNRVNQQUNFJTIwc2VydmljZSUyRnRnaS1zZXJ2aWNlJTIwODA4MCUzQTgwODA=",highlighted:'kubectl port-forward --namespace <span class="hljs-variable">$NAMESPACE</span> service/tgi-service 8080:8080',wrap:!1}}),Ze=new U({props:{code:"a3ViZWN0bCUyMGdldCUyMGluZ3Jlc3MlMjAtLW5hbWVzcGFjZSUyMCUyNE5BTUVTUEFDRSUyMHRnaS1pbmdyZXNzJTIwLW8lMjBqc29ucGF0aCUzRCclN0Iuc3RhdHVzLmxvYWRCYWxhbmNlci5pbmdyZXNzJTVCMCU1RC5pcCU3RCc=",highlighted:'kubectl get ingress --namespace <span class="hljs-variable">$NAMESPACE</span> tgi-ingress -o jsonpath=<span class="hljs-string">&#x27;{.status.loadBalancer.ingress[0].ip}&#x27;</span>',wrap:!1}}),Ve=new N({props:{title:"Via cURL",local:"via-curl",headingTag:"h3"}}),Re=new U({props:{code:"Y3VybCUyMGh0dHAlM0ElMkYlMkZsb2NhbGhvc3QlM0E4MDgwJTJGZ2VuZXJhdGUlMjAlNUMlMEElMjAlMjAlMjAlMjAtWCUyMFBPU1QlMjAlNUMlMEElMjAlMjAlMjAlMjAtZCUyMCclN0IlMjJpbnB1dHMlMjIlM0ElMjIlM0MlN0NpbV9zdGFydCU3QyUzRXN5c3RlbSU1Q25Zb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lM0MlN0NpbV9lbmQlN0MlM0UlNUNuJTNDJTdDaW1fc3RhcnQlN0MlM0V1c2VyJTVDbldoYXQlMjBpcyUyMDIlMkIyJTNGJTNDJTdDaW1fZW5kJTdDJTNFJTVDbiUzQyU3Q2ltX3N0YXJ0JTdDJTNFYXNzaXN0YW50JTVDbiUyMiUyQyUyMnBhcmFtZXRlcnMlMjIlM0ElN0IlMjJ0ZW1wZXJhdHVyZSUyMiUzQTAuNyUyQyUyMCUyMnRvcF9wJTIyJTNBJTIwMC45NSUyQyUyMCUyMm1heF9uZXdfdG9rZW5zJTIyJTNBJTIwMTI4JTdEJTdEJyUyMCU1QyUwQSUyMCUyMCUyMCUyMC1IJTIwJ0NvbnRlbnQtVHlwZSUzQSUyMGFwcGxpY2F0aW9uJTJGanNvbic=",highlighted:`curl http://localhost:8080/generate \\
    -X POST \\
    -d <span class="hljs-string">&#x27;{&quot;inputs&quot;:&quot;&lt;|im_start|&gt;system\\nYou are a helpful assistant.&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\nWhat is 2+2?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\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}}),We=new U({props:{code:"Y3VybCUyMGh0dHAlM0ElMkYlMkYlMjQoa3ViZWN0bCUyMGdldCUyMGluZ3Jlc3MlMjAtLW5hbWVzcGFjZSUyMCUyNE5BTUVTUEFDRSUyMHRnaS1pbmdyZXNzJTIwLW8lMjBqc29ucGF0aCUzRCclN0Iuc3RhdHVzLmxvYWRCYWxhbmNlci5pbmdyZXNzJTVCMCU1RC5pcCU3RCcpJTJGZ2VuZXJhdGUlMjAlNUMlMEElMjAlMjAlMjAlMjAtWCUyMFBPU1QlMjAlNUMlMEElMjAlMjAlMjAlMjAtZCUyMCclN0IlMjJpbnB1dHMlMjIlM0ElMjIlM0MlN0NpbV9zdGFydCU3QyUzRXN5c3RlbSU1Q25Zb3UlMjBhcmUlMjBhJTIwaGVscGZ1bCUyMGFzc2lzdGFudC4lM0MlN0NpbV9lbmQlN0MlM0UlNUNuJTNDJTdDaW1fc3RhcnQlN0MlM0V1c2VyJTVDbldoYXQlMjBpcyUyMDIlMkIyJTNGJTNDJTdDaW1fZW5kJTdDJTNFJTVDbiUzQyU3Q2ltX3N0YXJ0JTdDJTNFYXNzaXN0YW50JTVDbiUyMiUyQyUyMnBhcmFtZXRlcnMlMjIlM0ElN0IlMjJ0ZW1wZXJhdHVyZSUyMiUzQTAuNyUyQyUyMCUyMnRvcF9wJTIyJTNBJTIwMC45NSUyQyUyMCUyMm1heF9uZXdfdG9rZW5zJTIyJTNBJTIwMTI4JTdEJTdEJyUyMCU1QyUwQSUyMCUyMCUyMCUyMC1IJTIwJ0NvbnRlbnQtVHlwZSUzQSUyMGFwcGxpY2F0aW9uJTJGanNvbic=",highlighted:`curl http://$(kubectl get ingress --namespace <span class="hljs-variable">$NAMESPACE</span> 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;|im_start|&gt;system\\nYou are a helpful assistant.&lt;|im_end|&gt;\\n&lt;|im_start|&gt;user\\nWhat is 2+2?&lt;|im_end|&gt;\\n&lt;|im_start|&gt;assistant\\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}}),Fe=new U({props:{code:"JTdCJTIyZ2VuZXJhdGVkX3RleHQlMjIlM0ElMjIyJTIwJTJCJTIwMiUyMGVxdWFscyUyMDQuJTIyJTdE",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;2 + 2 equals 4.&quot;</span><span class="hljs-punctuation">}</span>',wrap:!1}}),_=new F({props:{$$slots:{default:[js]},$$scope:{ctx:w}}}),Ae=new N({props:{title:"Via Python",local:"via-python",headingTag:"h3"}}),Be=new U({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 U({props:{code:"Q2hhdENvbXBsZXRpb24oaWQlM0QnJyUyQyUyMGNob2ljZXMlM0QlNUJDaG9pY2UoZmluaXNoX3JlYXNvbiUzRCdlb3NfdG9rZW4nJTJDJTIwaW5kZXglM0QwJTJDJTIwbWVzc2FnZSUzRENoYXRDb21wbGV0aW9uTWVzc2FnZShjb250ZW50JTNEJzIlMjAlMkIlMjAyJTIwZXF1YWxzJTIwNC4nJTJDJTIwcm9sZSUzRCdhc3Npc3RhbnQnJTJDJTIwZnVuY3Rpb25fY2FsbCUzRE5vbmUlMkMlMjB0b29sX2NhbGxzJTNETm9uZSklMkMlMjBsb2dwcm9icyUzRE5vbmUpJTVEJTJDJTIwY3JlYXRlZCUzRDE3MTk5OTYzNTklMkMlMjBtb2RlbCUzRCclMkZkYXRhJTJGUXdlbjItN0ItSW5zdHJ1Y3QnJTJDJTIwb2JqZWN0JTNEJ2NoYXQuY29tcGxldGlvbiclMkMlMjBzeXN0ZW1fZmluZ2VycHJpbnQlM0QnMi4xLjAtbmF0aXZlJyUyQyUyMHVzYWdlJTNEQ29tcGxldGlvblVzYWdlKGNvbXBsZXRpb25fdG9rZW5zJTNEOSUyQyUyMHByb21wdF90b2tlbnMlM0QyNiUyQyUyMHRvdGFsX3Rva2VucyUzRDM1KSk=",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">message</span>=ChatCompletionMessage(<span class="hljs-params">content</span>=&#x27;2 + 2 <span class="hljs-params">equals</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>, logprobs=None)], created=<span class="hljs-number">1719996359</span>, model=&#x27;/data/Qwen2-<span class="hljs-number">7</span>B-Instruct&#x27;, <span class="hljs-keyword">object</span>=&#x27;chat.completion&#x27;, system_fingerprint=&#x27;<span class="hljs-number">2.1</span>.<span class="hljs-number">0</span>-native&#x27;, usage=<span class="hljs-constructor">CompletionUsage(<span class="hljs-params">completion_tokens</span>=9, <span class="hljs-params">prompt_tokens</span>=26, <span class="hljs-params">total_tokens</span>=35)</span>)',wrap:!1}}),Ye=new N({props:{title:"Delete GKE Cluster",local:"delete-gke-cluster",headingTag:"h2"}}),Xe=new U({props:{code:"Z2Nsb3VkJTIwY29udGFpbmVyJTIwY2x1c3RlcnMlMjBkZWxldGUlMjAlMjRDTFVTVEVSX05BTUUlMjAtLWxvY2F0aW9uJTNEJTI0TE9DQVRJT04=",highlighted:'gcloud container clusters delete <span class="hljs-variable">$CLUSTER_NAME</span> --location=<span class="hljs-variable">$LOCATION</span>',wrap:!1}}),Pe=new U({props:{code:"a3ViZWN0bCUyMHNjYWxlJTIwLS1yZXBsaWNhcyUzRDAlMjAtLW5hbWVzcGFjZSUyMCUyNE5BTUVTUEFDRSUyMGRlcGxveW1lbnQlMkZ0Z2ktZGVwbG95bWVudA==",highlighted:'kubectl scale --replicas=0 --namespace <span class="hljs-variable">$NAMESPACE</span> deployment/tgi-deployment',wrap:!1}}),W=new F({props:{$$slots:{default:[Gs]},$$scope:{ctx:w}}}),De=new $s({props:{source:"https://github.com/huggingface/Google-Cloud-Containers/blob/main/docs/source/examples/gke-tgi-from-gcs-deployment.mdx"}}),{c(){o=i("meta"),C=n(),c=i("p"),g=n(),r(T.$$.fragment),y=n(),r(J.$$.fragment),G=n(),$=i("p"),$.textContent=v,b=n(),j=i("p"),j.textContent=Gl,at=n(),r(S.$$.fragment),ot=n(),B=i("p"),B.innerHTML=vl,it=n(),L=i("ul"),L.innerHTML=Nl,pt=n(),H=i("p"),H.textContent=Il,ct=n(),r(Y.$$.fragment),rt=n(),z=i("p"),z.textContent=kl,ut=n(),r(X.$$.fragment),mt=n(),q=i("p"),q.textContent=xl,ht=n(),r(P.$$.fragment),ft=n(),D=i("p"),D.innerHTML=Zl,Mt=n(),r(O.$$.fragment),dt=n(),r(I.$$.fragment),gt=n(),r(K.$$.fragment),yt=n(),ee=i("p"),ee.textContent=Vl,$t=n(),te=i("p"),te.textContent=El,bt=n(),r(k.$$.fragment),Ct=n(),r(le.$$.fragment),Ut=n(),r(x.$$.fragment),Tt=n(),se=i("p"),se.innerHTML=Rl,wt=n(),ne=i("p"),ne.innerHTML=_l,Jt=n(),r(ae.$$.fragment),jt=n(),r(oe.$$.fragment),Gt=n(),ie=i("p"),ie.textContent=Wl,vt=n(),pe=i("p"),pe.innerHTML=Ql,Nt=n(),ce=i("p"),ce.innerHTML=Fl,It=n(),r(re.$$.fragment),kt=n(),ue=i("p"),ue.textContent=Al,xt=n(),r(Z.$$.fragment),Zt=n(),r(me.$$.fragment),Vt=n(),he=i("p"),he.innerHTML=Sl,Et=n(),r(fe.$$.fragment),Rt=n(),Me=i("p"),Me.textContent=Bl,_t=n(),de=i("p"),de.innerHTML=Ll,Wt=n(),r(ge.$$.fragment),Qt=n(),ye=i("p"),ye.textContent=Hl,Ft=n(),r($e.$$.fragment),At=n(),be=i("p"),be.textContent=Yl,St=n(),r(Ce.$$.fragment),Bt=n(),r(Ue.$$.fragment),Lt=n(),Te=i("p"),Te.innerHTML=zl,Ht=n(),r(V.$$.fragment),Yt=n(),we=i("p"),we.innerHTML=Xl,zt=n(),Je=i("ul"),Je.innerHTML=ql,Xt=n(),r(je.$$.fragment),qt=n(),Ge=i("p"),Ge.innerHTML=Pl,Pt=n(),r(E.$$.fragment),Dt=n(),r(ve.$$.fragment),Ot=n(),Ne=i("p"),Ne.textContent=Dl,Kt=n(),R=i("ul"),Ie=i("li"),tt=i("p"),tt.innerHTML=Ol,wl=n(),r(ke.$$.fragment),Jl=n(),xe=i("li"),lt=i("p"),lt.innerHTML=Kl,jl=n(),r(Ze.$$.fragment),el=n(),r(Ve.$$.fragment),tl=n(),Ee=i("p"),Ee.innerHTML=es,ll=n(),r(Re.$$.fragment),sl=n(),_e=i("p"),_e.textContent=ts,nl=n(),r(We.$$.fragment),al=n(),Qe=i("p"),Qe.textContent=ls,ol=n(),r(Fe.$$.fragment),il=n(),r(_.$$.fragment),pl=n(),r(Ae.$$.fragment),cl=n(),Se=i("p"),Se.innerHTML=ss,rl=n(),r(Be.$$.fragment),ul=n(),Le=i("p"),Le.textContent=ns,ml=n(),r(He.$$.fragment),hl=n(),r(Ye.$$.fragment),fl=n(),ze=i("p"),ze.textContent=as,Ml=n(),r(Xe.$$.fragment),dl=n(),qe=i("p"),qe.innerHTML=os,gl=n(),r(Pe.$$.fragment),yl=n(),$l=i("hr"),bl=n(),r(W.$$.fragment),Cl=n(),r(De.$$.fragment),Ul=n(),st=i("p"),this.h()},l(e){const t=gs("svelte-u9bgzb",document.head);o=p(t,"META",{name:!0,content:!0}),t.forEach(l),C=a(e),c=p(e,"P",{}),nt(c).forEach(l),g=a(e),u(T.$$.fragment,e),y=a(e),u(J.$$.fragment,e),G=a(e),$=p(e,"P",{"data-svelte-h":!0}),d($)!=="svelte-hix6p"&&($.textContent=v),b=a(e),j=p(e,"P",{"data-svelte-h":!0}),d(j)!=="svelte-2nq9zq"&&(j.textContent=Gl),at=a(e),u(S.$$.fragment,e),ot=a(e),B=p(e,"P",{"data-svelte-h":!0}),d(B)!=="svelte-1qnmo38"&&(B.innerHTML=vl),it=a(e),L=p(e,"UL",{"data-svelte-h":!0}),d(L)!=="svelte-a8ymuw"&&(L.innerHTML=Nl),pt=a(e),H=p(e,"P",{"data-svelte-h":!0}),d(H)!=="svelte-1i8n6rq"&&(H.textContent=Il),ct=a(e),u(Y.$$.fragment,e),rt=a(e),z=p(e,"P",{"data-svelte-h":!0}),d(z)!=="svelte-1g39t6p"&&(z.textContent=kl),ut=a(e),u(X.$$.fragment,e),mt=a(e),q=p(e,"P",{"data-svelte-h":!0}),d(q)!=="svelte-1c0v0sp"&&(q.textContent=xl),ht=a(e),u(P.$$.fragment,e),ft=a(e),D=p(e,"P",{"data-svelte-h":!0}),d(D)!=="svelte-wjaltb"&&(D.innerHTML=Zl),Mt=a(e),u(O.$$.fragment,e),dt=a(e),u(I.$$.fragment,e),gt=a(e),u(K.$$.fragment,e),yt=a(e),ee=p(e,"P",{"data-svelte-h":!0}),d(ee)!=="svelte-cdzit7"&&(ee.textContent=Vl),$t=a(e),te=p(e,"P",{"data-svelte-h":!0}),d(te)!=="svelte-l7bdz6"&&(te.textContent=El),bt=a(e),u(k.$$.fragment,e),Ct=a(e),u(le.$$.fragment,e),Ut=a(e),u(x.$$.fragment,e),Tt=a(e),se=p(e,"P",{"data-svelte-h":!0}),d(se)!=="svelte-11jpxhk"&&(se.innerHTML=Rl),wt=a(e),ne=p(e,"P",{"data-svelte-h":!0}),d(ne)!=="svelte-f29e6h"&&(ne.innerHTML=_l),Jt=a(e),u(ae.$$.fragment,e),jt=a(e),u(oe.$$.fragment,e),Gt=a(e),ie=p(e,"P",{"data-svelte-h":!0}),d(ie)!=="svelte-1yxvryk"&&(ie.textContent=Wl),vt=a(e),pe=p(e,"P",{"data-svelte-h":!0}),d(pe)!=="svelte-5qrnrc"&&(pe.innerHTML=Ql),Nt=a(e),ce=p(e,"P",{"data-svelte-h":!0}),d(ce)!=="svelte-zucy2s"&&(ce.innerHTML=Fl),It=a(e),u(re.$$.fragment,e),kt=a(e),ue=p(e,"P",{"data-svelte-h":!0}),d(ue)!=="svelte-u73w5r"&&(ue.textContent=Al),xt=a(e),u(Z.$$.fragment,e),Zt=a(e),u(me.$$.fragment,e),Vt=a(e),he=p(e,"P",{"data-svelte-h":!0}),d(he)!=="svelte-fs7ubo"&&(he.innerHTML=Sl),Et=a(e),u(fe.$$.fragment,e),Rt=a(e),Me=p(e,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-1kvpjr"&&(Me.textContent=Bl),_t=a(e),de=p(e,"P",{"data-svelte-h":!0}),d(de)!=="svelte-4fsaj7"&&(de.innerHTML=Ll),Wt=a(e),u(ge.$$.fragment,e),Qt=a(e),ye=p(e,"P",{"data-svelte-h":!0}),d(ye)!=="svelte-gi3hy9"&&(ye.textContent=Hl),Ft=a(e),u($e.$$.fragment,e),At=a(e),be=p(e,"P",{"data-svelte-h":!0}),d(be)!=="svelte-1wspkh7"&&(be.textContent=Yl),St=a(e),u(Ce.$$.fragment,e),Bt=a(e),u(Ue.$$.fragment,e),Lt=a(e),Te=p(e,"P",{"data-svelte-h":!0}),d(Te)!=="svelte-1ouytp9"&&(Te.innerHTML=zl),Ht=a(e),u(V.$$.fragment,e),Yt=a(e),we=p(e,"P",{"data-svelte-h":!0}),d(we)!=="svelte-qga36z"&&(we.innerHTML=Xl),zt=a(e),Je=p(e,"UL",{"data-svelte-h":!0}),d(Je)!=="svelte-1hd7bdg"&&(Je.innerHTML=ql),Xt=a(e),u(je.$$.fragment,e),qt=a(e),Ge=p(e,"P",{"data-svelte-h":!0}),d(Ge)!=="svelte-1atglf6"&&(Ge.innerHTML=Pl),Pt=a(e),u(E.$$.fragment,e),Dt=a(e),u(ve.$$.fragment,e),Ot=a(e),Ne=p(e,"P",{"data-svelte-h":!0}),d(Ne)!=="svelte-1wzt8py"&&(Ne.textContent=Dl),Kt=a(e),R=p(e,"UL",{});var Oe=nt(R);Ie=p(Oe,"LI",{});var Ke=nt(Ie);tt=p(Ke,"P",{"data-svelte-h":!0}),d(tt)!=="svelte-k3movz"&&(tt.innerHTML=Ol),wl=a(Ke),u(ke.$$.fragment,Ke),Ke.forEach(l),Jl=a(Oe),xe=p(Oe,"LI",{});var et=nt(xe);lt=p(et,"P",{"data-svelte-h":!0}),d(lt)!=="svelte-1uskw9x"&&(lt.innerHTML=Kl),jl=a(et),u(Ze.$$.fragment,et),et.forEach(l),Oe.forEach(l),el=a(e),u(Ve.$$.fragment,e),tl=a(e),Ee=p(e,"P",{"data-svelte-h":!0}),d(Ee)!=="svelte-1ks8djk"&&(Ee.innerHTML=es),ll=a(e),u(Re.$$.fragment,e),sl=a(e),_e=p(e,"P",{"data-svelte-h":!0}),d(_e)!=="svelte-1u6gmmt"&&(_e.textContent=ts),nl=a(e),u(We.$$.fragment,e),al=a(e),Qe=p(e,"P",{"data-svelte-h":!0}),d(Qe)!=="svelte-ddr8r5"&&(Qe.textContent=ls),ol=a(e),u(Fe.$$.fragment,e),il=a(e),u(_.$$.fragment,e),pl=a(e),u(Ae.$$.fragment,e),cl=a(e),Se=p(e,"P",{"data-svelte-h":!0}),d(Se)!=="svelte-w0229l"&&(Se.innerHTML=ss),rl=a(e),u(Be.$$.fragment,e),ul=a(e),Le=p(e,"P",{"data-svelte-h":!0}),d(Le)!=="svelte-ddr8r5"&&(Le.textContent=ns),ml=a(e),u(He.$$.fragment,e),hl=a(e),u(Ye.$$.fragment,e),fl=a(e),ze=p(e,"P",{"data-svelte-h":!0}),d(ze)!=="svelte-1laf0m8"&&(ze.textContent=as),Ml=a(e),u(Xe.$$.fragment,e),dl=a(e),qe=p(e,"P",{"data-svelte-h":!0}),d(qe)!=="svelte-qo8r7n"&&(qe.innerHTML=os),gl=a(e),u(Pe.$$.fragment,e),yl=a(e),$l=p(e,"HR",{}),bl=a(e),u(W.$$.fragment,e),Cl=a(e),u(De.$$.fragment,e),Ul=a(e),st=p(e,"P",{}),nt(st).forEach(l),this.h()},h(){ms(o,"name","hf:doc:metadata"),ms(o,"content",Ns)},m(e,t){Q(document.head,o),s(e,C,t),s(e,c,t),s(e,g,t),m(T,e,t),s(e,y,t),m(J,e,t),s(e,G,t),s(e,$,t),s(e,b,t),s(e,j,t),s(e,at,t),m(S,e,t),s(e,ot,t),s(e,B,t),s(e,it,t),s(e,L,t),s(e,pt,t),s(e,H,t),s(e,ct,t),m(Y,e,t),s(e,rt,t),s(e,z,t),s(e,ut,t),m(X,e,t),s(e,mt,t),s(e,q,t),s(e,ht,t),m(P,e,t),s(e,ft,t),s(e,D,t),s(e,Mt,t),m(O,e,t),s(e,dt,t),m(I,e,t),s(e,gt,t),m(K,e,t),s(e,yt,t),s(e,ee,t),s(e,$t,t),s(e,te,t),s(e,bt,t),m(k,e,t),s(e,Ct,t),m(le,e,t),s(e,Ut,t),m(x,e,t),s(e,Tt,t),s(e,se,t),s(e,wt,t),s(e,ne,t),s(e,Jt,t),m(ae,e,t),s(e,jt,t),m(oe,e,t),s(e,Gt,t),s(e,ie,t),s(e,vt,t),s(e,pe,t),s(e,Nt,t),s(e,ce,t),s(e,It,t),m(re,e,t),s(e,kt,t),s(e,ue,t),s(e,xt,t),m(Z,e,t),s(e,Zt,t),m(me,e,t),s(e,Vt,t),s(e,he,t),s(e,Et,t),m(fe,e,t),s(e,Rt,t),s(e,Me,t),s(e,_t,t),s(e,de,t),s(e,Wt,t),m(ge,e,t),s(e,Qt,t),s(e,ye,t),s(e,Ft,t),m($e,e,t),s(e,At,t),s(e,be,t),s(e,St,t),m(Ce,e,t),s(e,Bt,t),m(Ue,e,t),s(e,Lt,t),s(e,Te,t),s(e,Ht,t),m(V,e,t),s(e,Yt,t),s(e,we,t),s(e,zt,t),s(e,Je,t),s(e,Xt,t),m(je,e,t),s(e,qt,t),s(e,Ge,t),s(e,Pt,t),m(E,e,t),s(e,Dt,t),m(ve,e,t),s(e,Ot,t),s(e,Ne,t),s(e,Kt,t),s(e,R,t),Q(R,Ie),Q(Ie,tt),Q(Ie,wl),m(ke,Ie,null),Q(R,Jl),Q(R,xe),Q(xe,lt),Q(xe,jl),m(Ze,xe,null),s(e,el,t),m(Ve,e,t),s(e,tl,t),s(e,Ee,t),s(e,ll,t),m(Re,e,t),s(e,sl,t),s(e,_e,t),s(e,nl,t),m(We,e,t),s(e,al,t),s(e,Qe,t),s(e,ol,t),m(Fe,e,t),s(e,il,t),m(_,e,t),s(e,pl,t),m(Ae,e,t),s(e,cl,t),s(e,Se,t),s(e,rl,t),m(Be,e,t),s(e,ul,t),s(e,Le,t),s(e,ml,t),m(He,e,t),s(e,hl,t),m(Ye,e,t),s(e,fl,t),s(e,ze,t),s(e,Ml,t),m(Xe,e,t),s(e,dl,t),s(e,qe,t),s(e,gl,t),m(Pe,e,t),s(e,yl,t),s(e,$l,t),s(e,bl,t),m(W,e,t),s(e,Cl,t),m(De,e,t),s(e,Ul,t),s(e,st,t),Tl=!0},p(e,[t]){const Oe={};t&2&&(Oe.$$scope={dirty:t,ctx:e}),I.$set(Oe);const Ke={};t&2&&(Ke.$$scope={dirty:t,ctx:e}),k.$set(Ke);const et={};t&2&&(et.$$scope={dirty:t,ctx:e}),x.$set(et);const is={};t&2&&(is.$$scope={dirty:t,ctx:e}),Z.$set(is);const ps={};t&2&&(ps.$$scope={dirty:t,ctx:e}),V.$set(ps);const cs={};t&2&&(cs.$$scope={dirty:t,ctx:e}),E.$set(cs);const rs={};t&2&&(rs.$$scope={dirty:t,ctx:e}),_.$set(rs);const us={};t&2&&(us.$$scope={dirty:t,ctx:e}),W.$set(us)},i(e){Tl||(h(T.$$.fragment,e),h(J.$$.fragment,e),h(S.$$.fragment,e),h(Y.$$.fragment,e),h(X.$$.fragment,e),h(P.$$.fragment,e),h(O.$$.fragment,e),h(I.$$.fragment,e),h(K.$$.fragment,e),h(k.$$.fragment,e),h(le.$$.fragment,e),h(x.$$.fragment,e),h(ae.$$.fragment,e),h(oe.$$.fragment,e),h(re.$$.fragment,e),h(Z.$$.fragment,e),h(me.$$.fragment,e),h(fe.$$.fragment,e),h(ge.$$.fragment,e),h($e.$$.fragment,e),h(Ce.$$.fragment,e),h(Ue.$$.fragment,e),h(V.$$.fragment,e),h(je.$$.fragment,e),h(E.$$.fragment,e),h(ve.$$.fragment,e),h(ke.$$.fragment,e),h(Ze.$$.fragment,e),h(Ve.$$.fragment,e),h(Re.$$.fragment,e),h(We.$$.fragment,e),h(Fe.$$.fragment,e),h(_.$$.fragment,e),h(Ae.$$.fragment,e),h(Be.$$.fragment,e),h(He.$$.fragment,e),h(Ye.$$.fragment,e),h(Xe.$$.fragment,e),h(Pe.$$.fragment,e),h(W.$$.fragment,e),h(De.$$.fragment,e),Tl=!0)},o(e){f(T.$$.fragment,e),f(J.$$.fragment,e),f(S.$$.fragment,e),f(Y.$$.fragment,e),f(X.$$.fragment,e),f(P.$$.fragment,e),f(O.$$.fragment,e),f(I.$$.fragment,e),f(K.$$.fragment,e),f(k.$$.fragment,e),f(le.$$.fragment,e),f(x.$$.fragment,e),f(ae.$$.fragment,e),f(oe.$$.fragment,e),f(re.$$.fragment,e),f(Z.$$.fragment,e),f(me.$$.fragment,e),f(fe.$$.fragment,e),f(ge.$$.fragment,e),f($e.$$.fragment,e),f(Ce.$$.fragment,e),f(Ue.$$.fragment,e),f(V.$$.fragment,e),f(je.$$.fragment,e),f(E.$$.fragment,e),f(ve.$$.fragment,e),f(ke.$$.fragment,e),f(Ze.$$.fragment,e),f(Ve.$$.fragment,e),f(Re.$$.fragment,e),f(We.$$.fragment,e),f(Fe.$$.fragment,e),f(_.$$.fragment,e),f(Ae.$$.fragment,e),f(Be.$$.fragment,e),f(He.$$.fragment,e),f(Ye.$$.fragment,e),f(Xe.$$.fragment,e),f(Pe.$$.fragment,e),f(W.$$.fragment,e),f(De.$$.fragment,e),Tl=!1},d(e){e&&(l(C),l(c),l(g),l(y),l(G),l($),l(b),l(j),l(at),l(ot),l(B),l(it),l(L),l(pt),l(H),l(ct),l(rt),l(z),l(ut),l(mt),l(q),l(ht),l(ft),l(D),l(Mt),l(dt),l(gt),l(yt),l(ee),l($t),l(te),l(bt),l(Ct),l(Ut),l(Tt),l(se),l(wt),l(ne),l(Jt),l(jt),l(Gt),l(ie),l(vt),l(pe),l(Nt),l(ce),l(It),l(kt),l(ue),l(xt),l(Zt),l(Vt),l(he),l(Et),l(Rt),l(Me),l(_t),l(de),l(Wt),l(Qt),l(ye),l(Ft),l(At),l(be),l(St),l(Bt),l(Lt),l(Te),l(Ht),l(Yt),l(we),l(zt),l(Je),l(Xt),l(qt),l(Ge),l(Pt),l(Dt),l(Ot),l(Ne),l(Kt),l(R),l(el),l(tl),l(Ee),l(ll),l(sl),l(_e),l(nl),l(al),l(Qe),l(ol),l(il),l(pl),l(cl),l(Se),l(rl),l(ul),l(Le),l(ml),l(hl),l(fl),l(ze),l(Ml),l(dl),l(qe),l(gl),l(yl),l($l),l(bl),l(Cl),l(Ul),l(st)),l(o),M(T,e),M(J,e),M(S,e),M(Y,e),M(X,e),M(P,e),M(O,e),M(I,e),M(K,e),M(k,e),M(le,e),M(x,e),M(ae,e),M(oe,e),M(re,e),M(Z,e),M(me,e),M(fe,e),M(ge,e),M($e,e),M(Ce,e),M(Ue,e),M(V,e),M(je,e),M(E,e),M(ve,e),M(ke),M(Ze),M(Ve,e),M(Re,e),M(We,e),M(Fe,e),M(_,e),M(Ae,e),M(Be,e),M(He,e),M(Ye,e),M(Xe,e),M(Pe,e),M(W,e),M(De,e)}}}const Ns='{"title":"Deploy Qwen2 7B with TGI DLC from GCS on GKE","local":"deploy-qwen2-7b-with-tgi-dlc-from-gcs-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: Upload a model from the Hugging Face Hub to GCS","local":"optional-upload-a-model-from-the-hugging-face-hub-to-gcs","sections":[],"depth":2},{"title":"Configure IAM for GCS","local":"configure-iam-for-gcs","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 Is(w){return fs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rs extends Ms{constructor(o){super(),ds(this,o,Is,vs,hs,{})}}export{Rs as component};
