vikesh99/ai-file-converter
0
๐ค AI File Converter
A ChatGPT-like file conversion web app that runs 100% locally. Upload a file, describe what you want in plain English, and download the converted result.
Privacy-first: No files are ever sent to any external API or cloud service.
โจ Features
- ๐ง AI intent detection โ TinyLlama via Ollama understands natural language commands
- ๐ Multi-format support โ PDF, DOCX, PPTX, XLSX, TXT, CSV, ODT, RTF
- ๐ 100% local โ runs entirely on your machine
- ๐ฌ Chat UI โ ChatGPT-like interface with drag & drop upload
- ๐งน Auto cleanup โ uploaded and converted files deleted after download
๐ฆ Supported Conversions
โ๏ธ System Requirements
๐ Quick Start
1. Create & activate virtual environment
cd ai-file-converter
python -m venv venv
venv\Scripts\activate2. Install Python dependencies
pip install -r backend/requirements.txt3. Start Ollama (if not already running)
ollama serve4. Start the FastAPI backend
cd backend
uvicorn main:app --reload --host 0.0.0.0 --port 80005. Open the frontend
Open frontend/index.html in your browser, or serve it:
cd frontend
python -m http.server 3000
# Then open http://localhost:3000๐๏ธ Project Structure
ai-file-converter/
โโโ backend/
โ โโโ main.py # FastAPI app (endpoints)
โ โโโ intent_detector.py # TinyLlama + rule-based intent parser
โ โโโ converter.py # Conversion routing engine
โ โโโ utils.py # File helpers
โ โโโ requirements.txt
โโโ frontend/
โ โโโ index.html # Chat UI
โ โโโ app.js # Frontend logic
โ โโโ style.css # Premium dark styling
โโโ uploads/ # Temp (auto-cleaned)
โโโ outputs/ # Temp (auto-cleaned)
โโโ .env # Config (paths, limits)
โโโ .gitignore๐ฌ Example Commands
โ ๏ธ Known Limitations
- PDF โ PPTX may lose complex formatting
- Scanned PDFs (image-only) cannot be converted to TXT (no OCR)
- LibreOffice conversions may take 2โ5 seconds
๐ Privacy
- No files sent to external APIs (unless configured to use cloud LLMs)
- All processing is local
- Files auto-deleted after each conversion
- No file contents are logged
โ๏ธ Production Hosting (Under 1 GB)
To host this application publicly on cloud platforms (e.g., Render, Railway, DigitalOcean, AWS) with a minimal storage footprint:
- Enable Cloud LLM API (Reduces size by 600MB+ & RAM by 1GB+) Add your API key to the environment variables (
.envfile or cloud dashboard): GEMINI_API_KEY: Get a free key from Google AI Studio.GROQ_API_KEY: Get a free key from Groq Console.
If either key is set, the backend will bypass the local Ollama process and use the cloud API for extremely fast (0.1s) and free intent detection.
- Docker Deployment Use the included
Dockerfileto build and deploy the container. It is optimized to install only headless, GUI-less packages for LibreOffice and Pandoc, keeping the image size around ~500 MB total.
To run locally or build using Docker:
docker build -t ai-file-converter .
docker run -p 8000:8000 --env GEMINI_API_KEY="your_api_key" ai-file-converterBuilt with FastAPI ยท TinyLlama/Gemini ยท LibreOffice ยท Pandoc ยท pdf2docx
