-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feature: Add custom model name support for Claude models #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Wadehl
wants to merge
13
commits into
getAsterisk:main
Choose a base branch
from
Wadehl:custom-model-name-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,682
−187
Conversation
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
- Add custom model storage and management system - Support reading ANTHROPIC_MODEL from Claude Settings environment variables - Implement grouped model dropdown with Custom/Environment/Default sections - Add Models tab in Settings UI for managing custom models
- Update model parameter types from literal union to string - Fix queuedPrompts state and ref type definitions - Update PromptQueue component to handle arbitrary model names - Remove unused type imports in FloatingPromptInput
- Remove explanatory text about raw JSON display
- Restore original function positioning in agents.rs and claude.rs - Remove extra blank lines that were added during development - Keep only essential changes for custom model support functionality
- Restore original storage_reset_database function with proper error handling - Keep only essential get_settings and save_settings functions for custom model support - Remove simplified database reset logic that was unrelated to model management
- Add validation method to CustomModel struct for input validation - Extract load_custom_models helper function to eliminate code duplication - Improve error handling in save_custom_models with explicit error propagation - Use find() instead of any() for better error messages with specific model names - Clean up unused imports and fix formatting issues - All changes maintain backward compatibility and improve code maintainability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
refactor: optimize Rust models.rs implementation
* feat: add Official Models section with Anthropic API integration - Add Official Models UI section in Settings → Models tab with collapsible functionality - Implement Anthropic Models List API integration in Rust backend - Add get_official_models Tauri command with proper error handling - Create unified environment variable access function (get_env_var) - Add frontend API call for fetching official models - Include model selection and add-to-custom functionality - Maintain visual consistency with existing Custom Models section - Return empty list on API failure instead of hardcoded fallbacks - Optimize code by removing unused structures and duplicate logic 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * chore: remove zustand dependency from lockfile --------- Co-authored-by: 刘俊辉 <[email protected]> Co-authored-by: Claude <[email protected]>
Resolved conflicts: - Added both models and proxy modules to src-tauri/src/commands/mod.rs - Added both model management and proxy settings commands to src-tauri/src/main.rs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…lity - Add validation tests for CustomModel struct - Add serialization/deserialization tests - Add Anthropic API response parsing tests - Add database operations tests - Add edge case testing (unicode, long strings, whitespace) - Test coverage includes model config, validation, and data persistence - All 8 tests pass without warnings
Incorporates latest changes including analytics infrastructure, CI/CD workflows, and build improvements while preserving custom model functionality.
…upport # Conflicts: # src/components/FloatingPromptInput.tsx # src/components/Settings.tsx # src/lib/api.ts
- Enhanced AgentExecution with custom model selection - Updated CreateAgent form to support custom model names - Modified AgentRunView and AgentRunOutputViewer for custom models - Added custom model configuration in AgentsModal
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.
Summary
This PR introduces comprehensive custom model name support, allowing users to configure and use custom Claude models beyond the default Sonnet and Opus options. The feature includes both backend API management and frontend UI for model configuration.
Problem Solved
Previously, users were limited to only two predefined Claude models (Sonnet and Opus). This restriction prevented users from:
Approach Taken
Backend Changes (Rust/Tauri)
commands/models.rs
with comprehensive model management APIsget_available_models()
- Retrieves all available models including custom and environment modelssave_custom_models()
- Persists custom model configurationsadd_custom_model()
- Adds individual custom models with validationremove_custom_model()
- Removes custom models by namecommands/storage.rs
with settings management functionsget_settings()
- Loads application settings from JSON filesave_settings()
- Persists settings with proper error handlingANTHROPIC_MODEL
environment variableFrontend Changes (React/TypeScript)
"sonnet" | "opus"
tostring
for flexibilityFloatingPromptInput
component to dynamically load and display modelsKey Features
ANTHROPIC_MODEL
from environmentTechnical Implementation Details
CustomModel
struct withname
,identifier
, and optionaldescription
Testing
Dependencies
No new external dependencies were added. The implementation uses existing libraries and frameworks already present in the codebase.
Potential Side Effects
settings.json
file in app data directory if not exists