File size: 1,337 Bytes
5eb5327
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# ChatAI Streamlit App (with Admin, OpenAI & Ollama)

A Streamlit app that provides:
- Rounded chat interface with **+** button to upload **files** or **images**
- Supports **OpenAI** and **Ollama** providers
- **Admin** role can manage user accounts
- Conversation history (SQLite)
- Export chat to Markdown

## Quickstart

1) **Create a virtual environment (recommended)**  
   ```bash
   python -m venv .venv
   source .venv/bin/activate  # On Windows: .venv\Scripts\activate
   ```

2) **Install dependencies**  
   ```bash
   pip install -r requirements.txt
   ```

3) **Run the app**  
   ```bash
   streamlit run app.py
   ```

4) **Login**  
   On first run, a default admin account is created:  
   - **username**: `admin`  
   - **password**: `admin123`  
   👉 Immediately change this in **Admin > Users**.

## Providers

- **OpenAI**: Set your key in the sidebar **(OpenAI API Key)** or via env var `OPENAI_API_KEY`.
- **Ollama**: Make sure Ollama is running locally (default endpoint `http://localhost:11434`).  
  You can change endpoint in the sidebar.

## Notes

- This is a reference implementation for local use. For production:
  - Use a proper auth service (e.g., OAuth), secure key storage (e.g., Vault/KMS)
  - Harden the admin endpoints and network access
  - Add request limits, logging, and encryption-at-rest