modify_model_config
Adjust and update model configurations for AI models, including parameters like version, provider, and API details, to ensure accurate and optimized performance.
Instructions
Modify the model configuration and update the model.
Args: new_model_config: The sample model configuration to be modified. Example usage: { "model_saved_name": "example_model_name", # The name under which the model is saved. "testing_for": "LLM", # The purpose for which the model is being tested. (Always LLM) "model_name": "example_model", # The name of the model. (e.g., gpt-4o, claude-3-5-sonnet, etc.) "modality": "text", # The type of data the model works with (e.g., text, image). "model_config": { "model_version": "1.0", # The version of the model. "model_provider": "example_provider", # The provider of the model. (e.g., openai, anthropic, etc.) "endpoint_url": "https://api.example.com/model", # The endpoint URL for the model. "apikey": "example_api_key", # The API key to access the model. }, } test_model_saved_name: The saved name of the model to be tested.
Returns: A dictionary containing the response message and details of the modified model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new_model_config | Yes | ||
| test_model_saved_name | Yes |
Input Schema (JSON Schema)
Implementation Reference
- src/mcp_server.py:358-394 (handler)Handler function for the 'modify_model_config' tool. Decorated with @mcp.tool() for registration. Modifies a model's configuration using the model_client and returns the response as a dictionary.def modify_model_config(new_model_config: Dict[str, Any], test_model_saved_name: str) -> Dict[str, Any]: """ Modify the model configuration and update the model. Args: new_model_config: The sample model configuration to be modified. Example usage: { "model_saved_name": "example_model_name", # The name under which the model is saved. "testing_for": "LLM", # The purpose for which the model is being tested. (Always LLM) "model_name": "example_model", # The name of the model. (e.g., gpt-4o, claude-3-5-sonnet, etc.) "modality": "text", # The type of data the model works with (e.g., text, image). "model_config": { "model_version": "1.0", # The version of the model. "model_provider": "example_provider", # The provider of the model. (e.g., openai, anthropic, etc.) "endpoint_url": "https://api.example.com/model", # The endpoint URL for the model. "apikey": "example_api_key", # The API key to access the model. }, } test_model_saved_name: The saved name of the model to be tested. Returns: A dictionary containing the response message and details of the modified model. """ # Modify model configuration # Update the model_saved_name if needed # new_model_config["model_saved_name"] = "New Model Name" old_model_saved_name = None if new_model_config["model_saved_name"] != test_model_saved_name: old_model_saved_name = test_model_saved_name modify_response = model_client.modify_model(old_model_saved_name=old_model_saved_name, config=new_model_config) # Print as a dictionary return modify_response.to_dict()