Fix/cot render#60
Closed
hrayleung wants to merge 33 commits into
Closed
Conversation
Implemented automatic model discovery for OpenAI, Anthropic, Google Gemini, and xAI Grok using their native APIs instead of hardcoded model lists. Changes: - Added downloadOpenAIModels() using OpenAI /v1/models API - Added downloadAnthropicModels() using Anthropic /v1/models API - Added downloadGoogleModels() using Google /v1beta/models API - Added downloadGrokModels() using xAI /v1/models API - Updated fetchModelConfigs() to auto-fetch models when API keys are present - Added refresh hooks for each provider in ModelsAPI - Updated CLAUDE.md with project documentation Benefits: - New models automatically available without code updates - No more hardcoded model lists to maintain - Uses each provider's native API format (not OpenAI-compatible) - Models only fetched when user has configured API keys Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove hardcoded model ID checks in OpenAI, Grok, Anthropic, and Google providers - Allow dynamically fetched models from APIs to work without modification - Update model name mapping functions to return original name if not found in hardcoded list - Update image support detection in OpenAI provider to use pattern matching instead of hardcoded list - Set default max_tokens (8192) for Anthropic models not in hardcoded list Fixes "UNSUPPORTED MODEL" error for dynamically fetched models. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Database changes: - Add thinking_level column to model_configs (for Gemini 3) - Extend reasoning_effort to support "xhigh" (for OpenAI GPT-5) TypeScript changes: - Update ModelConfig type with new thinking parameters - Add useUpdateThinkingParams API function - Update all SELECT queries to include thinking_level Supports: - OpenAI: reasoning_effort (low/medium/high/xhigh) - Anthropic: budget_tokens (1024+) - Google Gemini 3: thinking_level (LOW/HIGH) - Google Gemini 2.5: budget_tokens (0-24576 or -1) - xAI Grok: reasoning_effort (low/high) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
UI Components: - Add ThinkingParamsButton component with popover interface - Shows Brain icon next to model names - Displays current thinking parameters when set - Supports all provider-specific parameters Provider Integration: - Google: Add thinking_level (Gemini 3) and thinking_budget (Gemini 2.5) support - Grok: Add reasoning_effort support for Grok 3 Mini models - OpenAI: Already supported reasoning_effort - Anthropic: Already supported budget_tokens Features: - Auto-detects provider and shows relevant parameters only - Save/Reset functionality - Real-time updates to model configs - Toast notifications for success/error Parameter mappings: - OpenAI (o1/o3/GPT-5): reasoning_effort (low/medium/high/xhigh) - Anthropic (Claude): budget_tokens (1024-20000) - Google Gemini 3: thinking_level (LOW/HIGH) - Google Gemini 2.5: thinking_budget (0-24576 or -1) - xAI Grok 3 Mini: reasoning_effort (low/high) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes: - Move ThinkingParamsButton from message display to input area - Place button next to model selector (after "gpt-5.2" button) - Only show when single model is selected - Adjust button height to h-7 to match input area - Remove ChevronDown icon for cleaner look - Support both regular chat and reply modes Now the thinking params button appears in the input area where users expect to configure model settings before sending messages. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fix Radix UI Select error: "A <Select.Item /> must have a value prop that is not an empty string" Changes: - Use "default" instead of empty string for default options - Convert "default" back to null when saving to database - Update state initialization to use "default" as fallback - Update reset handler to set "default" instead of empty string This fixes the crash when clicking the thinking params button. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add support for extended thinking (reasoning) across all model providers with database-backed configuration. This allows models to perform deeper reasoning before generating responses. Changes: - Add thinking configuration to database schema (thinking_enabled, thinking_budget_tokens) - Implement thinking support in Anthropic, OpenAI, Google, and Grok providers - Add model capabilities tracking (supports_thinking) to models table - Update prompts to differentiate between thinking-capable and non-capable models - Add UI toggle button for enabling/disabling thinking per model - Store thinking preferences per chat and model combination Database migrations: - Add thinking_enabled and thinking_budget_tokens columns to model_configs - Add supports_thinking column to models table with default false - Update schema documentation in SQL_SCHEMA.md
- Add custom Anthropic and OpenAI provider implementations - Add Google Vertex AI provider support - Extract Anthropic models to separate configuration file - Add ProvidersTab component for provider management - Remove Firecrawl dependency and WebTools.ts - Refactor model providers to support dynamic model fetching - Update attachment helpers to handle provider-specific formats - Improve settings UI for provider configuration Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit adds four new AI model providers to Chorus: - Cerebras: High-performance inference with llama models - Fireworks: Fast inference with various open-source models - Groq: Ultra-fast inference with llama and mixtral models - Mistral: Native Mistral AI models support Each provider includes: - Full streaming support - Tool calling capabilities - Provider-specific model configurations - Logo assets for UI - Integration with existing model management system Also includes: - New ToolCallArgs type for better type safety - Updated proxy utilities to support new providers - Enhanced provider selection UI with new logos - Documentation updates in AGENTS.md
… development guidance Add comprehensive documentation improvements: - Add prerequisites section with Node.js, pnpm, Rust, and Git LFS requirements - Expand architecture section with routing, analytics, and Tauri plugins - Document all key development scripts and their purposes - Add local data storage information and security reminders - Enhance testing section with organization guidelines - Document core TypeScript types and interfaces - Fix dev instance script reference - Add custom icon support note Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
… API specs - Update ProviderGrok to align with latest xAI documentation - Only apply reasoning_effort to Grok 3 Mini models (as per official specs) - Make include_reasoning optional and only set for Grok 3 Mini - Add effort level mapping: medium/xhigh → high (Grok 3 Mini only supports low/high) - Improve debug logging with effort mapping notifications - Add detailed comments explaining model-specific reasoning capabilities - Note: Grok 4 series models are reasoning-capable but don't expose reasoning_effort parameter This change ensures full compliance with xAI's 2025-2026 API specifications where: - Grok 3 Mini: supports configurable reasoning effort control (low/high) - Other Grok models: reasoning-capable but use model name suffixes (-reasoning/-non-reasoning) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove include_reasoning parameter as it's not documented in xAI API - xAI automatically returns message.reasoning_content without opt-in - Remove console.log debug statements per coding standards - Simplify reasoning_effort condition to only apply when configured Addresses CodeRabbit review feedback in PR #2
refactor: optimize Grok thinking parameter control to match 2025-2026 API specs
Previously, all Anthropic models were forcibly re-enabled on every app restart, overwriting user preferences. This commit removes the automatic re-enabling logic and preserves the user's is_enabled preferences. Changes: - Remove forced UPDATE is_enabled = 1 in downloadAnthropicModels() - Only disable models on auth failures (401/403) - Preserve user preferences on network/transient errors - Models with is_enabled = false no longer appear in model selection Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
fix: Preserve model enabled/disabled state across app restarts
Remove all local model provider functionality including Ollama and LM Studio support. Users can still run local models through Custom Provider configuration with OpenAI-compatible endpoints. - Delete ProviderOllama, ProviderLMStudio, and OllamaClient implementations - Remove ollama and lmstudio from ProviderName type and provider switch - Remove downloadOllamaModels and downloadLMStudioModels functions - Remove Local Models UI section from ManageModelsBox - Remove lmStudioBaseUrl from Settings interface - Remove local provider special handling from ProxyUtils and QuickChatModelSelector - Remove Ollama logo import and provider logo cases - Delete local-prd.md documentation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
refactor: remove local model providers (Ollama and LM Studio)
Previously, when a user changed or cleared an API key, the models fetched with the old key would remain in the database. This caused invalid keys to still display models. Now when an API key changes: 1. All models for that provider are deleted from the database 2. The download promise is reset 3. Queries are invalidated to trigger re-fetch This ensures that changing an API key properly clears old models and requires re-fetching with the new key.
The previous fix only invalidated the modelConfigs query, but ApiKeysForm uses the models query to display the model list. This caused deleted models to still appear in the UI after clearing or changing an API key. Now we invalidate both the models and modelConfigs queries to ensure the UI updates correctly when the API key changes.
Wrap deleteProviderModels in try/catch to prevent unhandled rejections and ensure invalidations always run in finally block. This prevents the invalidations from being skipped if the delete operation fails. Also surfaces any errors to the user via toast notification. Addresses CodeRabbit feedback.
fix: Clear provider models when API key changes
- Single model with sidebar collapsed: max-w-6xl (1152px) - Single model with sidebar expanded: max-w-5xl (896px) - Multiple models: min-w-[450px] max-w-[550px] (unchanged) - Uses useSidebar hook to track sidebar state - Provides more screen space for single-model conversations
Dynamic model response width based on model count and sidebar state
- Add Together.ai provider with streaming and tool calling support - Add Nvidia NIM provider using OpenAI-compatible API - Add model download functions for both providers using Tauri fetch to bypass CORS - Add API key configuration UI for Together.ai and Nvidia - Add provider logos (PNG format) for Together.ai, Nvidia, Cerebras, Mistral, Fireworks, and Groq - Update model selection UI to display Together.ai and Nvidia models - Add refresh hooks for fetching models from both providers - Fix ProviderGrok type error for reasoning effort mapping Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Update together-ai package from ^0.8.0 to ^0.33.0 - Fix critical bug in ProviderTogether.ts tool calls: use toolCall.id as key instead of hardcoded index=0 to handle multiple concurrent tool calls - Remove unnecessary type assertions (as const, as any) throughout provider code - Fix ProviderNvidia.ts to use undefined instead of null for content field - Add proper typed interfaces for Together/Nvidia API responses in Models.ts - Add auto-download promise tracking for Together and Nvidia providers in ModelsAPI.ts - Add Together and Nvidia to resetProviderDownloadPromise switch - Fix Together SDK v0.33.0 type compatibility by using CompletionCreateParamsStreaming types - Add vite.config.ts rollupOptions to externalize parquetjs dependency Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
feat: add Together.ai and Nvidia provider support
Install parquetjs as a direct dependency to resolve Vite import errors when using the together-ai provider. Remove external declaration from Vite build config as the package is now properly available. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Use Tauri's HTTP client instead of browser fetch to bypass CORS restrictions. Both providers now use tauriFetch like the Anthropic provider, routing requests through the Rust backend instead of directly from the browser. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Author
|
@coderabbitai full review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.