Skip to content

Yazhini-Krishnan/sqlQueryGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL Query Generator: Natural Language to SQL Query

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.

Features

  • 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

Tech Stack

Getting Started

1. Clone the Repository

git clone https://github.com/Yazhini-Krishnan/sqlQueryGenerator/blob/main/README.md
cd query-gpt

2. Setting up a Python virtual environment

python -m venv venv
# Activate the environment:
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate

3. Pip Upgrade

pip install --upgrade pip

4. Install Required Dependencies

pip install streamlit pandas llama-cpp-python huggingface_hub

5. Download Phi-3 Model

python phi_3_download.py

6. Update path in app.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"

7. Run the app

streamlit run app.py

About

Sql Query Generator 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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages