Skip to content

fix(deploy): complete the LLM env wiring for the demo stack#66

Open
librowski wants to merge 3 commits into
mainfrom
deploy-backend-openrouter-key
Open

fix(deploy): complete the LLM env wiring for the demo stack#66
librowski wants to merge 3 commits into
mainfrom
deploy-backend-openrouter-key

Conversation

@librowski

@librowski librowski commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What

Three gaps in how LLM configuration reaches the demo services, all silent in the UI:

Backend never received OPENROUTER_API_KEY. The adapt endpoint (/api/visualize/adapt) makes its LLM call in the backend process, but the compose passed the key only to the worker. Every adapt call answered 501 adapt_disabled; the frontend swallows adapt failures and falls back to raw text, so "Adapt with AI" never worked on deployments while executions (worker-side LLM calls) kept working. The backend now gets the same OPENROUTER_API_KEY / AI_MODEL pair as the worker - no new secret needed on the host.

TAVILY_API_KEY was never wired into the deploy. The worker reads it to enable the AI Agent's web search tool; without it, agents with web search toggled on silently run without the tool. Now passed through the compose (optional, empty keeps it off) and documented in .env.example.

Two different model defaults. Backend and worker code defaulted to google/gemini-2.5-flash-lite while the deploy stack defaults to mistralai/mistral-small-3.2-24b-instruct - an unset AI_MODEL meant different models depending on where the process ran. Unified on the demo model everywhere (cheap, EU-hosted, solid tool calling); the deployed demo already runs it, so production behavior does not change.

Deploy note

The deploy workflow only pulls images and recreates containers - it does not sync the compose file. After merging: update the compose on the host with this version, optionally add TAVILY_API_KEY to the host .env to enable web search, then docker compose up -d --force-recreate backend worker.

The adapt endpoint runs its LLM call in the backend, not the worker,
and answered 501 adapt_disabled on every request because only the
worker received the key. Executions kept working, which masked it.
The worker reads TAVILY_API_KEY to enable the AI Agent's web search
tool, but the deploy compose never passed it, so web search was
silently disabled on deployments: agents with the toggle on ran
without the tool. Optional - an empty value keeps it off.
Backend and worker code defaulted to google/gemini-2.5-flash-lite
while the deploy stack defaults to mistralai/mistral-small-3.2-24b-instruct,
so an unset AI_MODEL meant different models depending on where the
process ran. One default everywhere now - the deployed demo already
runs this model, so production behavior does not change.
@librowski librowski changed the title fix(deploy): pass OPENROUTER_API_KEY to the backend service fix(deploy): complete the LLM env wiring for the demo stack Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants