Query GPT is a free, open-source tool that lets anyone convert natural language questions into SQL queries for their own data tables, using local open-source AI models (like Phi-3) — no API keys, no usage limits, and no costs.
- Upload your own data (CSV or Excel) - the data should just have 2 columns, column name and data type
- See your table’s schema and preview your data
- Ask questions in plain English (e.g. "Show top 5 customers by revenue")
- Get complete SQL queries instantly, generated by a local LLM (Phi-3)
- 100% private: nothing is sent to external servers
- Streamlit for the web app
- llama-cpp-python for running local AI models
- Phi-3 Mini Instruct as the default language model
- pandas for data handling
git clone https://github.com/Yazhini-Krishnan/sqlQueryGenerator/blob/main/README.md
cd query-gptpython -m venv venv
# Activate the environment:
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate
pip install --upgrade pip
pip install streamlit pandas llama-cpp-python huggingface_hub
python phi_3_download.py
Update the model path in your app.py as needed:
MODEL_PATH = "/full/path/to/phi-3-mini-4k-instruct.Q4_K_M.gguf"
streamlit run app.py