A simple, privacy‑friendly chatbot UI built with Streamlit and powered by Ollama for local LLM inference.
- Multi‑chat sessions: create, switch, rename, and delete conversations.
- Per‑chat system prompt: customize the assistant’s behavior for each chat.
- Streaming responses: see answers appear in real time.
- Temperature & Max tokens controls: fine‑tune generation.
- Local storage: chats are saved as JSON files in
./chats/.
- Python 3.9+
- https://ollama.ai installed and running locally
- Streamlit and Requests libraries
-
Install dependencies
pip install streamlit requests
-
Start Ollama and pull a model
ollama serve ollama pull llama3.2
-
Run the app
streamlit run app.py
Chats are stored in ./chats/<chat_id>.json with this structure:
{
"name": "Chat 1",
"created_at": "2025-11-07T15:42:10",
"model": "llama3.2",
"system_prompt": "You are a helpful AI assistant.",
"messages": [
{ "role": "user", "content": "Hello" },
{ "role": "assistant", "content": "Hi! How can I help?" }
]
}Edit app.py to change:
OLLAMA_CHAT_API: Ollama API endpoint (default:http://localhost:11434/api/chat)MODEL_NAME: default model nameSAVE_DIR: folder for chat files- Logo path and size
- Frontend: Streamlit
- Backend: Ollama local LLM
- Storage: JSON files