A clean and simple guide to get GNLSELab running locally.
Make sure you have the following:
- 🖥️ macOS or Linux terminal
- 🐍 Python 3.10+
- 📦
pip - 🌐 Internet connection
- OpenAI API key
- Gemini API key
- OR 🧠 Ollama (local models)
Navigate to the project directory:
lsYou should see:
code/
requirements.txt
README.md
Create a virtual environment (first-time setup):
python3 -m venv .venvActivate it:
source .venv/bin/activateYou should now see:
(.venv)
Upgrade pip and install required packages:
pip install --upgrade pip
pip install -r requirements.txtpip install certificd code
python app.pyOpen your browser:
You should see Flask running on port 3000.
Test if everything works:
- Open Plots tab
- Move any slider (e.g., Peak Power)
Confirm:
- Plots update
- Terminal shows logs
- Stats update in top cards
Go to the Chat tab and select a provider.
- Select ChatGPT API
- Paste your OpenAI API key
- Send a prompt
If you get insufficient_quota, billing/quota is not active.
- Select Gemini API
- Paste your key
- Send a prompt
If you get RESOURCE_EXHAUSTED, free-tier quota is exhausted.
Install Ollama and start service:
ollama servePull a model:
ollama pull llama3.1:8bSelect Ollama (Local) in app
No API key required.
Check:
- You are inside
codefolder python app.pyis running- Port 3000 is free
source .venv/bin/activate
pip install certifiRestart the app.
ollama serve
ollama pull llama3.1:8bRetry in Chat tab.
source .venv/bin/activate
which pythonExpected:
.venv/bin/python
Stop server:
Ctrl + CRestart:
source .venv/bin/activate
cd code
python app.pyStart exploring and experimenting 🚀