Skip to content

Latest commit

 

History

History
226 lines (141 loc) · 2.47 KB

File metadata and controls

226 lines (141 loc) · 2.47 KB

GNLSELab Setup Guide

A clean and simple guide to get GNLSELab running locally.


📦 Requirements

Make sure you have the following:

  • 🖥️ macOS or Linux terminal
  • 🐍 Python 3.10+
  • 📦 pip
  • 🌐 Internet connection

🤖 Optional (for AI Chat)

  • OpenAI API key
  • Gemini API key
  • OR 🧠 Ollama (local models)

📁 Open Project Folder

Navigate to the project directory:

ls

You should see:

code/
requirements.txt
README.md

🧪 Create Virtual Environment

Create a virtual environment (first-time setup):

python3 -m venv .venv

Activate it:

source .venv/bin/activate

You should now see:

(.venv)

📥 Install Dependencies

Upgrade pip and install required packages:

pip install --upgrade pip
pip install -r requirements.txt

🔐 Optional Fix (SSL Issues)

pip install certifi

▶️ Run the Application

cd code
python app.py

Open your browser:

http://localhost:3000

You should see Flask running on port 3000.


✅ Basic Usage Check

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

🤖 AI Chat Setup (Optional)

Go to the Chat tab and select a provider.


ChatGPT API

  • Select ChatGPT API
  • Paste your OpenAI API key
  • Send a prompt

If you get insufficient_quota, billing/quota is not active.


Gemini API

  • Select Gemini API
  • Paste your key
  • Send a prompt

If you get RESOURCE_EXHAUSTED, free-tier quota is exhausted.


Ollama (Local AI)

Install Ollama and start service:

ollama serve

Pull a model:

ollama pull llama3.1:8b

Select Ollama (Local) in app

No API key required.


🛠️ Common Issues & Fixes

App Not Opening

Check:

  • You are inside code folder
  • python app.py is running
  • Port 3000 is free

SSL Certificate Error

source .venv/bin/activate
pip install certifi

Restart the app.


Ollama Models Not Found

ollama serve
ollama pull llama3.1:8b

Retry in Chat tab.


Wrong Python Environment

source .venv/bin/activate
which python

Expected:

.venv/bin/python

🔄 Stop & Restart

Stop server:

Ctrl + C

Restart:

source .venv/bin/activate
cd code
python app.py

🎯 You're Ready!

Start exploring and experimenting 🚀