2.8 KiB
Deployment Instructions
This document provides instructions for deploying the chatbot application with Ollama and OpenWebUI integration.
Prerequisites
- Python 3.8 or higher
- pip
- virtualenv or venv
- Access to OpenWebUI at http://104.225.217.215:8080
Deployment Steps
-
Clone the repository
git clone <repository-url> cd <repository-directory> -
Create and activate a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies
pip install -r requirements.txt pip install python-dotenv langchain-text-splitters -
Create a .env file
Copy the .env.example file to .env and update the values:
cp ai_service/.env.example ai_service/.env # Edit the .env file with appropriate valuesMake sure to include the OpenWebUI configuration:
# OpenWebUI configuration OPENWEBUI_URL=http://104.225.217.215:8080 OPENWEBUI_API_KEY=GdCU4ieYDqHsLfH2 # Ollama configuration OLLAMA_API_URL=http://104.225.217.215:8080/ollama DEFAULT_MODEL=llama3.1 -
Run the deployment script
For local deployment:
python -m ai_service.runFor server deployment:
./ai_service/deploy.shThis will start the application on port 5251 using uvicorn with nohup.
For remote deployment from your local machine:
./remote_deploy.sh 157.157.221.29 user 22 /home/user/ds_zagres_ai -
Verify the application is running
curl http://localhost:5251/api/healthYou should see a response like:
{ "status": "healthy" }
Managing the Deployed Application
-
View logs
tail -f app.log -
Stop the application
ps aux | grep uvicorn # Find the process ID (PID) kill <PID> # Replace <PID> with the actual process ID -
Restart the application
./deploy.sh
API Endpoints
GET /health- Health check endpointPOST /chats- Create a new chatPOST /chats/{chat_id}/messages- Send a message to the chatbotGET /chats/{chat_id}- Get chat history
Ollama and OpenWebUI Integration
The chatbot now uses Ollama models via OpenWebUI. The following models are available:
- gemma3: Google Gemma 3 model
- llama3.3: Meta Llama 3 70B model
- llama3.1: Meta Llama 3 8B model
- mistral: Mistral AI model
- deepseek: DeepSeek model
Document Training
To use RAG with your documents:
- Go to the OpenWebUI interface at http://104.225.217.215:8080/
- Navigate to the Knowledge section
- Upload your documents
- OpenWebUI will automatically process them for RAG
When using the chatbot API, set use_rag=True in your chat requests to enable RAG.