router / cmd
CLAUDE.md5.6k starsChanged 2 months agoApache-2.0View on GitHub
Mirror notice. Source for generated AGENTS.md. Edit this file, then run make generate-agent-guides; CI rejects drift. Composition root. Only place that constructs concrete adapters + wires them together. Read root CLAUDE.md first. ROUTER_DEPLOYMENT_MODE is read at boot: Provider registration: Single source of truth for provider→env-var mapping = providers.APIKeyEnvVars in ../internal/providers/provider.go. Admin /config view reads it so it can't drift from actual wiring.
Trending
More talk lately.thin dataabout the whole repository
Who's talking about weave-os/router
- sudosubin/agents.nix“agent-skills.github.weave-os.router: 0.2.23 → 0.2.28”GitHub · Oct 4, 2026
- sudosubin/agents.nix“agent-skills.github.weave-os.router: init at 0.2.23”GitHub · Oct 3, 2026
- PyTorchKR/landscape“[Add] Weave Router (weave-os/router)”GitHub · Oct 3, 2026
- datarelay-labs/datarelay-atlas“[Roadmap] Adaptive Model Routing — Weave Router reference / cache-aware switching”GitHub · Oct 2, 2026
The biggest 4 of 4 mentions linking to the repository that our crawl found. Each line is their own headline.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cmd/AGENTS.mdAGENTS.md
- db/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- db/CLAUDE.mdCLAUDE.md
- debug-claude-sessionSkill
- debug-codex-sessionSkill
- pr-merge-readySkill
- test-claude-locallySkill
- test-codex-locallySkill
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Keep main.go focused on wiring.
- Very specific: line 19
No more heuristic-fallback router: If cluster routing fails to boot, main.go panics.
- Very specific: line 34
Every provider goes into providerMap regardless of mode.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
cmd — CLAUDE
Mirror notice. Source for generated AGENTS.md. Edit this file, then run
make generate-agent-guides; CI rejects drift.
Composition root. Only place that constructs concrete adapters + wires them together. Read root CLAUDE.md first.
Rules
cmd/router/main.gowires worker provider adapters and persistence.cmd/router-gateway/main.gowires only gateway authentication, admission persistence, the registry and IAM forwarding. The gateway must not construct provider clients, billing, ONNX routing or policy-selection runtimes. Keep its image independent of worker releases.- Keep
main.gofocused on wiring. Today's helpers:buildClusterScorer— per-version Scorer assembly + embedder warmupbuildExploringRouter— optionally wraps the cluster router inbanditexplore(env-flag gated; off by default)buildSemanticCache— response-cache assemblybuildOtelEmitter— OTel span exporterrunSessionPinSweep— TTL sweep loopresolveHardPinModel/resolveCompactionModel/resolveDefaultBaselineModel/resolveAvailableModels— boot-time model resolutionregisterDeploymentKeyedProvider— shared "resolve key → build client → log" registration for the providers whose gating collapses to that shape (Fireworks, Makora, Together, Bedrock, Google); OpenRouter and Anthropic/OpenAI stay bespoke- small env parsers (e.g.
envVarHint,parseEnvInt,parseEnvFloat,parseEnvDurationMs)
- No more heuristic-fallback router. If cluster routing fails to boot,
main.gopanics. Misconfiguration must abort the process rather than silently degrade. - Validate deployment target overrides through
policy.Registry.ValidateDeploymentafter provider/model configuration is resolved. A partial or catalog-incompatible explicit target is a startup error, not permission to substitute a default. - Never introduce DI container, reflection-based wiring, or service locator. Composition = plain Go function calls.
panicis reserved for startup-time fail-fast (config.MustGet, cluster-scorer boot failure, invalidROUTER_DEPLOYMENT_MODE). Never panic on request path.
Deployment-mode dispatch
ROUTER_DEPLOYMENT_MODE is read at boot:
selfhosted(default): mounts dashboard at/ui/*,/admin/v1/*API, dashboard cookie auth. Provider keys read from env vars.managed: dashboard +/admin/v1/*not mounted. Billing-backed managed deployments load platform keys and enforce balance checks. Only managed deployments without billing remain BYOK-only with empty deployment keys; a billing boot-check error defaults to billing-enabled, not BYOK-only.- Any other value → panic at boot.
Provider registration:
- Every provider goes into
providerMapregardless of mode. envKeyedProviders(parallel set) tracks which providers have a deployment-level key configured so the hard-pin resolver knows what's safe to pin to.- Provider credential mode follows
byokOnlyincmd/router/main.go, notmanagedalone. Preserve installation BYOK opt-in and client subscription routing when changing registration.
Single source of truth for provider→env-var mapping = providers.APIKeyEnvVars in ../internal/providers/provider.go. Admin /config view reads it so it can't drift from actual wiring.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

