diff --git a/stacks/gateway-chat/.env.example b/stacks/gateway-chat/.env.example new file mode 100644 index 0000000..6ba7e41 --- /dev/null +++ b/stacks/gateway-chat/.env.example @@ -0,0 +1,5 @@ +# gateway-chat (ana-docker) — static-serve of the model-smoking web chat. Tunables. +# Real .env at /opt/docker/compose/gateway-chat/.env (8090 was taken; using 8091). +GATEWAYCHAT_IMAGE=nginx:alpine +GATEWAYCHAT_CONTAINER_NAME=gateway-chat +GATEWAYCHAT_PORT=8091 diff --git a/stacks/gateway-chat/README.md b/stacks/gateway-chat/README.md new file mode 100644 index 0000000..dcf0484 --- /dev/null +++ b/stacks/gateway-chat/README.md @@ -0,0 +1,38 @@ +# gateway-chat + +Persistent static-serve of **`tools/gateway-chat.html`** — the zero-dependency web chat +for **smoking models on the LiteLLM gateway** (`10.250.50.70:4000`). It auto-discovers +every gateway model via `/v1/models` (the ↻ control — new models just appear), takes +system prompts, streams responses (renders `reasoning_content`), and supports image +upload for vision models (Qwopus, image-judge). It deliberately never sends a `tools` +field, sidestepping the vLLM empty-`tools` 400. + +- **Host:** ana-docker (non-GPU) +- **URL:** http://10.250.50.70:8091 +- **Image:** `nginx:alpine` (tiny static server — no GPU, no DB) +- **Served file:** `conf/index.html` → mounted read-only at + `/usr/share/nginx/html/index.html` + +## The served file mirrors `tools/gateway-chat.html` + +The canonical/editable source is the repo's **`tools/gateway-chat.html`** (also openable +`file://` or via `python3 -m http.server -d tools`). `conf/index.html` here is the +deployed copy. After editing the tool, re-sync + redeploy: + +```bash +cp tools/gateway-chat.html stacks/gateway-chat/conf/index.html +scripts/deploy-stack.sh ana-docker gateway-chat --conf +``` + +No restart needed — the file is bind-mounted, so nginx serves the new content on the next +request. (Restart only if you want a forced reload.) + +## Deploy + +```bash +scripts/deploy-stack.sh ana-docker gateway-chat # compose + conf +ssh ana-docker 'cd /opt/docker/compose/gateway-chat && docker compose up -d' +``` + +Set the gateway base URL + an API key in the page's sidebar (persists in `localStorage`), +then hit ↻ to load the model list. diff --git a/stacks/gateway-chat/compose.yaml b/stacks/gateway-chat/compose.yaml new file mode 100644 index 0000000..8cec47c --- /dev/null +++ b/stacks/gateway-chat/compose.yaml @@ -0,0 +1,37 @@ +# gateway-chat — persistent static-serve of the zero-dep web chat for SMOKING models on +# the LiteLLM gateway (auto-discovers /v1/models, system prompts, streaming + +# reasoning_content, image upload for vision models). Tiny nginx:alpine serving ONE file; +# no GPU, no DB. The served file is conf/index.html — a deployed mirror of the repo's +# tools/gateway-chat.html (re-sync on edit; see README). +# +# Tunables in .env. + +name: gateway-chat + +services: + gateway-chat: + image: ${GATEWAYCHAT_IMAGE:-nginx:alpine} + container_name: ${GATEWAYCHAT_CONTAINER_NAME:-gateway-chat} + restart: unless-stopped + ports: + - "${GATEWAYCHAT_PORT:-8091}:80" + volumes: + - /opt/docker/conf/gateway-chat/index.html:/usr/share/nginx/html/index.html:ro + healthcheck: + test: ["CMD-SHELL", "wget -qO /dev/null http://localhost/ || exit 1"] + interval: 30s + timeout: 5s + retries: 3 + networks: + - tnet + labels: + - homepage.group=AI Systems + - homepage.name=Gateway Chat + - homepage.icon=mdi-chat-processing + - homepage.description=Light web chat for smoking LiteLLM gateway models (auto-discovery, system prompts, vision) + - homepage.href=http://10.250.50.70:${GATEWAYCHAT_PORT:-8091} + +networks: + tnet: + name: traefik-net + external: true diff --git a/stacks/gateway-chat/conf/index.html b/stacks/gateway-chat/conf/index.html new file mode 100644 index 0000000..f15cdff --- /dev/null +++ b/stacks/gateway-chat/conf/index.html @@ -0,0 +1,211 @@ + + + + + +Gateway Chat — light LiteLLM playground + + + + + +
+
+
+
+ + + + +
+
+ + +