Agent harness for openrouter provisioned open weights models in the glas-harness framework of helix-forge.
Find a file
custodian-sync b4d6fc1266 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-08-25:
  - update .custodian-brief.md for rein-openweights

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 2583210@bnt-lap001
Assistant-Session: f2bff2d5-e9b2-4338-92ca-10282a927006
2026-08-25 22:42:58 +02:00
examples Bootstrap rein-openweights: minimal agentic loop over OpenRouter (REIN-OW-WP-0001) 2026-07-26 13:37:09 +02:00
src/rein_openweights feat: support governed Glas execution 2026-08-21 00:21:53 +02:00
tests feat: support governed Glas execution 2026-08-21 00:21:53 +02:00
workplans fix(workplans): move work-record identifiers onto the repository prefix 2026-08-25 22:42:48 +02:00
.custodian-brief.md chore(consistency): sync task status from DB [auto] 2026-08-25 22:42:58 +02:00
.gitignore Close REIN-OW-WP-0001-T05: repo attached to Forgejo, registered with State Hub 2026-07-26 14:14:09 +02:00
.repo-classification.yaml chore(classification): add repo classification 2026-08-25 14:02:42 +02:00
AGENTS.md docs(agents): repoint remote State Hub URL to the in-cluster address 2026-08-25 00:21:55 +02:00
INTENT.md Record live-verified OpenBao path (GLAS-WP-0002-T02 closed) 2026-07-27 01:53:31 +02:00
LICENSE Adopt Target Revenue Source License V1C1 (org-wide preliminary rollout) 2026-07-30 00:58:43 +02:00
pyproject.toml Bootstrap rein-openweights: minimal agentic loop over OpenRouter (REIN-OW-WP-0001) 2026-07-26 13:37:09 +02:00
README.md feat: support governed Glas execution 2026-08-21 00:21:53 +02:00
SCOPE.md Close out statehub-register bootstrap housekeeping (REIN-OW-0001) 2026-07-26 19:46:21 +02:00
WORK-RECORDS.md Regenerate WORK-RECORDS.md 2026-07-27 02:04:15 +02:00

rein-openweights

An agentic tool-use harness that drives current open-weight models via OpenRouter, as an alternative to the frontier-model-vendor harnesses (Claude Code, Grok CLI, Codex/GPT CLI).

Part of the glas-harness "rein" family — see glas-harness ADR-001, ADR-002 (credential ownership), and this repo's workplans/REIN-OW-WP-0001.

Uses its own minimal OpenRouter client (src/rein_openweights/openrouter_client.py), not llm-connect's OpenRouterAdapter — that adapter's execute_prompt(prompt: str, config) takes a single prompt string and never surfaces message.tool_calls, so it can't drive a multi-turn tool-calling loop without a breaking change to llm-connect's frozen Core ABC. llm-connect stays an optional dependency (see pyproject.toml), not load-bearing for the base loop.

Not yet pushed to Forgejo — local scaffold only.

Usage

python3 -m venv .venv && source .venv/bin/activate
pip install -e .

# Credential: either export OPENROUTER_API_KEY directly, or set
# OpenBao-based acquisition defaults to role_id/secret_id under
# ~/.local/rein-openweights/approle and KV path reins/rein-openweights/openrouter.
# REIN_OPENWEIGHTS_APPROLE_DIR / REIN_OPENWEIGHTS_OPENROUTER_KV_PATH override them.
export OPENROUTER_API_KEY=sk-...

rein-openweights run \
  --task-file examples/task-hello-sandbox.json \
  --model qwen/qwen-2.5-72b-instruct \
  --tool-profile green-commit-only \
  --budget-tokens 60000 \
  --max-turns 20 \
  --no-hub

green-commit-only is currently the sole supported tool profile. Unknown tool profiles fail before credential lookup. In governed use these flags are supplied by a versioned glas-harness profile; workforce/activity consumers should reference Glas rather than this CLI directly.

An explicitly exported OPENROUTER_API_KEY has highest precedence for local development. Unset or refresh it when validating the OpenBao/AppRole lane; an old inherited value will otherwise mask a newly rotated workload key.

Tests: python3 -m pytest tests/ -q (27 tests, no network/OpenBao calls — everything mocked at the httpx/bao subprocess boundary).