Skip to content

feat: user-defined LLM committees - #341

Open
duncanmcqueen wants to merge 2 commits into
Open-Legal-Products:mainfrom
duncanmcqueen:feat/model-committees
Open

feat: user-defined LLM committees#341
duncanmcqueen wants to merge 2 commits into
Open-Legal-Products:mainfrom
duncanmcqueen:feat/model-committees

Conversation

@duncanmcqueen

Copy link
Copy Markdown

Summary

Adds user-defined LLM committees: a committee runs its members in parallel and a chair synthesizes the result, configurable per user under Settings > Models and persisted on the profile (user_profiles.model_committees).

Built on the model-registry foundation (#339).

What's added

Backend

  • lib/llm/committee.ts — parallel member execution + chair synthesis, with cycle and self-chair guards.
  • lib/userCommittees.ts — validation/normalization of user committee configs (max 8 committees, max 8 members).
  • lib/llm/registry.tsgetCommitteeModel and friends accept a backward-compatible optional additionalCommittees array so user committees resolve like configured ones.
  • lib/llm/{models,index}.ts — committee-aware model resolution, availability checks, and chat/complete dispatch.
  • lib/chat/streaming.ts — loads the user's committees and resolves a usable model through them.
  • routes/user.tsmodel_committees on the profile (select/serialize/PATCH) plus GET /user/models; profile reads tolerate pre-migration databases.
  • routes/tabular.ts — committee-aware model-availability messages.
  • migrations/20260813_02_user_model_committees.sql + schema.sql.

Frontend

  • Settings > Models — create/edit/delete committees (members + chair), shown in both model pickers.
  • ModelToggle — a "Committee" group listing the user's committees, with reset-to-default when a committee is removed.
  • mikeApi / UserProfileContext — committee types, profile state, and save.

Validation

  • backend: tsc --noEmit clean; vitest run 655 passed, 24 skipped (+14 committee tests).
  • frontend: tsc --noEmit clean; vitest run 292 passed + 4 pre-existing Blob.text() failures in untouched mikeApi.test.ts.

This PR is stacked on #339 (feat/model-registry-foundation); retarget to main once that merges.

Adds per-user model committees: members answer in parallel and a chair
synthesizes, configurable under Settings > Models. Persisted on the user
profile (model_committees column), resolved through the model registry,
and enforced for API-key availability across members and chair.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants