Open Source RAG with Gemma and Langchain | (Deploy LLM on-prem)
Farzad (AI RoundTable)
View ChannelAbout
Hi My name is Farzad. I design and build AI projects. 📧 Email: [email protected] 📧 Website: tableofai.com 📧 GitHub: https://github.com/Farzad-R 📧 Linkedin: https://www.linkedin.com/in/farzad-roozitalab/
Latest Posts
Video Description
In this video, I show how to serve your open-source LLM and Embedding model on-prem for designing a Retrieval Augmented Generation (RAG) chatbot. For this purpose, I take RAG-GPT chatbot and instead of the GPT model, I use *Google Gemma 7B* as the LLM and instead of text-embedding-ada-002, I use *baai/bge-large-en* from Huggingface. I use Flask to develop a web server that will serve the LLM for real-time inferencing and I show you how to use Postman to develop these types of projects. 00:00 intro 01:22 Demo 03:12 RAG-GPT schema 04:39 RAG-Gemma schema 05:19 Challenges of open-source LLMa for chatbots 7:15 A possible solution for serving LLMs on-prem 08:02 Lost in the middle (A tip for context-length) 09:26 Project structure 11:18 How to load and interact with Gemma 13:06 Developing LLM web server with Flask 20:38 Testing and debugging the LLM web server with Postman 25:00 Testing the RAG chatbot 27:22 GPU usage of this chatbot 27:48 Do we need a web server for the embedding model? 🚀 *GitHub Repository:* https://github.com/Farzad-R/LLM-Zero-to-Hundred/tree/master/Open-Source-RAG-GEMMA 🎓 *Models that are used in this chatbot:* BAAI/bge-large-en: https://huggingface.co/BAAI/bge-large-en Google Gemma: https://huggingface.co/blog/gemma 📚 *Extra Resources:* RAG-GPT: https://www.youtube.com/watch?v=1FERFfut4Uw&t=676s Quantization: https://huggingface.co/docs/transformers/main_classes/quantization Lost in the Middle Paper: https://arxiv.org/abs/2307.03172 Download Postman: https://www.postman.com/downloads/ #opensource #llm #rag #chatbot #huggingface #google #gemma #gradio #langchain #Flask #python #GUI #postman
Essential AI Deployment Gear
AI-recommended products based on this video

Seasonic Focus V4 GX-1000 (ATX3) - 1000W - 80+ Gold - ATX 3.0 & PCIe 5.1 Ready -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible

Crucial 64GB DDR5 RAM, 5600MHz (or 5200MHz or 4800MHz) Desktop Memory Kit, UDIMM 288-Pin, Compatible with 13th Gen Intel Core and AMD Ryzen 7000 - CT2K32G56C46U5

Samsung 990 EVO Plus - 4TB PCIe Gen4. X4, Gen5. X2 NVMe 2.0 - M.2 Internal SSD, Speed Up to 7,250 MBs, Upgrade Storage for PC-Laptops, HMB Technology and Intelligent Turbowrite (MZ-V9S4T0B/AM)
![SAMSUNG 990 PRO SSD 4TB PCIe Gen4 NVMe M.2 Internal Solid State Hard Drive, Up to 7,450MB/s, Heat Control, Direct Storage and Memory Expansion, MZ-V9P4T0B/AM [Canada Version]](https://m.media-amazon.com/images/I/81WuG6lQuDL._AC_UL960_FMwebp_QL65_.jpg)
SAMSUNG 990 PRO SSD 4TB PCIe Gen4 NVMe M.2 Internal Solid State Hard Drive, Up to 7,450MB/s, Heat Control, Direct Storage and Memory Expansion, MZ-V9P4T0B/AM [Canada Version]
![Samsung 9100 PRO Series - 4TB PCIe 5.0 x4, NVMe 2.0, M.2 Internal SSD, Up to 14,800MB/s, Fast Speed, Thermal Contorl, MZ-VAP4T0B/AM [Canada Version]](https://m.media-amazon.com/images/I/71qygJIcKnL._AC_UL960_FMwebp_QL65_.jpg)
Samsung 9100 PRO Series - 4TB PCIe 5.0 x4, NVMe 2.0, M.2 Internal SSD, Up to 14,800MB/s, Fast Speed, Thermal Contorl, MZ-VAP4T0B/AM [Canada Version]
![SAMSUNG 870 EVO SATA SSD 500GB 2.5” Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E500B/AM [Canada Version]](https://m.media-amazon.com/images/I/911ujeCkGfL._AC_UL960_FMwebp_QL65_.jpg)
SAMSUNG 870 EVO SATA SSD 500GB 2.5” Internal Solid State Drive, Upgrade PC or Laptop Memory and Storage for IT Pros, Creators, Everyday Users, MZ-77E500B/AM [Canada Version]

OWC 64GB DDR5 4800 PC5-38400 CL40 2Rx4 288-pin 1.1V ECC Registered RDIMM Memory RAM Module Upgrade Compatible with Dell PowerEdge R6625 R760 R7615 R7625

TP-Link USB to Ethernet Adapter (UE306) - Foldable USB 3.0 to Gigabit Ethernet LAN Laptop Network Adapter, Supports Nintendo Switch, Windows, Linux, Apple MacBook OS 10.11- OS 12, Surface
![TP-Link USB C To Ethernet Adapter (UE300C) - J45 To USB C [Thunderbolt 3/4 Compatible] Type-C Gigabit Ethernet LAN Network Adapter, Compatible With Apple MacBook Pro 2017-2023, MacBook Air, And More](https://m.media-amazon.com/images/I/418xZkoG-RL._AC_UY654_FMwebp_QL65_.jpg)
TP-Link USB C To Ethernet Adapter (UE300C) - J45 To USB C [Thunderbolt 3/4 Compatible] Type-C Gigabit Ethernet LAN Network Adapter, Compatible With Apple MacBook Pro 2017-2023, MacBook Air, And More

TP-Link USB Bluetooth Adapter for PC, 4.0 Bluetooth Dongle Receiver (UB400) - Support Windows 11/10/8.1/8/7/XP for Desktop, Laptop, Mouse, Keyboard, Printers, Headsets, Speakers, PS4/ Xbox Controllers

TP-Link USB WiFi Adapter for PC(TL-WN725N), N150 Wireless Network Adapter for Desktop - Nano Size WiFi Dongle for Windows 11/10/7/8/8.1/XP/ Mac OS 10.9-10.15 Linux Kernel 2.6.18-4.4.3, 2.4GHz Only

Skytech Archangel Gaming PC, Intel i5 14400F 2.5 GHz, RTX 4070 Super, 1TB NVME, 32GB DDR4 RAM 3200, 650W Gold PSU, Wi-Fi, Win 11 Home

Skytech Omega Gaming PC, Ryzen 7 7800X3D 4.2 GHz, RTX 4070 Super, 1TB NVME Gen4, 32GB DDR5 RAM RGB, 750W Gold PSU, Wi-Fi, Win 11 Home

Skytech Azure Gaming PC, Intel i7 14700F 2.1 GHz, RTX 4070 Super 12GB GDDR6X, 1TB NVME Gen4, 32GB DDR5 RAM RGB, 750W Gold PSU, Wi-Fi, Win 11 Home

Skytech Omega Gaming PC, Ryzen 7 7700X 4.5 GHz, RTX 4070 Super 12GB GDDR6X, 1TB NVME Gen4, 32GB DDR5 RAM RGB, 750W Gold PSU, Wi-Fi, Win 11 Home

HSSDTECH CMOS Battery Cable Replacement for Lenovo ThinkPad T490 T590 P53s /P16 Gen 1 Gen 2/P16v Gen 1/T14 Gen 1 Gen 2/P14s Gen 1 Gen 2 02HK903 02HK904 02HK905 SB10G62453 GC000000700

AsperX for Magsafe Power Bank, 10000mAh Wireless Magnetic Power Bank, 22.5W Wire Fast Charging Portable Charger with USB C Cable, LCD Display for Magsafe Battery Pack for iPhone 16/15/14/13/12

OYEAELX 3 in 1 with Built in Cable Portable Charger 15800mAh Cell Phone Battery Backup Ultra Slim Mini Power Bank with LCD Display Compatible with iPhone iPad Android Samsung Galaxy and More

2 Pack Rechargeable Controller Battery Pack for Xbox Series X|S and Xbox One with 10FT USB C Charging Cable and Micro USB Adapter 6amLifestyle Battery Pack Xbox Play and Charge Kit




