Archibald312 builds the switchboard before plugging anything in

GordonOSS can now decide which AI model handles which matter - even though, for today, nothing has changed.

infrastructurecompliance

Archibald312 has laid the wiring for picking a different AI model per project, or even per document, instead of running everything through one engine. A single decision point now resolves which model to use, following a clear order of priority: a document's own preference wins, then the project's, then whatever the user asked for. Where two documents in one request disagree, the system records the conflict and proceeds rather than stalling, and it flatly rejects model names it doesn't recognise.

Crucially, every one of these choices - including the conflicts and the rejections - gets written to an audit trail. For now no preferences are set anywhere, so behaviour is identical to before; this is groundwork. The payoff comes later, when the fork lets firms run models on their own hardware and route sensitive documents accordingly without rebuilding the plumbing each time.

So what Firms weighing where their most sensitive matters get processed should watch this: it's the foundation for steering individual documents to specific models, with a record of every decision.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from Archibald312/GordonOSS, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
c549ff21 Pre-Phase-7: per-source LLM routing seam (#7) Archibald312 2026-05-15 ↗ GitHub
commit body
* Pre-Phase-7: per-source LLM routing seam

Defer original Phase 7 (local inference / Ollama / vLLM) to post-launch
and land the per-source LLM routing surface ahead of Phase 7 connectors,
so that connectors and the eventual local-inference adapter plug into the
same decision point without touching dispatch sites. See decisions.md
(2026-05-15) and the renumbered build plan in CLAUDE.md.

- model_preference (nullable) columns on projects + documents
- backend/src/lib/llm/routing.ts: resolveModelRouting() with doc → project
  → request precedence, conflicts and unknown-model rejections captured
  for audit
- streamChatWithTools accepts optional routing context, dispatches with
  the resolved model, and records the policy into the existing
  audit_log.routing_policy_applied jsonb column
- main chat path wired to pass project + document IDs
- 8 unit tests covering precedence, conflicts, rejections, and db errors

Backend tsc --noEmit clean; Vitest 73/73 passing.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* lint: const documentPrefs in routing resolver

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-426.md from inside the repo you want the changes in.

⬇ Download capture-thread-426.md