Deploy Gemma 2 with multiple LoRA adapters on GKE

Google Cloud Tech · Beginner ·🧠 Large Language Models ·1y ago

Key Takeaways

This video demonstrates how to deploy Gemma 2 with multiple LoRA adapters using TGI on Google Kubernetes Engine (GKE), allowing for dynamic selection of adapters for incoming requests.

Full Transcript

[Music] hi I'm V from Google cloud and I'm abdell today we'll show you how to deploy Gemma 2 with multiple Dora adapters using TGI on Google kubernetes engine that sounds complicated can you break it down for us sure let's go over some terms first Gema is Google's open large language model and TGI is an open source Next Generation inference server from huging phase now low rank adaptation or Laura is a fine-tuning technique used to adapt a base model to specific tasks without retraining the entire model instead Laura introduces small adapter layers that are trained on a targeted data set while the original base model remains Frozen so why would you want to deploy Gemma 2 with multiple Laura adapters on jaki well there are a few benefits in a multi Laura deployment you deploy this single base model and then load multiple Laura adapters and you can dynamically select a different adapter for each incoming requests so you don't have to create multiple deployments which is more cost-efficient that sounds great how do you actually deploy Gemma 2 with multiple Laura adapters with TGI DLC on GK um I was hoping that you would show me that sure well it's a multi-step process first you need to create a GK cluster we already covered this in previous videos check the links in the description box after that you need to deploy Gemma 2 with multiple adapters using the TGI deep learning container on the cluster that you're right that doesn't sound complicated at all is there anything else people should know well first of all let's look at some y files first we have my deployment. yl file this file describes our deployment including the number of replicas the container images we are using in this case TGI and any environment variables see this section here this is where we specify the GMA 2 model and theora adapter we want to deploy next we have our Ingress yaml these files Define how our deployed container will be exposed to the outside world it basically creates a load balancer so we can access our Gemma 2 model enough enough jaml files let's get this show on the road can you show me how to actually send a request to it sure using curl you can send request to the model and specify the adapter layer to use in the particular case I am using the SQL adapter okay it looks like you got a response back but I was hoping you can show me how a developer would use this in the r of course using the hugging face Hub is dek I have to import the inference client specify the model endpoint that is the IP address of my load balancer and invoke the model using the magic coder adapter layer to generate some Rust code that's amazing this is this is rust code so you're saying that this is one deployment of a base model and then TGI selects a different adapter based on the request that's pretty much it awesome well there you have it we showed you how to deploy a Gemma 2 based model with multiple Laura adapters don't forget to check out the description for links to all the resources we use today including those yaml files and if you have any question drop them in the comments below thanks for watching and we'll see you in the next one [Music]

Original Description

Tutorial: Deploy Gemma 2 with multiple LoRA adapters using TGI on GKE → https://goo.gle/4f5KP1C Video: Train a LoRA adapter with your own dataset → https://goo.gle/4gkBLar Deep dive: A conceptual overview of Low-Rank Adaptation (LoRA) → https://goo.gle/4in4NrA Learn how to deploy multiple LoRA adapters in one deployment on Google Kubernetes Engine. Low-Rank Adaptation, or LoRA, is a fine-tuning technique used to adapt a base model to specific tasks without retraining the entire model. Watch along and learn how to deploy Gemma 2, a powerful open large language model, and TGI, an open-source LLM inference server from Hugging Face, to deploy multiple LoRA adapters for different tasks. More resources: Docs: Hugging Face Hub Inference client → https://goo.gle/3Zrwo2c Docs: An overview of the TGI command line interface flags → https://goo.gle/41Fs1nd Watch more Google Cloud: Building with Hugging Face → https://goo.gle/BuildWithHuggingFace Subscribe to Google Cloud Tech → https://goo.gle/GoogleCloudTech Speakers: Wietse Venema, Abdel Sghiouar Products Mentioned: Gemma, Gemini, Google Kubernetes Engine (GKE) #GoogleCloud #HuggingFace
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Google Cloud Tech · Google Cloud Tech · 0 of 60

← Previous Next →
1 I’m going for it #GoogleCloudCertified
I’m going for it #GoogleCloudCertified
Google Cloud Tech
2 I had to get #GoogleCloudCertified
I had to get #GoogleCloudCertified
Google Cloud Tech
3 Be better overall at what you do #GoogleCloudCertified
Be better overall at what you do #GoogleCloudCertified
Google Cloud Tech
4 Cloud Monitoring on our radar #Analysis #Uptime
Cloud Monitoring on our radar #Analysis #Uptime
Google Cloud Tech
5 Introduction to Generative AI Studio
Introduction to Generative AI Studio
Google Cloud Tech
6 How to use Github Actions with Google's Workload Identity Federation
How to use Github Actions with Google's Workload Identity Federation
Google Cloud Tech
7 Introduction to Responsible AI
Introduction to Responsible AI
Google Cloud Tech
8 Networking updates and CDMC-certified architecture
Networking updates and CDMC-certified architecture
Google Cloud Tech
9 Create and use a Cloud Storage bucket
Create and use a Cloud Storage bucket
Google Cloud Tech
10 How to digitize text from documents
How to digitize text from documents
Google Cloud Tech
11 Faster analytical queries with AlloyDB
Faster analytical queries with AlloyDB
Google Cloud Tech
12 Next ‘23 sessions and FaaS Wave
Next ‘23 sessions and FaaS Wave
Google Cloud Tech
13 Introduction to Assured Open Source Software
Introduction to Assured Open Source Software
Google Cloud Tech
14 BigQuery Cost Optimization: Storage
BigQuery Cost Optimization: Storage
Google Cloud Tech
15 BigQuery Cost Optimization: Compute
BigQuery Cost Optimization: Compute
Google Cloud Tech
16 BigQuery Cost Optimization: Select Queries
BigQuery Cost Optimization: Select Queries
Google Cloud Tech
17 Remote Field Equipment Management with Manufacturing Data Engine
Remote Field Equipment Management with Manufacturing Data Engine
Google Cloud Tech
18 Supercharging your applications with Cloud SQL Enterprise Plus
Supercharging your applications with Cloud SQL Enterprise Plus
Google Cloud Tech
19 Vector Support on our radar #GenAI
Vector Support on our radar #GenAI
Google Cloud Tech
20 Architecting a blockchain startup with Google Cloud
Architecting a blockchain startup with Google Cloud
Google Cloud Tech
21 Kubernetes and multitasking updates!
Kubernetes and multitasking updates!
Google Cloud Tech
22 GKE: Using Kubernetes Events
GKE: Using Kubernetes Events
Google Cloud Tech
23 How to configure firewall rules for Cloud Composer
How to configure firewall rules for Cloud Composer
Google Cloud Tech
24 Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Google Cloud Tech
25 Geospatial analytics on our radar #EarthEngine #BigQuery
Geospatial analytics on our radar #EarthEngine #BigQuery
Google Cloud Tech
26 Ensuring requests are set in Kubernetes
Ensuring requests are set in Kubernetes
Google Cloud Tech
27 Cloud Next 2023, Google research program, and more!
Cloud Next 2023, Google research program, and more!
Google Cloud Tech
28 How to migrate projects between organizations with Resource Manager
How to migrate projects between organizations with Resource Manager
Google Cloud Tech
29 How to run #MySQL in Google Cloud
How to run #MySQL in Google Cloud
Google Cloud Tech
30 #GenerativeAI for enterprises and #Next2023
#GenerativeAI for enterprises and #Next2023
Google Cloud Tech
31 How Google Photos scales to store 4 trillion photos and videos
How Google Photos scales to store 4 trillion photos and videos
Google Cloud Tech
32 Google Cross-Cloud Interconnect (Demo 2)
Google Cross-Cloud Interconnect (Demo 2)
Google Cloud Tech
33 GKE Cost Optimization Golden Signals: Introduction
GKE Cost Optimization Golden Signals: Introduction
Google Cloud Tech
34 GKE Cost Optimization Golden Signals: Workload Rightsizing
GKE Cost Optimization Golden Signals: Workload Rightsizing
Google Cloud Tech
35 GKE Load Balancing: Overview
GKE Load Balancing: Overview
Google Cloud Tech
36 GKE Load Balancing: Best Practices
GKE Load Balancing: Best Practices
Google Cloud Tech
37 Disaster Recovery in GKE
Disaster Recovery in GKE
Google Cloud Tech
38 How to configure IP masquerade agent in GKE Standard clusters
How to configure IP masquerade agent in GKE Standard clusters
Google Cloud Tech
39 Enable and use GKE Control plane logs
Enable and use GKE Control plane logs
Google Cloud Tech
40 Compliance in Australia with Assured Workloads
Compliance in Australia with Assured Workloads
Google Cloud Tech
41 Creating budgets and budget alerts in Google Cloud #FinOps
Creating budgets and budget alerts in Google Cloud #FinOps
Google Cloud Tech
42 Cloud SQL Enterprise Plus on our radar #mySQL
Cloud SQL Enterprise Plus on our radar #mySQL
Google Cloud Tech
43 What's Next for Google Cloud?
What's Next for Google Cloud?
Google Cloud Tech
44 How Loveholidays scaled with Contact Center AI
How Loveholidays scaled with Contact Center AI
Google Cloud Tech
45 What is fleet team management in GKE?
What is fleet team management in GKE?
Google Cloud Tech
46 Troubleshoot VPC Network Peering
Troubleshoot VPC Network Peering
Google Cloud Tech
47 Introduction to DocAI and Contact Center AI
Introduction to DocAI and Contact Center AI
Google Cloud Tech
48 Cloud Run Direct VPC egress explained
Cloud Run Direct VPC egress explained
Google Cloud Tech
49 Database deployment options in GKE
Database deployment options in GKE
Google Cloud Tech
50 Analyze cloud billing data with #BigQuery
Analyze cloud billing data with #BigQuery
Google Cloud Tech
51 Tips to becoming a world-class Prompt Engineer
Tips to becoming a world-class Prompt Engineer
Google Cloud Tech
52 Serverless is simple. Do I need CI/CD?
Serverless is simple. Do I need CI/CD?
Google Cloud Tech
53 Accelerating model deployment with MLOps
Accelerating model deployment with MLOps
Google Cloud Tech
54 How Hawaii's Department of Human Services scaled with CCAI
How Hawaii's Department of Human Services scaled with CCAI
Google Cloud Tech
55 Pricing API on our #Radar
Pricing API on our #Radar
Google Cloud Tech
56 How Recommendations AI for Media can boost customer retention
How Recommendations AI for Media can boost customer retention
Google Cloud Tech
57 Troubleshooting: Node Not Ready Status
Troubleshooting: Node Not Ready Status
Google Cloud Tech
58 One weekend until Cloud Next 2023!
One weekend until Cloud Next 2023!
Google Cloud Tech
59 #GoogleCloudNext starts tomorrow!
#GoogleCloudNext starts tomorrow!
Google Cloud Tech
60 #GoogleCloudNext will be demand!
#GoogleCloudNext will be demand!
Google Cloud Tech

This video teaches how to deploy Gemma 2 with multiple LoRA adapters on GKE, enabling efficient and dynamic model selection. Viewers learn how to use TGI and Hugging Face Hub for inference and model deployment.

Key Takeaways
  1. Create a GKE cluster
  2. Deploy Gemma 2 with multiple LoRA adapters using TGI
  3. Define deployment and ingress YAML files
  4. Send requests to the model using curl or Hugging Face Hub
  5. Specify adapter layers for incoming requests
💡 Deploying a single base model with multiple LoRA adapters allows for dynamic selection of adapters, reducing the need for multiple deployments and increasing cost efficiency.

Related Reads

📰
Unlocking Open-Source AI: 5 Tools for Unbeatable Privacy and Cost Efficiency
Unlock 5 open-source AI tools for enhanced privacy and cost efficiency in tech companies
Medium · LLM
📰
The AEO tricks that don’t work in AI search
Learn which AEO tricks are ineffective in AI search and why, to improve your search strategies
Medium · AI
📰
Building Production-Grade LLM Evaluation Pipelines: From Vibes to Metrics
Learn to build production-grade LLM evaluation pipelines to catch hallucinations before deployment, replacing manual 'vibe checks' with automated metrics
Dev.to AI
📰
Building AI Data Pipelines — How to Feed Your LLM Fresh Web Data
Learn to build automated AI data pipelines to feed your LLM with fresh web data, saving development time and reducing maintenance headaches
Dev.to AI
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →