Skip to content

Better model picker & model reasoning controls - #13

Merged
Blaumaus merged 3 commits into
mainfrom
feature/better-model-picker
May 5, 2026
Merged

Blaumaus merged 3 commits into
mainfrom
feature/better-model-picker

Conversation

@Blaumaus

@Blaumaus Blaumaus commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Reasoning effort selector (Off / Low / Medium / High) for compatible models — included with message submissions and used to influence AI responses.
    • Model lists and settings surface richer metadata: version labels, price tiers, and feature icons (e.g., vision, reasoning).
    • Chat creation and inline edit flows include reasoning effort when present.
  • Bug Fixes

    • Invalid/unsupported reasoning selections are automatically cleared when a model no longer supports them.

@Blaumaus Blaumaus self-assigned this May 5, 2026
@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 861fa196-20e3-4d20-b249-23987d9e6cc8

📥 Commits

Reviewing files that changed from the base of the PR and between c2aabf8 and 4e500a4.

📒 Files selected for processing (1)
  • packages/database/src/model-registry.ts

📝 Walkthrough

Walkthrough

Adds reasoning-effort support across stack: new reasoning types and registry, enriched model metadata, UI selector and form wiring, route validation, job payload plumbing, and worker/provider streaming options for reasoning efforts.

Changes

Reasoning Effort System

Layer / File(s) Summary
Type Definitions & Exports
packages/database/src/types.ts, packages/database/src/index.ts
Adds REASONING_LEVELS, ReasoningLevel, isReasoningLevel; extends ChatJobData with optional reasoningEffort; re-exports new types and helpers.
Model Registry & Metadata
packages/database/src/model-registry.ts
Introduces MODEL_REGISTRY with ModelMetadata (provider, display, price, features, optional reasoningLevels, context); adds getModelMetadata and getModelMetadataMatch with delimiter-aware longest-prefix matching.
Model Types & Enrichment
apps/web/app/lib/models.ts, apps/web/app/lib/models.server.ts
ModelInfo gains versionLabel, knowledgeCutoff, priceTier, features, reasoningLevels; enrichCachedModel populates metadata; getCachedModels/getEnabledModels return enriched ModelInfo and disambiguate variant labels.
UI: Chat Input & Model Options
apps/web/app/components/ChatInput.tsx
Adds reasoningEffort and onReasoningEffortChange props; conditionally renders ReasoningSelector when model exposes reasoningLevels and handler is provided; clears unsupported selection on model change; includes reasoningEffort as hidden form input; refactors model option display, REASONING_LABELS, FEATURE_ICONS, and theme classes.
Routes: Chat Actions & New Chat
apps/web/app/routes/_chat.chat.$chatId.tsx, apps/web/app/routes/_chat.chat._index.tsx, apps/web/app/routes/api.chat.send.tsx
Reads reasoningEffort from form data, validates via isReasoningLevel, and includes validated value in addChatJob for new messages, edits, retries, and API send. Client state forwards reasoningEffort into ChatInput. Model <option> labels show versionLabel when present.
Settings UI
apps/web/app/routes/settings.models.tsx
ModelRow displays versionLabel, priceTier via PriceTierBadge, feature icons from features, and joined reasoningLevels; uses full cached model shape.
Worker: Streaming & Processing
apps/worker/src/utils.ts, apps/worker/src/processors/chat.ts
streamAIResponse signature adds reasoningEffort; computes providerOptions via buildProviderOptions using model metadata and reasoningEffort, and passes options into streamText; processChatJob forwards reasoningEffort to streaming. TITLE_MODELS adjusted.
Worker: Model Refresh
apps/worker/src/processors/refresh.ts
Google model refresh now filters by isGoogleChatModelId (explicit modality exclusions) instead of substring matching.
Model ID Helpers
apps/worker/src/utils.ts
isOpenAIModelId and isGoogleChatModelId refined to exclude non-chat modalities (audio/image/realtime/tts/etc.).
sequenceDiagram
    participant User as User
    participant UI as ChatInput
    participant Route as Server Route
    participant Queue as Job Queue
    participant Worker as Worker
    participant Provider as LLM Provider

    User->>UI: choose reasoning level & submit message
    UI->>Route: POST message + reasoningEffort
    Route->>Route: validate with isReasoningLevel
    Route->>Queue: addChatJob({...reasoningEffort})
    Queue->>Worker: deliver job
    Worker->>Worker: getModelMetadata(modelId)
    Worker->>Worker: buildProviderOptions(modelId, reasoningEffort)
    Worker->>Provider: streamText(..., providerOptions)
    Provider-->>Worker: stream tokens
    Worker-->>UI: stream response updates
Loading

🎯 4 (Complex) | ⏱️ ~45 minutes

  • ChathouseHQ/chathouse#13: Implements the same reasoningEffort support across UI, types/registry, routes, worker utils/processors, and model metadata.

"🐰
I nibble on metadata bright,
Levels set for thinking's light,
From selector to stream in flight,
Tokens dance with tidy might,
Hopping, reason wakes the night."

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.23% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the primary changes: enhanced model picker UI with improved display of model metadata, and addition of reasoning effort controls throughout the application.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/better-model-picker

Comment @coderabbitai help to get the list of available commands and usage tips.

@Blaumaus
Blaumaus merged commit 1865ac4 into main May 5, 2026
5 checks passed
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.

1 participant