Sampath1-1-1/Telemanas_PE

0

stars

2

commits

Jupyter Notebook

primary language

Dec 18, 2025

updated

README

Telemans analysis with Llama‑Powered SQL‑to‑Graph Demo

This repository demonstrates converting CSV to SQLite, running a Flask/Streamlit server, and interacting with a 2B‑parameter LLaMA model to convert Natural Language → SQL → Graphs.


Quick Setup Instructions


1. Create and Activate a Virtual Environment

python3 -m venv env
source env/bin/activate  # for macOS/Linux

2. Install Dependencies

pip install -r requirements.txt

If you get an error for packages like json, typing, logging, etc. — they are part of Python’s standard library. You do not need to list or install them separately.

3. Run LLaMA-based Server

The model used is around 2B parameters, requiring approximately 8 GB RAM.

  • If you have 8 GB RAM or more, you're good to go!
  • If not, then open server.py and comment out the last line:
# t1.start()

4. Start the Server

This to be done everyday once to include the updated database information at the front end. Front end need not to be uploaded again and again.

python server.py

Your server will now be live at http://localhost:8000


Convert CSV to SQLite

First step is to convert your input CSV file into a SQLite database.

python nl_to_sql_to_graph/csv_to_sqlite.py

This generates database.sqlite in the root folder.


Tips to Improve Results

Prompt Engineering

  • Provide multiple variations of your natural language prompts.

Fine‑Tuning

  • Fine‑tune the LLM with diverse SQL queries.

Use More Powerful LLMs

  • You can swap in a stronger LLaMA variant or a completely different model via the loader logic in server.py.

Summary of Commands

git clone <your-repo-url>
cd <your-repo-folder>
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python nl_to_sql_to_graph/csv_to_sqlite.py
python server.py

Environment Variables (Optional)

export PORT=8000
export MAX_RAM_GB=8
export LLAMA_MODEL_PATH="/path/to/llama-2b"

## Front-end

The front-end application for this project lives in its own repository:


Contributors

Sampath1-1-1

2 commits

Sampath1-1-1/Telemanas_PE

0

stars

2

commits

Jupyter Notebook

primary language

Dec 18, 2025

updated

README

Telemans analysis with Llama‑Powered SQL‑to‑Graph Demo

This repository demonstrates converting CSV to SQLite, running a Flask/Streamlit server, and interacting with a 2B‑parameter LLaMA model to convert Natural Language → SQL → Graphs.


Quick Setup Instructions


1. Create and Activate a Virtual Environment

python3 -m venv env
source env/bin/activate  # for macOS/Linux

2. Install Dependencies

pip install -r requirements.txt

If you get an error for packages like json, typing, logging, etc. — they are part of Python’s standard library. You do not need to list or install them separately.

3. Run LLaMA-based Server

The model used is around 2B parameters, requiring approximately 8 GB RAM.

  • If you have 8 GB RAM or more, you're good to go!
  • If not, then open server.py and comment out the last line:
# t1.start()

4. Start the Server

This to be done everyday once to include the updated database information at the front end. Front end need not to be uploaded again and again.

python server.py

Your server will now be live at http://localhost:8000


Convert CSV to SQLite

First step is to convert your input CSV file into a SQLite database.

python nl_to_sql_to_graph/csv_to_sqlite.py

This generates database.sqlite in the root folder.


Tips to Improve Results

Prompt Engineering

  • Provide multiple variations of your natural language prompts.

Fine‑Tuning

  • Fine‑tune the LLM with diverse SQL queries.

Use More Powerful LLMs

  • You can swap in a stronger LLaMA variant or a completely different model via the loader logic in server.py.

Summary of Commands

git clone <your-repo-url>
cd <your-repo-folder>
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python nl_to_sql_to_graph/csv_to_sqlite.py
python server.py

Environment Variables (Optional)

export PORT=8000
export MAX_RAM_GB=8
export LLAMA_MODEL_PATH="/path/to/llama-2b"

## Front-end

The front-end application for this project lives in its own repository:


Contributors

Sampath1-1-1

2 commits

Languages

Jupyter Notebook

97.1%

Python

2.8%