8000 refactor: move model configurations to JSON and improve model management by miurla · Pull Request #451 · miurla/morphic · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
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

refactor: move model configurations to JSON and improve model management #451

Merged
merged 7 commits into from
Feb 24, 2025

Conversation

miurla
Copy link
Owner
@miurla miurla commented Feb 24, 2025

Model Management Refactoring

This PR addresses issue #422 by refactoring the model management system to use a JSON-based configuration approach and improving the handling of model objects throughout the application.

Changes

Model Configuration

  • Moved model definitions from environment variables to lib/config/models.json
  • Added new model configuration fields:
    • enabled: to control model availability
    • toolCallType: to specify if model supports native tool calls or requires manual handling
    • toolCallModel: to specify which model to use for tool calls (when toolCallType is "manual")

Example configuration:

{
  "id": "model-id",
  "name": "Model Name",
  "provider": "Provider Name",
  "providerId": "provider-id",
  "enabled": true,
  "toolCallType": "native|manual",
  "toolCallModel": "tool-call-model-id"
}

- Move models data from models.ts to models.json
- Update model type definition
- Add models prop to Chat and ModelSelector components
- Update pages to pass models from json
- Change cookie key from 'modelId' to 'selectedModel'
- Store entire model object as JSON string in cookie
- Add error handling for JSON parsing
- Update model selection handling
- Update model cookie handling to use new JSON format
- Add error handling for JSON parsing
- Update DEFAULT_MODEL to use simple model ID
- Maintain default provider as 'openai'
- Improve error response format
- Add o3-mini model
- Reorder models
- Update model configurations with proper toolCallType and toolCallModel
- Move OpenAI Compatible model to the end
- Remove model-specific environment variables from .env.local.example
- Add JSON-based model configuration documentation to CONFIGURATION.md
- Update AI providers section in README.md
- Update route.ts to use Model object directly
- Update streaming functions to handle Model object
- Update context window calculation to use Model object
- Improve message truncation logic
Copy link
vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
morphic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 9:29am

@miurla miurla merged commit 978ab95 into main Feb 24, 2025
2 checks passed
@miurla miurla deleted the feature/move-models-to-json branch February 24, 2025 09:46
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
0