Breaking Changes: Model Configuration and Environment Variables Update
Changes Overview
We have made two significant changes that require user action:
-
Model Configuration Moved to JSON
- All model configurations have been moved from environment variables to
public/config/models.json - This includes:
- Model IDs and names
- Provider information
- Tool calling configuration
- Model status (enabled/disabled)
- All model configurations have been moved from environment variables to
-
Environment Variable Updates
- Removed model-specific environment variables:
NEXT_PUBLIC_OLLAMA_MODELNEXT_PUBLIC_OLLAMA_TOOL_CALL_MODELNEXT_PUBLIC_AZURE_DEPLOYMENT_NAMENEXT_PUBLIC_OPENAI_COMPATIBLE_MODEL
- Renamed environment variable:
NEXT_PUBLIC_ENABLE_SAVE_CHAT_HISTORY→ENABLE_SAVE_CHAT_HISTORY
- Removed model-specific environment variables:
Required Actions
1. Update Model Configuration
Development Mode
Edit public/config/models.json directly with your model configurations:
{
"models": [
{
"id": "model-id",
"name": "Model Name",
"provider": "Provider Name",
"providerId": "provider-id",
"enabled": true,
"toolCallType": "native|manual",
"toolCallModel": "tool-call-model-id" // only if toolCallType is "manual"
}
]
}
Docker Mode
Using Prebuilt Image
When using the prebuilt image (ghcr.io/miurla/morphic:latest), create a models.json file alongside your .env.local and update your docker-compose.yml to mount it:
services:
morphic:
image: ghcr.io/miurla/morphic:latest
env_file: .env.local
volumes:
- ./models.json:/app/public/config/models.json
Building Your Own Image
When building your own Docker image from source:
- Clone the repository
- Edit
public/config/models.jsondirectly with your configurations - Build and run the image using docker-compose
2. Update Environment Variables
- Remove the following variables from your .env.local:
NEXT_PUBLIC_OLLAMA_MODELNEXT_PUBLIC_OLLAMA_TOOL_CALL_MODELNEXT_PUBLIC_AZURE_DEPLOYMENT_NAMENEXT_PUBLIC_OPENAI_COMPATIBLE_MODEL
- If you are using chat history storage, rename:
NEXT_PUBLIC_ENABLE_SAVE_CHAT_HISTORYtoENABLE_SAVE_CHAT_HISTORY
Documentation
For detailed configuration instructions, please refer to:
- Configuration Guide
- Example configuration in .env.local.example
Migration Guide
- For Development: Edit
public/config/models.jsondirectly with your model settings For Docker: Createmodels.jsonalongside.env.localwith your model settings - Update your
.env.localby removing the deprecated variables - If using chat history, rename the environment variable
- Restart your development server or Docker container
Please report any issues you encounter during the migration.
I added the following in models.json:
{
"id": "qwen2.5:latest",
"name": "Qwen 2.5",
"provider": "Ollama",
"providerId": "ollama",
"enabled": true,
"toolCallType": "manual",
"toolCallModel": "phi4"
},
But I still don't see it in the UI. deepseek-r1 is now working with Ollama.
Also, this openrouter config did not work:
{
"id": "openai/o3-mini",
"name": "O3 Mini",
"provider": "OpenAI Compatible",
"providerId": "openai-compatible",
"enabled": true,
"toolCallType": "native"
}
I just see Undefined in the UI:
I do have the following defined in my .env
OPENAI_COMPATIBLE_API_KEY=REDACTED
OPENAI_COMPATIBLE_API_BASE_URL="https://openrouter.ai/api/v1"
@arsaboo
I've fixed the model configuration issue by:
- Improving model config loading in Docker environment
- Using Next.js middleware to correctly handle request URLs
Please check the description and try it out. Let me know if you have any issues.
@miurla Just tried, and now it all works 🎉
I tried a few other providers and here's the error I am getting with Gemini 2.0 Flash:
Error in chat: Invalid arguments for tool search: Type validation failed: Value: {"max_results":5,"query":"DeepSeek R1","search_depth":"basic"}. Error message: [ { "code": "invalid_type", "expected": "array", "received": "undefined", "path": [ "include_domains" ], "message": "Required" }, { "code": "invalid_type", "expected": "array", "received": "undefined", "path": [ "exclude_domains" ], "message": "Required" } ]
The same query works fine on other two Gemini Models.
Invalid arguments for tool search
This error is related to the model's tool calling functionality. Gemini model's native tool calling is not yet stable. You can resolve this issue by setting the toolCallType to 'manual' in the model configuration.
Invalid arguments for tool search
This error is related to the model's tool calling functionality. Gemini model's native tool calling is not yet stable. You can resolve this issue by setting the toolCallType to 'manual' in the model configuration.
Thanks for the fast response. I did try configuring it as manual. Still the same error. Gemini flash for deep research is the best bang for buck. Hopefully it works out.
@warlock666 It looks like your error is still related to native tool calling. The cookie storing your model configuration might not have been updated properly.
Try this to reset the configuration:
- Select a different model first
- Then switch back to Gemini Flash
This should force the browser to update the stored configuration and resolve the error. The system might be using cached settings that still have toolCallType set to "native" instead of "manual".