ollama --> flask app --> front end
runs models serves the chatbot interface
front end and
communicates with Ollama
API
This project has two versions: Docker and non-Docker.
- if needed create virtual env:
python3 -m venv venv- & activate it:
source venv/bin/activate - & install dependencies:
pip install -r requirements.txt
- & activate it:
- start ollama manually then make sure it is running:
ollama --version - navigate to main folder:
cd main - run app.py:
python3 app.py - web app should be running on:
localhost:5000
- navigate to Docker folder:
cd Docker - build image:
docker build -t chatbot . - run container:
docker run -p 11434:11434 --name chatbot chatbot - web app should be running on
localhost:5000 - interact with container (optional):
docker exec -it ollama bash - Note: this does not install any models, they must be manually installed after build!
- Install a model: (within the container shell)
ollama pull <model> - find a list of models at `https://ollama.com/models'
- Install a model: (within the container shell)
- Functional chatbot interface built with Flask and Js powered by Ollama
todo:
- dont touch the ui its perfect
- UPDATE README with node module installation, right now node_modules are included in the repo
installed moduules:
- marked
- bootstrap css
cmd curl command to prompt ollama api:
curl http://localhost:11434/api/generate -d "{ \"model\": \"gemma:4b-it-qat\", \"prompt\": \"Hello there\"}" -H "Content-Type: application/json"