You can now use shadow traffic to test a deployment on real production requests before you promote it. A shadow rule copies a percentage of an environment's requests to another environment or deployment of the same model. Clients only get responses from the source, and each rule expires within 7 days.
Create a rule from the dashboard, the Baseten CLI, or the Management API, with a request body like this one sent to PATCH /v1/models/{model_id}/environments/production:
{
"traffic_routing_settings": {
"rules": [{
"type": "SHADOW",
"targets": [{"environment": "staging"}],
"percent_traffic": 25,
"expires_at": "<EXPIRES_AT>",
"propagate_client_cancellation": true
}]
}
}For more information, see our docs.