Skip to content
ADITYA02NMPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ECHO-PI: Offline Emergency & Education Assistant

ECHO-PI is a comprehensive offline assistant designed for emergency situations and educational support in connectivity-deprived areas. It features an offline English-to-Kannada translator, an AI chat assistant powered by Ollama Llama 3.2, SOS emergency alerts, offline Wikipedia, and admin dashboard.

Features

  • Offline Translator: English to Kannada using Helsinki-NLP/opus-mt-en-dra model
  • AI Chat Assistant: Powered by Ollama Llama 3.2 (fully offline)
  • SOS Emergency Alert: Trigger alerts from the app, viewable in admin panel
  • Offline Wikipedia: Built-in Wikipedia server via Kiwix
  • Admin Dashboard: View SOS stats and history
  • Dynamic IP Support: Works across all devices on local network

Prerequisites

  • Node.js (v18+)
  • Python 3.8+
  • Ollama installed with llama3.2:3b model
  • Kiwix-serve (for offline Wikipedia)

Installation

1. Clone & Setup

git clone https://github.com/ADITYA02NM/ECHO-PI.git
cd ECHO-PI
npm install

2. Backend Dependencies

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install Python dependencies
pip install flask flask-cors transformers torch sacremoses
pip install requests

3. Download Translation Model

# This requires internet for initial download only
python -c "from offline_translator.translator import OfflineTranslator; OfflineTranslator(model_path='./model')"

4. Install Ollama

# Install Ollama (if not already installed)
curl -fsSL https://ollama.com/install.sh | sh

# Pull the Llama 3.2 3B model
ollama pull llama3.2:3b

5. Setup Offline Wikipedia

# Download Wikipedia ZIM file from kiwix.org
# Place it at: /home/aditya/kiwix/wikipedia_en_100_2026-01.zim

Running the Application

Terminal 1 - Backend (Port 5001)

./venv/bin/python server.py

This starts:

  • Flask API server (port 5001)
  • Kiwix Wikipedia server (port 5002)
  • Ollama chat integration

Terminal 2 - Frontend (Port 8080)

npm run dev

Services & Ports

Service Port URL
Frontend 8080 http://localhost:8080
Backend API 5001 http://localhost:5001
Wikipedia 5002 http://localhost:5002
Ollama 11434 http://localhost:11434

API Endpoints

Endpoint Method Description
/health GET Server health check
/translate POST Translate English→Kannada
/chat POST AI chat with Llama 3.2
/sos/alert POST Trigger SOS alert
/admin/stats GET Get SOS statistics
/admin/sos/history GET Get SOS alert history
/wikipedia/url GET Get Wikipedia URL

Project Structure

ECHO-PI/
├── server.py           # Flask backend (API, Kiwix, Ollama)
├── venv/              # Python virtual environment
├── model/             # Translation model files
├── offline_translator/# Translator module
├── src/               # React frontend
│   ├── pages/        # App pages
│   ├── components/   # UI components
│   └── lib/          # Utilities
├── package.json       # Frontend dependencies
└── README.md         # This file

Troubleshooting

Ollama not responding

# Start Ollama manually
ollama serve

# Check installed models
ollama list

Translation model not loading

# Re-download the model
python -c "from offline_translator.translator import OfflineTranslator; OfflineTranslator(model_path='./model')"

Memory issues with Llama 3.2:3b

  • Requires ~2.3GB RAM
  • Close other applications to free memory
  • Or use smaller model: ollama pull llama3.2:1b and update OLLAMA_MODEL in server.py

Network Access

All services run on 0.0.0.0 (all interfaces), so they are accessible from:

  • localhost
  • 127.0.0.1
  • Your local IP (e.g., http://192.168.x.x:8080)

This allows other devices on the same network to access the app.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages