Skip to content

#15: pass VLM/VISION/OPENROUTER api keys into dotty-behaviour#98

Open
BrettKinny wants to merge 2 commits into
mainfrom
loop-batch-15-vlm-key-passthrough
Open

#15: pass VLM/VISION/OPENROUTER api keys into dotty-behaviour#98
BrettKinny wants to merge 2 commits into
mainfrom
loop-batch-15-vlm-key-passthrough

Conversation

@BrettKinny
Copy link
Copy Markdown
Owner

Summary

The post-#36 manifestation of #15. The bridge-side hardening (aa2d8ba, 2026-05-16) and the original RPi-side env-var TODO were both rendered moot by #36's RPi decommission — but the active vision path moved to dotty-behaviour/dispatch/vlm.py, and dotty-behaviour/docker-compose.yml had no env passthrough for any of the API-key variables. A fresh deploy with a populated host .env still resolves all three of VLM_API_KEY / VISION_API_KEY / OPENROUTER_API_KEY to empty inside the container, so every photo intent falls through to VLM_OFFLINE_SENTINEL and vision is silently broken.

Changes

  • dotty-behaviour/docker-compose.yml — add ${VAR:-} interpolation for OPENROUTER_API_KEY, VISION_API_KEY, VLM_API_KEY, and AUDIO_CAPTION_API_KEY. The :- default keeps docker compose up working when none are set (container starts but vision returns the offline sentinel — the documented loud-error contract).
  • dotty-behaviour/README.md — document the requirement under "Build + run on Unraid", explaining the fallback order and what happens when keys are missing.

Test plan

  • docker compose -f dotty-behaviour/docker-compose.yml config parses cleanly and shows all four keys in the normalized output.
  • dispatch/vlm.py's VLMClient.describe_image already returns VLM_OFFLINE_SENTINEL when api_key is empty (lines 82-88), so unset keys still produce the loud-error contract — no behavioural regression on misconfigured deploys.

Closes #15

🤖 Generated with Claude Code

BrettKinny and others added 2 commits May 23, 2026 17:10
Add a 🤖 blockquote between the tagline and the existing ⚠️ heads-up.
First substantive thing a visitor reads: most of the code and nearly
all of the docs in this repo were written by AI agents under
direction, framed honestly so the project's nature is clear up-front.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Post-#36 the active vision path is dotty-behaviour/dispatch/vlm.py,
which inherited the loud-error contract from bridge.py's hardened
_call_vision_api. But dotty-behaviour/docker-compose.yml didn't pass
any of VLM_API_KEY / VISION_API_KEY / OPENROUTER_API_KEY into the
container — so a fresh deploy resolves all three to empty inside the
container even with a populated host .env, and every photo intent
falls through to the VLM_OFFLINE_SENTINEL.

- Add ${VAR:-} interpolation for all four (incl. AUDIO_CAPTION_API_KEY)
  so the compose picks them up from the shell that runs
  `docker compose up` without erroring when none are set.
- Document the env-var requirement in dotty-behaviour/README.md under
  "Build + run on Unraid".

Closes #15. The bridge-side hardening (aa2d8ba) and the original
RPi-side env-var TODO were already moot post-#36 RPi decommission;
this commit closes the post-#36 manifestation of the same bug.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 23, 2026 08:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to restore/enable the dotty-behaviour container’s vision path by ensuring VLM/Vision/OpenRouter (and audio caption) API key environment variables are available inside the container, and documenting the required deployment configuration.

Changes:

  • Add API-key environment variable passthroughs to dotty-behaviour/docker-compose.yml.
  • Document the vision-key environment variable requirements and fallback behavior in dotty-behaviour/README.md.
  • Add an “AI-assisted project” note to the repository root README.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
README.md Adds an AI-assisted-project disclosure note (not described in the PR metadata).
dotty-behaviour/README.md Documents vision API key requirements/fallback behavior for Unraid deploys.
dotty-behaviour/docker-compose.yml Adds environment variable passthroughs for vision/audio API keys (currently breaks fallback behavior when some keys are unset).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +49 to +52
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
- VISION_API_KEY=${VISION_API_KEY:-}
- VLM_API_KEY=${VLM_API_KEY:-}
- AUDIO_CAPTION_API_KEY=${AUDIO_CAPTION_API_KEY:-}
Comment thread dotty-behaviour/README.md
Comment on lines +51 to +53
confabulating a description. Set the key in the host shell before
`docker compose up`, or pass `--env-file <path>` at a `.env` that
contains it.
Comment thread README.md

**Your self-hosted [StackChan](https://github.com/m5stack/StackChan) robot assistant — kid-safe by default, hackable by design, private by architecture.**

> 🤖 **AI-assisted project.** Most of the code and nearly all of the docs in this repo were written by AI agents (primarily Claude Code) under my direction. I've been coding professionally for 15+ years; Dotty is one of a few side projects I'm using to learn the current generation of AI/LLM tooling first-hand — what the tools do well, where they break, and how to drive them. Feedback on the output very welcome.
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.

VLM_API_KEY unset on bridge — photo intents confabulate

2 participants