How to use FastAPI with and LLM and database. The SQL database query is sent to the LLM. This is one of basic skills for AI app development for businesses. You can combine your SQL query skills with the power of AI analysis to find trends.
This tutorial uses a free, open source bundle with FastAPI, SQLAdmin, and SQLModel, TailwindCSS, HTMX, DaisyUI, and AlpineJS.
Installation of the stack: https://youtu.be/_P9p0BGO64Q
Repo for starting point is here: https://github.com/Oppkey/fastopp
Ending point of tutorial is here: https://github.com/Oppkey/fastopp-simple-ai-db-tutorial
LLM https://openrouter.ai/
Cheap models: https://openrouter.ai/models?max_price=0.1
The paid model I’m using:
https://openrouter.ai/meta-llama/llama-3.3-70b-instruct
The free version is: https://openrouter.ai/meta-llama/llama-3.3-70b-instruct: free
This tutorial is intended for education only and is not meant for deployment by a business.
– Free FastAPI Deployment – No Credit Card – Railway https://youtu.be/7vxroD-tyo8