From e14d2c62da611bd6ef4a244b816cb2f16c95e8d9 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 Jun 2026 13:02:34 +0000 Subject: [PATCH] fix: use venv for sidecar deps, add missing deploy steps - llm-sidecar.service: use /home/bigt/AI/llm/venv/bin/uvicorn instead of global python3 -m uvicorn (avoids 'No module named uvicorn' error) - deploy/README.md: add steps to copy sidecar/ package, create venv, and pip install requirements.txt --- deploy/README.md | 18 ++++++++++++++---- deploy/llm-sidecar.service | 6 +++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/deploy/README.md b/deploy/README.md index 7207e58..83cea2a 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -8,22 +8,32 @@ On the Main PC: # 1. Copy the service file sudo cp deploy/llm-sidecar.service /etc/systemd/system/ -# 2. Copy the manifest (adjust paths as needed) +# 2. Create the working directory and copy files mkdir -p /home/bigt/AI/llm cp deploy/manifest.yaml /home/bigt/AI/llm/manifest.yaml -# 3. Create a .env for the sidecar (optional) +# Copy the sidecar Python package (app.py + manifest.py) +cp -r sidecar/ /home/bigt/AI/llm/sidecar/ + +# Copy requirements.txt for the venv +cp requirements.txt /home/bigt/AI/llm/ + +# 3. Create a Python virtual environment with dependencies +python3 -m venv /home/bigt/AI/llm/venv +/home/bigt/AI/llm/venv/bin/pip install -r /home/bigt/AI/llm/requirements.txt + +# 4. Create a .env for the sidecar (optional) cat > /home/bigt/AI/llm/.env << 'EOF' # Sidecar configuration MANIFEST_PATH=/home/bigt/AI/llm/manifest.yaml SIDECAR_PORT=8081 EOF -# 4. Enable and start the service +# 5. Enable and start the service sudo systemctl daemon-reload sudo systemctl enable --now llm-sidecar -# 5. Verify it's running +# 6. Verify it's running sudo systemctl status llm-sidecar ``` diff --git a/deploy/llm-sidecar.service b/deploy/llm-sidecar.service index 4918336..c121ede 100644 --- a/deploy/llm-sidecar.service +++ b/deploy/llm-sidecar.service @@ -11,10 +11,10 @@ WorkingDirectory=/home/bigt/AI/llm EnvironmentFile=-/home/bigt/AI/llm/.env Environment=MANIFEST_PATH=/home/bigt/AI/llm/manifest.yaml Environment=SIDECAR_PORT=8081 -Environment=PATH=/usr/local/bin:/usr/bin:/bin +Environment=PATH=/home/bigt/AI/llm/venv/bin:/usr/local/bin:/usr/bin:/bin -# Executable — adjust path as needed -ExecStart=/usr/bin/python3 -m uvicorn sidecar.app:app --host 0.0.0.0 --port 8081 +# Use the sidecar's venv — install deps via deploy/README.md +ExecStart=/home/bigt/AI/llm/venv/bin/uvicorn sidecar.app:app --host 0.0.0.0 --port 8081 Restart=always RestartSec=3