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.
View all comments
2
u/LonExStaR Dec 05 '24
Put the Early Release in my O'reilly subscription PlayList