How spacedust10/finance-analyser-using-local-llms works
Project type and purpose
• This is a single-machine, data-driven analytics tool with a GUI (Streamlit app) for on-device personal financial analysis.
• It ingests user CSVs, processes and classifies transactions via a local LLM (Ollama’s Llama3.1), computes metrics, and renders interactive visualizations, all without any external cloud dependency.
File structure
• Top-level Python modules:
• app.py → the Streamlit entrypoint (UI layer)
• file_processor.py → CSV ingestion & cleaning
• transaction_classifier.py → LLM invocation & category assignment
• financial_metrics.py → calculation of income/expense/saving rates
• visualization.py → chart building (Plotly/Streamlit)
• finance_dashboard.py → UI layout & components orchestration
• requirements.txt holds your Python/LLM/visualization dependencies.
• No separate “backend” or “frontend” folders—this is a single-runtime application.
Key README insights
• Local LLM integration: all inference via Ollama API, model pulled on-device
• Streamlit GUI: handles file upload, real-time display, user interactions
a. Main components
1. Streamlit UI (app.py + finance_dashboard.py)
2. File Processor (file_processor.py)
3. LLM Classification Service (transaction_classifier.py calls Ollama Llama3.1)
4. Metrics Engine (financial_metrics.py)
5. Visualization Module (visualization.py + Plotly)
6. Local Data Store (in-memory DataFrame objects; optionally temp CSV)
b. Relationships & data flow
• User uploads CSV → Streamlit UI passes file to File Processor
• File Processor emits cleaned DataFrame → handed to Classification Service
• Classification Service labels transactions → enriched DataFrame
• Enriched data flows into Metrics Engine → computes aggregates/trends
• Results passed to Visualization Module → charts rendered back in UI
• Throughout, Local Data Store persists intermediate datasets in memory
c. Architectural patterns & design principles
• Pipeline pattern: sequential transformation steps
• Single-process modular design: clear separation of concerns by Python module
• On-device compute & privacy-by-design (no external data transfer)
d. Key technologies/frameworks
• Streamlit for UI & user interaction
• Pandas for in-memory data manipulation
• Ollama LLM API (llama3.1) for transaction classification
• Plotly for interactive visualizations
Detail
• Functions or classes inside each module if space allows
• Optional: add usage scenario notes (e.g., “Step 2: LLM categorization may take 2–3s per 1000 rows”)