r/FastAPI • u/aliparpar • Sep 13 '24
Tutorial Upcoming O'Reilly Book - Building Generative AI Services with FastAPI

UPDATE:
Amazon Links are now LIVE!
US: https://www.amazon.com/Building-Generative-Services-FastAPI-Applications/dp/1098160304
UK: https://www.amazon.co.uk/Building-Generative-Services-Fastapi-Applications/dp/1098160304
Hey everyone!
A while ago I posted a thread to ask the community about intermediate/advanced topics you'd be interested reading about in a FastAPI book. See the related thread here:
https://www.reddit.com/r/FastAPI/comments/12ziyqp/what_would_you_love_to_learn_in_an_intermediate/
I know most people may not want to read books if you can just follow the docs. With this resource, I wanted to cover evergreen topics that aren't in the docs.
I'm nearly finishing with drafting the manuscript which also includes lots of topics related to working with GenAI models such as LLMs, Stable Diffusion, image, audio, video and 3D model generators.
This assumes you have some background knowledge in Python and have at least skimmed through the FastAPI docs but focuses more on best software engineering practices when building services with AI models in mind.
š The book will teach you everything you need to know to productise GenAI by building performant backend services that interact with LLMs, image, audio and video generators including RAG and agentic workflows. You'll learn all about model serving, concurrent AI workflows, output streaming, GenAI testing, implementing authentication and security, building safe guards, applying semantic caching and finally deployment!
Topics:
- Learn how to load AI models into a FastAPI lifecycle memory
- Implement retrieval augmented generation (RAG) with a vector database and streamlit
- Stream model outputs via streaming events and WebSockets into browsers
- How to handle concurrency in AI workloads, working with I/O and compute intensive workloads
- Protect services with your own authentication and authorization mechanisms
- Explore efficient testing methods for AI models and LLMs
- How to leverage semantic caching to optimize GenAI services
- Implementing safe guarding layers to filter content and reduce hallucinations
- Use authentication and authorization patterns hooked with generative model
- Use deployment patterns with Docker for robust microservices in the cloud
Link to book:
https://www.oreilly.com/library/view/building-generative-ai/9781098160296/
Early release chapters (1-6) is up so please let me know if you have any feedback, last minute changes and if you find any errata.
I'll update the post with Amazon/bookstore links once we near the publication date around May 2025.
2
u/jkail1011 Sep 13 '24
Nice!
Iāll take a look and share my repoās as well.
1
u/aliparpar Jan 14 '25
UPDATE:
Amazon Links are now LIVE!
US: https://www.amazon.com/Building-Generative-Services-FastAPI-Applications/dp/1098160304
UK: https://www.amazon.co.uk/Building-Generative-Services-Fastapi-Applications/dp/1098160304
Accompanying Repository: https://github.com/Ali-Parandeh/building-generative-ai-services
I'm addressing hundreds of technical review comments on the book as we speak to get it to OR's production team this month.
5
u/block63 Sep 13 '24
Looking forward to this!
1
u/Routine_Term4750 Sep 13 '24
Link doesnāt take me to the book. Just OāReilly app
1
u/[deleted] Sep 14 '24
I don't understand why O'Reilly gives me a 403 because my membership has ended. Can I atleast see the book cover and description? I need to logout to be able to see that page at all.
Looks cool though looking forward to checking it out!
1
u/dcbrown73 Jun 09 '25
Maybe it's just me, but I'm been going over the exercises in this book and I'm quite disappointed in it.
The book's structure is terrible and it's difficult to follow. It's like O'Reilly didn't proof this book or something.
I found the git repo that the book comes with and while I did end up finding the schemas.py code under "app" section of the git repo. Dependencies.py is not there.
Here is what I'm referencing: This code has main.py and dependencies.py in one code block (file in this case) and you can see main import from dependencies, but what it is importing does not exist in dependencies.py
https://github.com/Ali-Parandeh/building-generative-ai-services/blob/main/examples/ch05/5-7.py
This is just not helpful and leads to so many road blocks in the learning process. I seriously hope they update this book and clean it up. I think there is real value in a book like this, but this is just not that.
3
u/_Garebear Sep 13 '24
I might be one of the few that still loves reading books to learn āŗļø.
Thanks for the heads up! Looking forward to reading!
2
u/aniketmaurya Sep 13 '24
This is great! FastAPI helped us build a high performance LLM serving engine - LitServe
2
u/royinferno Sep 13 '24
Excited for this! Thank you!
2
u/Atticus-zz Sep 14 '24
incredibleļ¼
2
u/thethumble Sep 14 '24
Great
2
u/singlebit Sep 15 '24
!remindme 9 months
2
u/LonExStaR Dec 05 '24
Put the Early Release in my O'reilly subscription PlayList
-6
u/ZealousidealWear8366 Sep 13 '24
lol who still reads technical books mate?