Go to file
root b3ac21b2c0 fix: first request no longer blocks on model switch — uses background task + SSE
The FIRST request that triggers a model switch was blocking the HTTP response
for 10-30s while waiting for the sidecar to load the model. Hermes Desktop's
client timed out during this wait, causing 'nothing happens' on new session.

Fix: refactored the proxy handler so ALL requests during a model switch use
the same SSE streaming pattern (immediate 200, progress events, then actual
response piped through after switch completes). The switch now runs as a
background asyncio task via create_task().

- Added _background_switch() — runs POST /models/switch in background task
  with complete_switch() + drain_queue() in finally block
- All switch-triggering requests go through queue_request() + StreamingResponse
- SSE generator now falls through to OpenRouter/LXC if Main PC unreachable
  (switch failure case) instead of hanging indefinitely

Sidecar fixes from previous commit:
- _kill_llama_server() is now async with proper await on process termination
- _switch_lock changed from threading.Lock to asyncio.Lock()
2026-06-18 00:10:48 +00:00
.hermes/plans fix: add probe endpoints and no-model fallback for Hermes Desktop compatibility 2026-06-15 15:22:15 +00:00
deploy fix: convert underscores to hyphens in llama-server flag names, fix n_ctx→ctx-size rename 2026-06-16 20:54:32 +00:00
docs Added next changes 2026-06-15 00:09:31 +00:00
scripts feat: add sync_models.py script to auto-update Hermes custom_providers from router model list 2026-06-15 21:10:36 +00:00
sidecar fix: sidecar process kill was not awaiting wait() — old server held GPU VRAM 2026-06-17 23:49:57 +00:00
tests fix: change sidecar port from 8081 to 8080 2026-06-15 13:17:31 +00:00
.env .env 2026-06-09 13:57:22 +03:00
.gitignore Epic: Model Switching via Sidecar — Issues #2-#3 2026-06-15 00:49:24 +00:00
CONTEXT.md Epic: Model Switching via Sidecar — Issues #4-#7 + #8 deployment 2026-06-15 01:13:36 +00:00
docker-compose.yml fix: resolve port conflict between sidecar and llama-server 2026-06-15 15:31:31 +00:00
Dockerfile Initial commit: migrate intelligence-router files 2026-06-09 11:48:43 +01:00
main.py fix: first request no longer blocks on model switch — uses background task + SSE 2026-06-18 00:10:48 +00:00
pytest.ini feat: add 15 model profiles to manifest.yaml 2026-06-15 12:34:46 +00:00
requirements.txt Epic: Model Switching via Sidecar — Issues #4-#7 + #8 deployment 2026-06-15 01:13:36 +00:00