How aitrekker/ollama works
Project type and purpose
• This is a hands-on demo/tutorial combining a lightweight “full-stack” web UI (HTML/JS) with a local LLM service (Ollama) and a Python CLI summarization tool.
• Purpose: show how to run and compare local LLMs in the browser and in scripts (summarization of CSV data).
File structure
• Top-level files:
• single-llm.html – browser UI for querying one model
• multiple-llm.html – browser UI for side-by-side comparison of models
• summarize.py – Python script that reads sample.csv, sends prompts to local LLM, writes themes/summaries to output.csv
• sample.csv – sample dataset for summarization
• No traditional backend code: the “backend” is the Ollama daemon (local LLM API service) that both the browser UIs and Python script call.
• Configuration files: .gitignore, README.md.
README for additional insights
• The README describes exercises: running models with ollama run, spinning up a local web server to serve HTML, and invoking python summarize.py sample.csv.
• Technical stack: HTML/JavaScript front end, local Ollama LLM server, Python 3.10+ script for CLI usage.
Main components and interactions
a. Components
• Browser UI (single-llm.html, multiple-llm.html)
• Local Ollama API server (runs on localhost, hosts one or more LLMs)
• Python summarization script (summarize.py)
• Data storage (sample.csv input, output.csv result)
b. Interactions
• Browser → HTTP requests → Ollama API → JSON responses → render in UI
• summarize.py → invites user CSV path → Python HTTP/CLI call → Ollama API → receives response → writes output.csv
c. Architectural patterns
• Client–Server separation: static UI served by a file server; compute served by local daemon
• Micro-services style (two clients share one service)
• Script-driven batch processing for data summarization
d. Key technologies
• HTML, JavaScript (fetch API)
• Ollama local LLM service and model binaries
• Python 3.10+, csv module, requests or subprocess for API calls