LLM_Inferenz_Server_1/08_start_openwebui_background.sh
herzogflorian f4fdaab732 Add Open WebUI integration and enhance Streamlit app
- Add Open WebUI scripts (06-09) for server-hosted ChatGPT-like interface
  connected to the vLLM backend on port 7081
- Add context window management to chat (auto-trim, token counter, progress bar)
- Add terminal output panel to file editor for running Python/LaTeX files
- Update README with Open WebUI setup, architecture diagram, and troubleshooting
- Update STUDENT_GUIDE with step-by-step Open WebUI login instructions

Made-with: Cursor
2026-03-02 18:48:51 +01:00

53 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# ------------------------------------------------------------------
# 08_start_openwebui_background.sh
# Launches Open WebUI in the background with logging.
#
# Usage:
# bash 08_start_openwebui_background.sh
#
# Logs are written to: ./logs/openwebui_<timestamp>.log
# PID is written to: ./logs/openwebui.pid
# ------------------------------------------------------------------
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LOG_DIR="${SCRIPT_DIR}/logs"
mkdir -p "$LOG_DIR"
TIMESTAMP="$(date +%Y%m%d_%H%M%S)"
LOG_FILE="${LOG_DIR}/openwebui_${TIMESTAMP}.log"
PID_FILE="${LOG_DIR}/openwebui.pid"
if [ -f "$PID_FILE" ]; then
OLD_PID=$(cat "$PID_FILE")
if kill -0 "$OLD_PID" 2>/dev/null; then
echo "Open WebUI already running with PID ${OLD_PID}"
echo "Stop it first: bash 09_stop_openwebui.sh"
exit 1
fi
fi
echo "Starting Open WebUI in background..."
echo "Log file: ${LOG_FILE}"
nohup bash "${SCRIPT_DIR}/07_start_openwebui.sh" > "$LOG_FILE" 2>&1 &
SERVER_PID=$!
echo "$SERVER_PID" > "$PID_FILE"
echo "Open WebUI PID: ${SERVER_PID}"
echo ""
echo "Monitor logs: tail -f ${LOG_FILE}"
echo "Stop: bash 09_stop_openwebui.sh"
echo ""
sleep 5
if kill -0 "$SERVER_PID" 2>/dev/null; then
echo "Open WebUI process is running. Starting up..."
echo "(Ready when you see 'Uvicorn running' in the logs)"
else
echo "ERROR: Open WebUI process exited. Check logs:"
tail -20 "$LOG_FILE"
exit 1
fi