fix: change sidecar port from 8081 to 8080
The sidecar is deployed on port 8080 instead of 8081. Update all: - Default SIDECAR_PORT in sidecar/app.py - Default SIDECAR_URL in main.py (router) - deploy/llm-sidecar.service Environment - deploy/README.md (.env example + config table) - All 7 test files (conftest, circuit-breaker, fallback, queue, model-detection, sse-progress, v1-models)
This commit is contained in:
parent
b7079fa199
commit
45417068ae
@ -26,7 +26,7 @@ python3 -m venv /home/bigt/AI/llm/venv
|
||||
cat > /home/bigt/AI/llm/.env << 'EOF'
|
||||
# Sidecar configuration
|
||||
MANIFEST_PATH=/home/bigt/AI/llm/manifest.yaml
|
||||
SIDECAR_PORT=8081
|
||||
SIDECAR_PORT=8080
|
||||
EOF
|
||||
|
||||
# 5. Enable and start the service
|
||||
@ -57,7 +57,7 @@ curl http://10.0.4.100:9001/v1/models
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `MANIFEST_PATH` | `/home/bigt/AI/llm/manifest.yaml` | Path to the YAML manifest file |
|
||||
| `SIDECAR_PORT` | `8081` | Port the sidecar listens on |
|
||||
| `SIDECAR_PORT` | `8080` | Port the sidecar listens on |
|
||||
|
||||
### Manifest Format
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ WorkingDirectory=/home/bigt/AI/llm
|
||||
# Environment
|
||||
EnvironmentFile=-/home/bigt/AI/llm/.env
|
||||
Environment=MANIFEST_PATH=/home/bigt/AI/llm/manifest.yaml
|
||||
Environment=SIDECAR_PORT=8081
|
||||
Environment=SIDECAR_PORT=8080
|
||||
Environment=PATH=/home/bigt/AI/llm/venv/bin:/usr/local/bin:/usr/bin:/bin
|
||||
|
||||
# Use the sidecar's venv — install deps via deploy/README.md
|
||||
|
||||
2
main.py
2
main.py
@ -13,7 +13,7 @@ from dotenv import load_dotenv
|
||||
load_dotenv()
|
||||
|
||||
# ─── Configuration ───────────────────────────────────────────────────────────
|
||||
SIDECAR_URL = os.getenv("SIDECAR_URL", "http://10.0.4.11:8081")
|
||||
SIDECAR_URL = os.getenv("SIDECAR_URL", "http://10.0.4.11:8080")
|
||||
MAIN_PC_BASE = os.getenv("MAIN_PC_URL", "http://10.0.4.11:8080/v1").removesuffix("/v1")
|
||||
FALLBACK_SLM_URL = os.getenv("FALLBACK_SLM_URL", "http://10.0.4.200:8080/v1").removesuffix("/v1")
|
||||
OPENROUTER_API_KEY=os.getenv("OPENROUTER_API_KEY", "")
|
||||
|
||||
@ -17,7 +17,7 @@ from sidecar.manifest import load_manifest
|
||||
|
||||
# Configuration from environment
|
||||
MANIFEST_PATH = os.getenv("MANIFEST_PATH", "/home/bigt/AI/llm/manifest.yaml")
|
||||
SIDECAR_PORT = int(os.getenv("SIDECAR_PORT", "8081"))
|
||||
SIDECAR_PORT = int(os.getenv("SIDECAR_PORT", "8080"))
|
||||
LLAMA_SERVER_PORT = 8080
|
||||
|
||||
# Global state
|
||||
|
||||
@ -6,7 +6,7 @@ from unittest.mock import patch
|
||||
@pytest.fixture(autouse=True)
|
||||
def patch_router_urls():
|
||||
"""Patch router URLs for all tests in this package."""
|
||||
with patch("main.SIDECAR_URL", "http://localhost:8081"), \
|
||||
with patch("main.SIDECAR_URL", "http://localhost:8080"), \
|
||||
patch("main.MAIN_PC_BASE", "http://localhost:8080"), \
|
||||
patch("main.FALLBACK_SLM_URL", "http://localhost:9999"), \
|
||||
patch("main.OPENROUTER_API_KEY", "test-key"), \
|
||||
|
||||
@ -58,7 +58,7 @@ class TestOpenRouterFallback:
|
||||
async def run_test():
|
||||
with respx.mock:
|
||||
# Sidecar is down
|
||||
respx.get("http://localhost:8081/models/status").mock(
|
||||
respx.get("http://localhost:8080/models/status").mock(
|
||||
side_effect=Exception("connection refused")
|
||||
)
|
||||
# OpenRouter works
|
||||
@ -84,7 +84,7 @@ class TestDeprecatedHeaderRemoved:
|
||||
"""Router does not route based on x-intelligence-level: High."""
|
||||
async def run_test():
|
||||
with respx.mock:
|
||||
respx.get("http://localhost:8081/models/status").mock(
|
||||
respx.get("http://localhost:8080/models/status").mock(
|
||||
return_value=Response(200, json={"active_profile": "qwen-3-8b", "llama_server_running": True})
|
||||
)
|
||||
# Should route to Main PC regardless of header
|
||||
|
||||
@ -19,7 +19,7 @@ class TestFallbackChain:
|
||||
async def run_test():
|
||||
with respx.mock:
|
||||
# Sidecar is down — triggers fallback chain
|
||||
respx.get("http://localhost:8081/models/status").mock(
|
||||
respx.get("http://localhost:8080/models/status").mock(
|
||||
return_value=Response(503, json={"status": "error", "message": "not ready"})
|
||||
)
|
||||
# OpenRouter fails with network error
|
||||
@ -50,7 +50,7 @@ class TestFallbackChain:
|
||||
async def run_test():
|
||||
with respx.mock:
|
||||
# Sidecar down
|
||||
respx.get("http://localhost:8081/models/status").mock(
|
||||
respx.get("http://localhost:8080/models/status").mock(
|
||||
side_effect=Exception("connection refused")
|
||||
)
|
||||
# OpenRouter down
|
||||
@ -76,7 +76,7 @@ class TestFallbackChain:
|
||||
async def run_test():
|
||||
with respx.mock:
|
||||
# Sidecar down, OpenRouter down
|
||||
respx.get("http://localhost:8081/models/status").mock(
|
||||
respx.get("http://localhost:8080/models/status").mock(
|
||||
side_effect=Exception("connection refused")
|
||||
)
|
||||
respx.post("https://openrouter.ai/v1/chat/completions").mock(
|
||||
|
||||
@ -9,7 +9,7 @@ from httpx import Response, ASGITransport, AsyncClient
|
||||
|
||||
from main import app as router_app
|
||||
|
||||
SIDECAR_URL = "http://localhost:8081"
|
||||
SIDECAR_URL = "http://localhost:8080"
|
||||
MAIN_PC_URL = "http://localhost:8080"
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ from httpx import Response, ASGITransport, AsyncClient
|
||||
|
||||
from main import app as router_app
|
||||
|
||||
SIDECAR_URL = "http://localhost:8081"
|
||||
SIDECAR_URL = "http://localhost:8080"
|
||||
MAIN_PC_URL = "http://localhost:8080"
|
||||
FALLBACK_URL = "http://localhost:9999"
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ from httpx import Response, ASGITransport, AsyncClient
|
||||
|
||||
from main import app as router_app
|
||||
|
||||
SIDECAR_URL = "http://localhost:8081"
|
||||
SIDECAR_URL = "http://localhost:8080"
|
||||
MAIN_PC_URL = "http://localhost:8080"
|
||||
FALLBACK_URL = "http://localhost:9999"
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ from httpx import Response, ASGITransport, AsyncClient
|
||||
|
||||
from main import app as router_app
|
||||
|
||||
SIDECAR_URL = "http://localhost:8081"
|
||||
SIDECAR_URL = "http://localhost:8080"
|
||||
|
||||
|
||||
def test_v1_models_returns_profiles_from_sidecar():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user