- Mount FastMCP at /mcp with tools for notebook CRUD, simulation,
and cell execution. Includes status resource and circuit_assistant
prompt.
- Add SSE streaming chat endpoint at /api/chat/stream backed by
GPU LLM gateway (qwen3). Chat widget sends notebook context
(SPICE cells, markdown notes) so the assistant can reference the
user's circuit.
- React floating chat panel with zustand-persisted conversation
history, streaming token display, reasoning collapse, and
keyboard shortcuts.
- Refactor main.py from deprecated on_event("startup") to lifespan
context manager with combine_lifespans for MCP integration.
- Add notebook_id path traversal validation, decouple get_engine()
from HTTPException for MCP compatibility, fix HTTP client init
race condition with asyncio.Lock.
- Update Caddy labels for /mcp/* routing and SSE streaming on
backend reverse proxy.
41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
target: prod
|
|
expose:
|
|
- "8000"
|
|
networks:
|
|
- default
|
|
- caddy
|
|
labels:
|
|
caddy: "${SPICEBOOK_DOMAIN:-spicebook.localhost}"
|
|
caddy.@api.path: "/api/* /health /docs /openapi.json /redoc /mcp/*"
|
|
caddy.reverse_proxy_0: "@api {{upstreams 8000}}"
|
|
caddy.reverse_proxy_0.flush_interval: "-1"
|
|
caddy.reverse_proxy_0.transport: "http"
|
|
caddy.reverse_proxy_0.transport.read_timeout: "0"
|
|
caddy.reverse_proxy_0.transport.write_timeout: "0"
|
|
caddy.reverse_proxy_0.stream_timeout: "24h"
|
|
caddy.reverse_proxy_0.stream_close_delay: "5s"
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
target: prod
|
|
expose:
|
|
- "4321"
|
|
networks:
|
|
- default
|
|
- caddy
|
|
labels:
|
|
caddy: "${SPICEBOOK_DOMAIN:-spicebook.localhost}"
|
|
caddy.reverse_proxy_1: "{{upstreams 4321}}"
|
|
caddy.reverse_proxy_1.flush_interval: "-1"
|
|
|
|
networks:
|
|
caddy:
|
|
external: true
|