docs(examples): one-command docker-compose quickstart - #135
Merged
Conversation
Add examples/quickstart-compose: a 'docker compose up' demo that shows the deterministic loop budget hard-stopping a runaway agent with no API key and no local Go/Python setup — the fastest path to first value. Three small services: a mock OpenAI-compatible upstream (nginx, one canned completion with token usage) so no real provider or key is needed; the RiskKernel daemon with a hard loop budget of 5 forwarding to the mock; and a tiny shell 'agent' that just loops through the proxy under one run id and never stops on its own. RiskKernel kills it on the 6th call with HTTP 402 loop_budget_exceeded. The daemon service sets pull_policy: always so a stale locally-cached :latest can't make the demo behave like an older build (caught exactly this in testing). The README shows how to swap the mock for a real provider — still one env var on the app side. Linked from the main README quickstart. Verified end-to-end: docker compose up meters calls 1-5 (1600 tokens each) and halts call 6 with loop_budget_exceeded, exit code 0, no key required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lowers time-to-first-value:
examples/quickstart-composeis adocker compose updemo that shows RiskKernel hard-stopping a runaway agent — no API key, no local Go/Python.What it does
How (three tiny services)
nginx:alpine) — a stand-in OpenAI-compatible upstream returning one canned completion with token usage, so the demo needs no real provider or key.RISKKERNEL_DEFAULT_LOOPS=5(other dimensions unlimited, so the halt reason is unambiguous), forwarding to the mock viaRISKKERNEL_OPENAI_BASE_URL.curlimages/curl) — a minimal shell loop that calls the proxy under one run id and never stops on its own; RiskKernel stops it.A short README shows how to swap the mock for a real provider (still one env var on the app side).
Notes
pull_policy: always— during testing a stale cached:latest(a pre-releasev0.2.0dev build) made the override silently no-op, so the demo must guarantee a fresh image.gpt-4ois in the pricing table, so the demo also shows real per-call cost as a bonus; the loop budget is the deterministic killer either way.Verified
Brought the stack up end-to-end (
docker compose up --exit-code-from sample-agent): calls 1–5 metered at 1600 tokens each, call 6 halted withloop_budget_exceeded, compose exit code 0, no API key.docker compose configvalidates andsh -n agent.shis clean.Closes #95