From 22380efc672257a326d1d6964331aa01c46ea2c0 Mon Sep 17 00:00:00 2001 From: CrypticSwarm Date: Fri, 10 Jul 2026 17:30:26 -0500 Subject: [PATCH 1/2] Route Module 3 eval orchestrator to OpenRouter Point the anthropic SDK at OpenRouter's Anthropic-compatible Messages endpoint (base_url + auth_token) and read OPENROUTER_API_KEY. Model is now an OpenRouter slug, overridable via OPENROUTER_MODEL. No changes to the Messages API call shape, tool schemas, or transcript output. --- module_3/eval/orchestrator.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/module_3/eval/orchestrator.py b/module_3/eval/orchestrator.py index d46e558..3124786 100644 --- a/module_3/eval/orchestrator.py +++ b/module_3/eval/orchestrator.py @@ -2,8 +2,9 @@ """ Real LLM orchestrator for Module 3 eval harness. -Runs a multi-agent pipeline with actual Claude API calls and writes the -transcript JSON + audit log that test_deterministic.py expects. +Runs a multi-agent pipeline with actual LLM calls (Claude models served via +OpenRouter's Anthropic-compatible endpoint) and writes the transcript JSON + +audit log that test_deterministic.py expects. Usage (from module_3/): python3 eval/orchestrator.py [options] @@ -46,7 +47,7 @@ # ── model ──────────────────────────────────────────────────────────────────── -MODEL = "claude-sonnet-4-6" +MODEL = "anthropic/claude-sonnet-4.6" # ── tool grant map (mirrors docs/routing-and-tool-grant-map.json) ───────────── @@ -508,7 +509,10 @@ def run_orchestrator( out_path: str, canary: str | None, ) -> None: - client = anthropic.Anthropic() + client = anthropic.Anthropic( + base_url="https://openrouter.ai/api", + auth_token=os.environ.get("OPENROUTER_API_KEY"), + ) transcript_events: list[dict] = [] audit_entries: list[dict] = [] From 971f00f1da6e4644cd62aad7a91d7b16f9d0d833 Mon Sep 17 00:00:00 2001 From: CrypticSwarm Date: Fri, 10 Jul 2026 17:30:26 -0500 Subject: [PATCH 2/2] Use OPENROUTER_API_KEY in docker run examples Drop ANTHROPIC_API_KEY from the Module 2 and Module 3 run commands; the containers now authenticate to OpenRouter with OPENROUTER_API_KEY only. --- module_2/README.md | 2 +- module_3/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module_2/README.md b/module_2/README.md index 1f5d823..374794f 100644 --- a/module_2/README.md +++ b/module_2/README.md @@ -36,7 +36,7 @@ Full setup with Slack and Gmail (reads credentials from your shell environment): ```bash docker run -it --rm \ -p 8501:8501 -p 8502:8502 \ - -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \ + -e OPENROUTER_API_KEY=$OPENROUTER_API_KEY \ -e SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN \ -e SLACK_TEAM_ID=$SLACK_TEAM_ID \ -v "$PWD":/workspace \ diff --git a/module_3/README.md b/module_3/README.md index 0ce8a20..8d5660d 100644 --- a/module_3/README.md +++ b/module_3/README.md @@ -46,7 +46,7 @@ docker run -it --rm \ -p 8501:8501 -p 8502:8502 \ -p 6274:6274 -p 3000:3000 \ -p 8001:8001 -p 8002:8002 \ - -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \ + -e OPENROUTER_API_KEY=$OPENROUTER_API_KEY \ -e SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN \ -e SLACK_TEAM_ID=$SLACK_TEAM_ID \ -v "$PWD":/workspace \