feat(docker): add localai-stack compose for self-hosted gemma-3-4b-it#18
Conversation
Provides a second compose stack alongside observability-stack that runs the agent against a local LocalAI inference server preloading google/gemma-3-4b-it from the default gallery, so the digest can be produced without any external LLM provider. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Docker Compose “LocalAI stack” to run the reddit-digest agent end-to-end against a self-hosted LocalAI server (preloading a Gemma model), with accompanying usage documentation.
Changes:
- Added
docker-compose/localai-stack/docker-compose.ymldefininglocalai+agent, wiring the agent to LocalAI via OpenAI-compatible/v1and gating startup on/readyz. - Added
docker-compose/localai-stack/README.mdwith prerequisites, quickstart, API probe examples, and teardown instructions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docker-compose/localai-stack/docker-compose.yml | New compose stack running LocalAI and an agent configured to use it via OPENAI_BASE_URL/LLM_MODEL, with a healthcheck gate. |
| docker-compose/localai-stack/README.md | Documentation for running and interacting with the new LocalAI stack. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,62 @@ | |||
| # LocalAI Stack | |||
|
|
|||
| Local Docker Compose stack that runs the reddit-digest-agent against a self-hosted [LocalAI](https://localai.io/) inference server serving `google/gemma-3-4b-it`. | |||
There was a problem hiding this comment.
README mentions serving google/gemma-3-4b-it, but the rest of this stack (compose MODELS/LLM_MODEL and the example /v1/chat/completions payload) uses gemma-3-4b-it. Please align the model identifier in the docs with the actual model name that LocalAI exposes (either update this line to gemma-3-4b-it or update the compose/examples accordingly).
| Local Docker Compose stack that runs the reddit-digest-agent against a self-hosted [LocalAI](https://localai.io/) inference server serving `google/gemma-3-4b-it`. | |
| Local Docker Compose stack that runs the reddit-digest-agent against a self-hosted [LocalAI](https://localai.io/) inference server serving `gemma-3-4b-it`. |
| # LocalAI Stack | ||
|
|
||
| Local Docker Compose stack that runs the reddit-digest-agent against a self-hosted [LocalAI](https://localai.io/) inference server serving `google/gemma-3-4b-it`. |
There was a problem hiding this comment.
PR description says documentation was added to the repository root README.md, but this PR adds docs under docker-compose/localai-stack/README.md only. Please either update the PR description or add a short pointer in the root README so users can discover this stack.
| | Service | URL | Description | | ||
| |---------|-----|-------------| | ||
| | LocalAI | http://localhost:8080 | OpenAI-compatible inference API (`/v1/chat/completions`, `/v1/models`, …) | |
There was a problem hiding this comment.
The markdown table under “Services” has an extra leading | on each row (|| ...), which breaks table rendering in most Markdown parsers. Change those lines to start with a single |.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
docker-compose/localai-stack/alongsideobservability-stack/, running a local LocalAI inference server that preloadsgoogle/gemma-3-4b-itfrom the default model gallery.OPENAI_BASE_URL,LLM_MODEL, andOPENAI_API_KEYso the digest runs end-to-end against the local model with no external LLM provider, gated on a LocalAI/readyzhealthcheck.README.mdgets a short "Local LocalAI stack" subsection next to the existing "Local observability stack" one, pointing to the new compose directory.Test plan
docker compose -f docker-compose/localai-stack/docker-compose.yml configvalidates the file.docker compose up -d localaiboots LocalAI,/readyzreturns 200,/v1/modelsexposesgemma-3-4b-it, and a sample/v1/chat/completionscall returns a valid response.up --build --abort-on-container-exit agent): collector (10 posts) → filterer → scorer (10 → 6) → summarizer (6/6) → Telegram delivery (HTTP 200 × 2) withagentexit code 0.🤖 Generated with Claude Code