Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building LLM Powered  Applications

You're reading from   Building LLM Powered Applications Create intelligent apps and agents with large language models

Arrow left icon
Product type Paperback
Published in May 2024
Publisher Packt
ISBN-13 9781835462317
Length 342 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Valentina Alto Valentina Alto
Author Profile Icon Valentina Alto
Valentina Alto
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Introduction to Large Language Models FREE CHAPTER 2. LLMs for AI-Powered Applications 3. Choosing an LLM for Your Application 4. Prompt Engineering 5. Embedding LLMs within Your Applications 6. Building Conversational Applications 7. Search and Recommendation Engines with LLMs 8. Using LLMs with Structured Data 9. Working with Code 10. Building Multimodal Applications with LLMs 11. Fine-Tuning Large Language Models 12. Responsible AI 13. Emerging Trends and Innovations 14. Other Books You May Enjoy
15. Index

Front-end with Streamlit

Now that we have seen the logic behind an LLM-powered recommendation system, it is now time to give a GUI to our MovieHarbor. To do so, we will once again leverage Streamlit, and we will assume the cold start scenario. As always, you can find the whole Python code in the GitHub book repository at https://github.com/PacktPublishing/Building-Large-Language-Model-Applications.As per the Globebotter application, also in this case you need to create a .py file to run in your terminal via streamlit run file.py. In our case, the file will be named movieharbor.py.Below you can find the main steps to build the front end:

  • Configuring the application webpage:
import streamlit as st
st.set_page_config(page_title="GlobeBotter", page_icon=" ")
st.header('  Welcome to MovieHarbor, your favourite movie recommender')
  • Importing the credentials and establishing the connection towards LanceDB:
load_dotenv()
#os.environ["HUGGINGFACEHUB_API_TOKEN...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime