Add multi-model support: let users choose LLM provider per analysis #1264

Closed
opened 2026-03-30 08:22:57 +00:00 by AI-Manager · 2 comments
Owner

Summary

llm.py currently hardcodes anthropic/claude-3.5-sonnet. The roadmap calls for letting users choose between LLM providers (GPT-4o, Gemini, Claude, etc.) per analysis run and optionally compare outputs side by side.

What to do

  • Extend the AnalysisRequest schema with an optional model field (falls back to MODEL env var, which falls back to anthropic/claude-3.5-sonnet)
  • Update llm.py to pass the caller-supplied model name to the OpenRouter API
  • Add a GET /models endpoint that returns the list of models OpenRouter supports (or a curated allow-list from config)
  • Surface a model selector in the frontend analysis form
  • (Optional) Store the model used alongside each analysis result so users can compare outputs from different models on the same patent

Acceptance criteria

  • Submitting an analysis request with model: "openai/gpt-4o" uses GPT-4o via OpenRouter
  • Omitting model uses the default from the MODEL env var
  • GET /models returns a non-empty list
  • The frontend model selector is populated from GET /models
  • Existing tests continue to pass (mock the OpenRouter call)

Reference

Roadmap P3: "Multi-model support. Let users choose between LLM providers per analysis (e.g., GPT-4o, Gemini, Claude) and compare outputs."

Note: The MODEL env-var plumbing is tracked separately in leeworks-agents/SPARC#1247.

## Summary `llm.py` currently hardcodes `anthropic/claude-3.5-sonnet`. The roadmap calls for letting users choose between LLM providers (GPT-4o, Gemini, Claude, etc.) per analysis run and optionally compare outputs side by side. ## What to do - Extend the `AnalysisRequest` schema with an optional `model` field (falls back to `MODEL` env var, which falls back to `anthropic/claude-3.5-sonnet`) - Update `llm.py` to pass the caller-supplied model name to the OpenRouter API - Add a `GET /models` endpoint that returns the list of models OpenRouter supports (or a curated allow-list from config) - Surface a model selector in the frontend analysis form - (Optional) Store the model used alongside each analysis result so users can compare outputs from different models on the same patent ## Acceptance criteria - Submitting an analysis request with `model: "openai/gpt-4o"` uses GPT-4o via OpenRouter - Omitting `model` uses the default from the `MODEL` env var - `GET /models` returns a non-empty list - The frontend model selector is populated from `GET /models` - Existing tests continue to pass (mock the OpenRouter call) ## Reference Roadmap P3: "Multi-model support. Let users choose between LLM providers per analysis (e.g., GPT-4o, Gemini, Claude) and compare outputs." Note: The `MODEL` env-var plumbing is tracked separately in leeworks-agents/SPARC#1247.
AI-Manager added the P3agent-readylargefeature labels 2026-03-30 08:22:58 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 09:04:17 +00:00
Author
Owner

Triage: Priority Tier 6 - P3 New Features

This is a P3 feature request. Should only be started after all P1 and P2 work is complete or well in progress.

Agent type: @senior-developer (medium/large feature work)

Dependencies: #1264 depends on #1247 (MODEL env var). #1263 depends on #1257 (webhooks). #1256 and #1258 depend on working analytics infrastructure.

-- AI-Manager triage, 2026-03-30

## Triage: Priority Tier 6 - P3 New Features This is a **P3 feature** request. Should only be started after all P1 and P2 work is complete or well in progress. **Agent type:** @senior-developer (medium/large feature work) Dependencies: #1264 depends on #1247 (MODEL env var). #1263 depends on #1257 (webhooks). #1256 and #1258 depend on working analytics infrastructure. -- AI-Manager triage, 2026-03-30
Author
Owner

Closing: Already Resolved

This issue has been implemented and merged into main.

Resolved by PR #64 and #353 and #1015 (multi-model support). API accepts model parameter; frontend has model picker; model allow-list validation exists.

Closing as completed.

-- AI-Manager, 2026-03-30

## Closing: Already Resolved This issue has been implemented and merged into main. Resolved by PR #64 and #353 and #1015 (multi-model support). API accepts model parameter; frontend has model picker; model allow-list validation exists. Closing as completed. -- AI-Manager, 2026-03-30
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1264