$npx -y skills add datarobot-oss/datarobot-agent-skills --skill datarobot-model-deploymentTools and guidance for deploying DataRobot models, managing deployments, configuring prediction environments, and deployment operations. Use when deploying models, creating or updating deployments, or configuring prediction environments.
| 1 | # DataRobot Model Deployment Skill |
| 2 | |
| 3 | This skill provides comprehensive guidance for deploying models, managing deployment configurations, and operating production deployments. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | **Most common use case**: Deploy a trained model to production |
| 8 | |
| 9 | 1. **Get best model**: Find the best model from a project (highest metric score) |
| 10 | 2. **Create deployment**: `create_deployment(model_id, deployment_name)` to deploy model |
| 11 | 3. **Get endpoint**: `get_deployment_endpoint(deployment_id)` to retrieve prediction URL |
| 12 | |
| 13 | **Example**: "Deploy the best model from project abc123 as 'Sales Prediction v1'" |
| 14 | |
| 15 | ## When to use this skill |
| 16 | |
| 17 | Use this skill when you need to: |
| 18 | - Deploy trained models to production |
| 19 | - Configure deployment settings and environments |
| 20 | - Manage multiple deployments |
| 21 | - Replace a deployment’s champion model with a new model version |
| 22 | - Configure prediction servers and environments |
| 23 | - Monitor deployment health and status |
| 24 | - Manage deployment access and permissions |
| 25 | |
| 26 | ## Key capabilities |
| 27 | |
| 28 | ### 1. Deployment Creation |
| 29 | |
| 30 | - Deploy models from projects or registered models |
| 31 | - Choose prediction environment (DataRobot Serverless, external) |
| 32 | - Configure deployment settings (challenger models, A/B testing) |
| 33 | - Set up deployment metadata and descriptions |
| 34 | |
| 35 | ### 2. Deployment Configuration |
| 36 | |
| 37 | - Configure prediction servers and environments |
| 38 | - Set up batch prediction settings |
| 39 | - Configure real-time prediction endpoints |
| 40 | - Manage deployment credentials and access |
| 41 | |
| 42 | ### 3. Deployment Management |
| 43 | |
| 44 | - Replace deployment champion model (model swap) |
| 45 | - Enable/disable deployments |
| 46 | - Manage challenger models for A/B testing |
| 47 | - Configure replacement policies |
| 48 | |
| 49 | ### 4. Deployment Operations |
| 50 | |
| 51 | - Get deployment information and status |
| 52 | - Retrieve deployment endpoints |
| 53 | - Manage deployment settings |
| 54 | - Handle deployment errors and issues |
| 55 | |
| 56 | ## Workflow examples |
| 57 | |
| 58 | ### Example 1: Deploy a model to production |
| 59 | |
| 60 | **User request**: "Deploy the best model from project abc123 to production with the name 'Sales Prediction v1'." |
| 61 | |
| 62 | **Agent workflow**: |
| 63 | 1. Get the best model from the project (highest metric score) |
| 64 | 2. Create a new deployment with the model |
| 65 | 3. Configure deployment settings (name, description, environment) |
| 66 | 4. Set up prediction environment (DataRobot Serverless recommended) |
| 67 | 5. Retrieve deployment endpoint and credentials |
| 68 | 6. Verify deployment is active and ready for predictions |
| 69 | |
| 70 | ### Example 2: Update deployment with new model |
| 71 | |
| 72 | **User request**: "Replace the model in deployment xyz789 with the latest model from project abc123." |
| 73 | |
| 74 | **Agent workflow**: |
| 75 | 1. Get the latest model from the project |
| 76 | 2. Retrieve current deployment information |
| 77 | 3. Validate the replacement model is eligible (`deployment.validate_replacement_model(...)`) |
| 78 | 4. Perform model replacement (`deployment.perform_model_replace(...)`) |
| 79 | 5. Verify replacement completed successfully |
| 80 | 6. Report deployment update status |
| 81 | |
| 82 | ## Using DataRobot SDK |
| 83 | |
| 84 | This skill guides you to use the DataRobot Python SDK directly. Install the SDK if needed: |
| 85 | |
| 86 | ```bash |
| 87 | pip install datarobot |
| 88 | ``` |
| 89 | |
| 90 | ### Key SDK Operations |
| 91 | |
| 92 | Use these DataRobot SDK methods for deployment management: |
| 93 | |
| 94 | **Deployments**: |
| 95 | - `dr.Deployment.create_from_learning_model(model_id, label)` - Create deployment |
| 96 | - `dr.Deployment.get(deployment_id)` - Get deployment details |
| 97 | - `dr.Deployment.list(project_id)` - List deployments |
| 98 | - `deployment.delete()` - Delete deployment |
| 99 | |
| 100 | **Model Replacement (champion swap)**: |
| 101 | - `deployment.validate_replacement_model(new_model_id=...)` - Validate replacement eligibility |
| 102 | - `deployment.perform_model_replace(new_model_id=..., reason=...)` - Replace champion model (async) |
| 103 | |
| 104 | **Challenger Models (limited via SDK)**: |
| 105 | - `deployment.list_challengers()` - List challenger models (if enabled/configured) |
| 106 | - `deployment.get_challenger_models_settings()` / `deployment.update_challenger_models_settings(...)` - Configure challenger models settings |
| 107 | |
| 108 | **Deployment Info**: |
| 109 | - `deployment.get_features()` - Get required features |
| 110 | |
| 111 | See the [Common Patterns](#common-patterns) section below for complete examples. |
| 112 | |
| 113 | ## Best practices |
| 114 | |
| 115 | 1. **Naming conventions**: Use clear, versioned names for deployments |
| 116 | 2. **Environment selection**: Choose appropriate prediction environment for your use case |
| 117 | 3. **Challenger models**: Use challenger models to test new models before full replacement |
| 118 | 4. **Monitoring**: Set up monitoring and alerts for production deployments |
| 119 | 5. **Documentation**: Document deployment purpose, model version, and configuration |
| 120 | 6. **Access control**: Configure appropriate access permissions for deployments |
| 121 | |
| 122 | ## Common patterns |
| 123 | |
| 124 | ### Pattern 1: Standard deployment |
| 125 | ```python |
| 126 | import datarobot as dr |
| 127 | import os |
| 128 | |
| 129 | # Initialize client |
| 130 | client = dr.Client( |
| 131 | token=os.getenv("DATAROBOT_API_TOKEN"), |
| 132 | end |