Hi @MLOperator
Since model_serving_endpoints only accepts a version number of a served entity, I think that is not possible. However, the get-by-alias version API can be used to retrieve a version number from a model alias name. Then the model name and its version can be passed as variables.
As an example, I tested the following configuration:
variables:
model_name:
model_champion_version:
resources:
model_serving_endpoints:
uc_model_serving_endpoint:
name: 'labuser9602087_1742260663_test'
config:
served_entities:
- entity_name: '${var.model_name}'
entity_version: '${var.model_champion_version}'
workload_size: 'Small'
scale_to_zero_enabled: 'true'
tags:
- key: 'team'
value: 'data science'
When deploying it, the variables can be assigned like below. I'm using "champion" as the alias name:
export BUNDLE_VAR_model_name="catalog_name.schema_name.model_name"
export BUNDLE_VAR_model_champion_version=`databricks model-versions get-by-alias $BUNDLE_VAR_model_name champion |grep '"version":' |sed -r 's/.+:(.+)/\1/'`
databricks bundle deploy
Not ideal, but it worked. I hope this helps!