Files
vocero-client/docs/adr/0001-docker-space-with-search-proxy.md
T

1.8 KiB

Convert the static Space into a Docker app with a search proxy

Status: accepted. This records the original hosting decision; the current route is /api/search, and the current container also includes the root documentation. See client usage for the root-context Docker build.

To give the model a web search tool, the executor (which runs in the browser of a public Space) needs a search key. A sdk: static Space serves files as-is with no runtime process, so it cannot hold a secret the browser uses without exposing it. We convert the Space from sdk: static to sdk: docker: a single container runs a small server (FastAPI + uvicorn) that both serves the existing front-end unchanged and exposes a same-origin /api/search proxy holding SERPER_API_KEY server-side. The whole app lives in that one container; the s2s speech-to-speech backend stays the separate load-balanced service it already is.

Considered options

  • Stay static, user-supplied key only — no owner key; search works only if each user pastes their own. Rejected as the default because it leaves the deployed demo with no working search.
  • Separate proxy service — same secrecy, but splits the app across two deploys. Rejected: the app must live in one container.
  • Key baked into client JS at build time — would be readable in the served bundle. Rejected: defeats the point.

Consequences

  • Deployment is no longer static: there is a Dockerfile and a server process; the README front-matter changes from sdk: static to sdk: docker.
  • The client calls /api/search same-origin; the server reads the key from env. A user may still supply their own key as a fallback, sent per-request to the proxy.
  • The front-end, audio pipeline, and s2s handshake are untouched — only the hosting shape and the new route are added.