This is the backend service for Thread AI - Smart Email Reply Generator.
It acts as a unified LLM router to handle multiple AI providers (OpenAI, Gemini, and Ollama) and generate context-aware, high-quality email replies.
- Multi-LLM Support – OpenAI, Gemini, and Ollama in one place.
- Dynamic Provider Selection – Switch AI providers via API.
- Prompt Engineering – Centralized and optimized prompts for better responses.
- FastAPI Backend – Lightweight and high-performance.
- Easy Deployment – Works locally or on cloud.
├── llm_router.py # Routes requests to the correct LLM provider
├── main.py # FastAPI app entry point
├── prompt.py # Contains the system & user prompt templates
├── providers/
│ ├── gemini_provider.py # Google Gemini integration
│ ├── ollama_provider.py # Ollama local LLM integration
│ └── openai_provider.py # OpenAI API integration
├── requirements.txt # Python dependencies
git clone https://github.com/ashankgupta/threadwise-ai-backend.git
cd thread-ai-backend
python -m venv venv
source venv/bin/activate # For Linux/Mac
venv\Scripts\activate # For Windows
pip install -r requirements.txt
uvicorn main:app --reload
Server will start at:
http://127.0.0.1:8000
Method Endpoint Description
POST /generate Generate an AI email reply
GET /providers List available AI providers
POST /switch Switch active AI provider
This project is licensed under the MIT License.