Skip to content

jdeepak1218/FinESG-Repo

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ESG Reporter 🌱

AI-powered ESG (Environmental, Social, Governance) analysis and reporting platform using a fine-tuned language model.

Tech Stack React TypeScript Python

πŸ‘₯ Team

This project was developed by:

πŸ“„ Research Paper & Documentation

πŸ“‘ Read our research paper β†’

AI-Powered ESG Analysis using Fine-Tuned Language Models

Presentations

Demo Video

πŸŽ₯ Watch Project Demo β†’

✨ Features

  • πŸ€– 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

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • LM Studio (for AI model serving)
  • Git

1. Clone Repository

git clone <repository-url>
cd ai_backend

2. Backend Setup

# Install Python dependencies
pip install -r requirements.txt

# Run backend server
python main.py

Backend will start on http://localhost:8080

3. Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

Frontend will start on http://localhost:5173

4. LM Studio Setup & fingesg4 Model

Option A: Quick Start (Use Base Model)

  1. Download & Install LM Studio
  2. Download Model: Search for "Qwen 2.5-1.5B-Instruct" in LM Studio
  3. Load Model in Chat tab
  4. Start Local Server on port 1234

Option B: Use Fine-Tuned ESG Model (Recommended)

Step 1: Download fingesg4 Model

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.

Step 2: Import to LM Studio (CRITICAL: Folder Structure)**

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

  1. Restart LM Studio completely (close and reopen)
  2. Go to "My Models" tab - you should now see fingesg4
  3. Click "Chat" tab β†’ Select fingesg4 from dropdown
  4. Go to "Local Server" tab β†’ Click "Start Server" (port 1234)
  5. 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

πŸ“‹ Tech Stack

Frontend

  • React 18 + TypeScript
  • Vite - Build tool
  • Tailwind CSS - Styling
  • shadcn/ui - Component library

Backend

  • FastAPI - Web framework
  • SQLAlchemy - ORM
  • SQLite - Database
  • Pydantic - Validation

AI/ML

  • LM Studio - Model serving
  • fingesg4 - ESG-specialized model
  • Qwen 2.5-1.5B - Base model

See TECH_STACK.md for complete details.

πŸ“ Project Structure

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

πŸ”§ Configuration

Environment Variables (Optional)

Create .env file in root:

SECRET_KEY=your-secret-key-here
DATABASE_URL=sqlite:///./ai_backend.db

Default Credentials (Demo Mode)

πŸ“Š Performance

Metric Value
Inference Speed 150+ tokens/sec
Response Time 2-3 seconds
Memory Usage ~2GB VRAM
Model Size 900MB (quantized)

🎯 Use Cases

  • ESG report analysis
  • Sustainability reporting
  • Financial document review
  • Compliance checking
  • Corporate governance analysis

πŸ›‘οΈ Security

  • JWT token authentication
  • HTTPOnly cookies
  • Password hashing (bcrypt)
  • Parameterized SQL queries
  • CORS configuration

πŸ“ API Documentation

Once the backend is running, visit:

🀝 Contributing

Contributions welcome! Please follow these steps:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

Acknowledgments

  • Qwen Team - Base language model
  • LM Studio - Optimized inference engine
  • FastAPI - Modern Python web framework
  • shadcn/ui - Beautiful component library

πŸ“§ Contact

For questions or support, please open an issue on GitHub.


Built with ❀️ for ESG Analysis

Making sustainability reporting accessible and efficient

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 75.7%
  • JavaScript 12.0%
  • Python 8.5%
  • CSS 3.4%
  • HTML 0.4%