AI-powered ESG (Environmental, Social, Governance) analysis and reporting platform using a fine-tuned language model.
This project was developed by:
AI-Powered ESG Analysis using Fine-Tuned Language Models
- 🤖 AI-Powered Analysis - ESG-specialized language model (fingesg4)
- 📄 PDF Upload - Analyze annual reports and financial documents
- 💬 Chat Interface - Multi-turn conversations with context awareness
- 🔐 Secure Authentication - JWT-based login with demo mode
- 💾 Persistent Storage - SQLite database for conversation history
- ⚡ Fast Inference - 150+ tokens/sec using LM Studio
- Python 3.10+
- Node.js 18+
- LM Studio (for AI model serving)
- Git
git clone <repository-url>
cd ai_backend# Install Python dependencies
pip install -r requirements.txt
# Run backend server
python main.pyBackend will start on http://localhost:8080
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend will start on http://localhost:5173
- Download & Install LM Studio
- Download Model: Search for "Qwen 2.5-1.5B-Instruct" in LM Studio
- Load Model in Chat tab
- Start Local Server on port 1234
Download our pre-converted GGUF model:
📥 Download fingesg4.gguf from Google Drive (~3.1GB)
Note: This is our custom ESG-specialized model, fine-tuned on financial and sustainability reporting data.
LM Studio requires a double-nested folder structure:
C:\Users\<YourName>\.lmstudio\models\
└── fingesg4\ # Parent folder
└── fingesg4\ # Child folder (same name!)
└── fingesg4.gguf # Your model file
Manual Setup:
# Navigate to LM Studio models directory
cd "C:\Users\<YourName>\.lmstudio\models"
# Create parent folder
mkdir fingesg4
# Create child folder (same name)
mkdir fingesg4\fingesg4
# Copy your GGUF file into the nested folder
copy "C:\path\to\llama.cpp\fingesg4.gguf" "fingesg4\fingesg4\fingesg4.gguf"Step 3: Load in LM Studio
- Restart LM Studio completely (close and reopen)
- Go to "My Models" tab - you should now see
fingesg4 - Click "Chat" tab → Select
fingesg4from dropdown - Go to "Local Server" tab → Click "Start Server" (port 1234)
- Verify: Status should show "Running" with model name
fingesg4
Troubleshooting: If model doesn't appear, verify the folder structure is exactly:
models\fingesg4\fingesg4\fingesg4.gguf
- React 18 + TypeScript
- Vite - Build tool
- Tailwind CSS - Styling
- shadcn/ui - Component library
- FastAPI - Web framework
- SQLAlchemy - ORM
- SQLite - Database
- Pydantic - Validation
- LM Studio - Model serving
- fingesg4 - ESG-specialized model
- Qwen 2.5-1.5B - Base model
See TECH_STACK.md for complete details.
ai_backend/
├── app/ # Backend (FastAPI)
│ ├── api.py # API routes
│ ├── models.py # Database models
│ ├── schemas.py # Pydantic schemas
│ ├── crud.py # Database operations
│ ├── auth.py # Authentication
│ └── ml_engine_lmstudio.py # LM Studio integration
├── frontend/ # Frontend (React)
│ ├── src/
│ │ ├── components/ # React components
│ │ └── contexts/ # State management
│ └── package.json
├── main.py # Backend entry point
├── requirements.txt # Python dependencies
└── README.md
Create .env file in root:
SECRET_KEY=your-secret-key-here
DATABASE_URL=sqlite:///./ai_backend.db- Email: demo@example.com
- Password: demo123
| Metric | Value |
|---|---|
| Inference Speed | 150+ tokens/sec |
| Response Time | 2-3 seconds |
| Memory Usage | ~2GB VRAM |
| Model Size | 900MB (quantized) |
- ESG report analysis
- Sustainability reporting
- Financial document review
- Compliance checking
- Corporate governance analysis
- JWT token authentication
- HTTPOnly cookies
- Password hashing (bcrypt)
- Parameterized SQL queries
- CORS configuration
Once the backend is running, visit:
- Swagger UI: http://localhost:8080/docs
- ReDoc: http://localhost:8080/redoc
Contributions welcome! Please follow these steps:
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
- Qwen Team - Base language model
- LM Studio - Optimized inference engine
- FastAPI - Modern Python web framework
- shadcn/ui - Beautiful component library
For questions or support, please open an issue on GitHub.
Built with ❤️ for ESG Analysis
Making sustainability reporting accessible and efficient