Run AI features on-premise with a local LLM. Your financial data never leaves your server.
Financial data is sensitive. Using a local model means invoice content, GSTIN, and ledger data never goes to an external API. Suitable for CA firms, government clients, and privacy-first businesses.
Best for invoice extraction + coding on CPU/low RAM. Runs on 4GB RAM.
ollama pull llama3.2
Better reasoning for complex queries. Needs 8GB+ RAM.
ollama pull llama3.1
Excellent at structured output (JSON extraction). Good for invoice parsing.
ollama pull mistral
Strong math reasoning — useful for reconciliation tasks.
ollama pull deepseek-r1
# Linux / Ubuntu (VPS / Hostinger Cloud)
curl -fsSL https://ollama.com/install.sh | sh
# Verify installation
ollama --version
# Pull recommended model for Lekhya
ollama pull llama3.2
# Start Ollama service (or it auto-starts)
ollama serve
# Default API: http://localhost:11434
# In lekhya-app/.env
AI_DRIVER=ollama
AI_ENDPOINT=http://localhost:11434/api/generate
AI_MODEL=llama3.2
AI_MAX_TOKENS=2048
AI_TEMPERATURE=0.1
# For cloud providers (fallback)
# AI_DRIVER=anthropic
# ANTHROPIC_API_KEY=sk-ant-...
# AI_MODEL=claude-haiku-4-5-20251001
Lekhya uses a single AiProvider interface. Switch models by changing .env — no code changes.
# Install Tesseract OCR (Ubuntu)
sudo apt-get install tesseract-ocr tesseract-ocr-hin
# Install PHP wrapper
composer require thiagoalessio/tesseract_ocr
# For PDF to image conversion
sudo apt-get install ghostscript imagemagick
composer require spatie/pdf-to-image
AI_USE_VISION=true
| Setup | RAM | CPU/GPU | Model | Best For |
|---|---|---|---|---|
| Minimal | 4GB | Any modern CPU | Llama 3.2 3B | Basic extraction, small volumes |
| Recommended | 16GB | CPU or GPU | Llama 3.1 8B | Production use, faster responses |
| High Volume | 32GB+ | GPU (NVIDIA) | Llama 3.1 70B | CA firms, bulk processing |
AI analyzes your AR/AP aging, seasonal patterns → predicts cash position 30/60/90 days out. View in Dashboard → AI Insights.
AI monitors monthly vendor payments for outliers. "Transport costs 3x this month" → flagged for review.
AI predicts how much GST is due based on current-month postings. Alert before due date.
AI spots ITC that's about to expire (2-year limit) and flags invoices to claim before cutoff.