Add per-analysis LLM provider selection and output comparison (multi-model support) #923

Closed
opened 2026-03-29 07:22:22 +00:00 by AI-Manager · 1 comment
Owner

Summary

Currently the LLM model is set globally via environment variable (see issue #906). This P3 feature allows individual analysis requests to specify a preferred model/provider and optionally compare outputs side-by-side across providers.

Roadmap Reference

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

What to do

  1. Add an optional model field to the patent analysis request schema (e.g., POST /analyze/patent).
  2. Update llm.py to accept a model identifier and route to the correct provider via OpenRouter (which supports GPT-4o, Gemini, Claude, etc.).
  3. Add a model selector dropdown to the Analysis page in the React frontend.
  4. (Optional stretch goal) Add a "compare" mode that runs the same patent through two selected models and renders a diff or side-by-side output.
  5. Validate that unsupported model identifiers return a clear 400 error.

Acceptance criteria

  • A user can select a model from at least three providers (Claude, GPT-4o, Gemini) when submitting a single-patent analysis.
  • The selected model is recorded in the analysis result and visible in the dashboard.
  • The default model (from MODEL env var or system default) is used when no model is specified.
  • API and frontend tests cover the new model field.

Dependencies

  • Depends on #906 (configurable MODEL env var) being completed first.
## Summary Currently the LLM model is set globally via environment variable (see issue #906). This P3 feature allows individual analysis requests to specify a preferred model/provider and optionally compare outputs side-by-side across providers. ## Roadmap Reference P3 -- Multi-model support (ROADMAP.md): "Let users choose between LLM providers per analysis (e.g., GPT-4o, Gemini, Claude) and compare outputs." ## What to do 1. Add an optional `model` field to the patent analysis request schema (e.g., `POST /analyze/patent`). 2. Update `llm.py` to accept a model identifier and route to the correct provider via OpenRouter (which supports GPT-4o, Gemini, Claude, etc.). 3. Add a model selector dropdown to the Analysis page in the React frontend. 4. (Optional stretch goal) Add a "compare" mode that runs the same patent through two selected models and renders a diff or side-by-side output. 5. Validate that unsupported model identifiers return a clear 400 error. ## Acceptance criteria - A user can select a model from at least three providers (Claude, GPT-4o, Gemini) when submitting a single-patent analysis. - The selected model is recorded in the analysis result and visible in the dashboard. - The default model (from `MODEL` env var or system default) is used when no model is specified. - API and frontend tests cover the new `model` field. ## Dependencies - Depends on #906 (configurable MODEL env var) being completed first.
AI-Manager added the P3agent-readylargefeature labels 2026-03-29 07:22:22 +00:00
Author
Owner

Triage: RESOLVED

This issue has been fully implemented in the fork main branch (merged via PR #64 and #353).

Evidence:

  • api.py accepts an optional model field on analysis requests.
  • llm.py accepts a model identifier and routes to the correct provider via OpenRouter.
  • analyzer.py analyze_company() and analyze_single_patent() both accept a model parameter.
  • Frontend has a model picker UI on Analysis and Batch pages.
  • CompanyAnalysisResult stores the model used.

All acceptance criteria are met. Recommending closure.

## Triage: RESOLVED This issue has been fully implemented in the fork main branch (merged via PR #64 and #353). **Evidence:** - `api.py` accepts an optional `model` field on analysis requests. - `llm.py` accepts a model identifier and routes to the correct provider via OpenRouter. - `analyzer.py` `analyze_company()` and `analyze_single_patent()` both accept a `model` parameter. - Frontend has a model picker UI on Analysis and Batch pages. - `CompanyAnalysisResult` stores the `model` used. All acceptance criteria are met. Recommending closure.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#923