Posts

Showing posts from April 22, 2024

[Day 112] db2chat - Talk with your (sqlite3) database

Image
 Hello :) Today is Day 112! A quick summary of today: made a webapp to talk with a database ( webapp ) ( github ) This morning I saw this langchain post on creating a chat agent with a database, and it hit me - I need to make one myself! The short but concise tutorial uses GPT, but I am just a poor student that prefers to use open source, and from a random X post I learned about Groq. It is crazy that we can use Groq models off-the-shelf (like mistral-8x7b, gemma-7b-it, and even llama3-8b). A quick summary of the code 1st: create a query chain for the sql code 2nd: query the model for a natural response 3rd: I used streamlit because it is so easy to develop, and deploy a webapp with it Webapp summary 1. Input your Groq/OpenAI API key and select a model (mistral-8x7b, gpt-4, llama3-8b, gemma-7b-it) 2. Load your sqlite3 db file (optional) 3. Select a database to chat with (default is chinook) + click 'Connect' You can view your db's schema: 4. Enter a query, run and get your