Skip to content

malgorath/chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatbot – Ollama-backed Web UI

A lightweight chat interface built with Python/Flask that connects to a locally-running Ollama server. Inspired by Open WebUI — models are configured via JSON files and selected from the sidebar at runtime.

Features

  • Multi-model support — add or swap models by dropping a .cfg file into models/, no code changes needed
  • Clean chat UI — dark-themed interface with a sidebar model selector
  • Fully local — all inference runs through your own Ollama server, nothing leaves your machine
  • Tested — full pytest suite covering config loading, the Ollama client, and all API routes

Tech Stack

Layer Technology
Backend Python / Flask
LLM Integration Ollama (/api/chat)
Frontend HTML5, CSS3, JavaScript
Tests pytest, pytest-cov

Requirements

  • Python 3.10+
  • Ollama running locally with at least one model pulled
  • pip install -r requirements.txt

Setup

git clone https://github.com/malgorath/chatbot.git
cd chatbot
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Edit models/*.cfg to point to your Ollama host and preferred model. The default config targets http://192.168.1.3:11434 with llama3.2:3b.

Running

python app.py

Open http://localhost:5000 — select a model from the sidebar and start chatting.

Tests

pytest
pytest --cov=.   # with coverage

Architecture

app.py                  # Flask routes (GET /, GET /api/models, POST /api/chat)
ollama_client.py        # Ollama API wrapper with error handling
models_config.py        # Parses models/*.cfg into typed ModelConfig objects
templates/chat.html     # Chat UI template
static/css/chat.css     # Styles
static/js/chat.js       # Frontend behaviour

License

MIT

About

Real-time broadcast chat system built with Flask, Socket.IO, and jQuery — supports multi-client live messaging.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors