<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom model serving using Databricks Asset Bundles in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/custom-model-serving-using-databricks-asset-bundles/m-p/112886#M3997</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/153881"&gt;@MLOperator&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since &lt;A href="https://docs.databricks.com/api/workspace/servingendpoints/create#config-served_entities" target="_blank"&gt;model_serving_endpoints&lt;/A&gt; only accepts a version number of a served entity, I think that is not possible. However, the &lt;A href="https://docs.databricks.com/api/workspace/modelversions/getbyalias" target="_self"&gt;get-by-alias version API&lt;/A&gt; can be used to retrieve a version number from a model alias name.&amp;nbsp; Then the model name and its version can be&amp;nbsp;passed as variables.&lt;/P&gt;
&lt;P&gt;As an example, I tested the following configuration:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;PRE&gt;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'&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;When deploying it, the variables can be assigned like below. I'm using "champion" as the alias name:&lt;/P&gt;
&lt;PRE&gt;export BUNDLE_VAR_model_name="catalog_name.schema_name.model_name"&lt;BR /&gt;export BUNDLE_VAR_model_champion_version=`databricks model-versions get-by-alias $BUNDLE_VAR_model_name champion |grep '"version":' |sed -r 's/.+:(.+)/\1/'`&lt;BR /&gt;databricks bundle deploy&lt;/PRE&gt;
&lt;P&gt;Not ideal, but it worked. I hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Mar 2025 05:22:08 GMT</pubDate>
    <dc:creator>koji_kawamura</dc:creator>
    <dc:date>2025-03-18T05:22:08Z</dc:date>
    <item>
      <title>Custom model serving using Databricks Asset Bundles</title>
      <link>https://community.databricks.com/t5/machine-learning/custom-model-serving-using-databricks-asset-bundles/m-p/112855#M3996</link>
      <description>&lt;P&gt;I am using MLFlow to register custom model (python model) in Unity Catalog, and Databricks Asset Bundle to create a serving endpoint for that custom model.&amp;nbsp;&lt;BR /&gt;I was able to create the serving endpoint using DABs, but I want to deploy the model by using custom alias instead of the entity_version.&lt;/P&gt;&lt;P&gt;Is it possible to create a serving endpoint of a registered model by alias using DABs?&amp;nbsp;&lt;BR /&gt;I want something like this to define the&amp;nbsp;entity_name: 'myCatalog.mySchema.my-ads-model@myAlias'&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Bundle sample&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bundle:
  name: model_bundle

resources:
  model_serving_endpoints:
    uc_model_serving_endpoint:
      name: 'uc-model-endpoint'
      config:
        served_entities:
          - entity_name: 'myCatalog.mySchema.my-ads-model'
            entity_version: '10'
            workload_size: 'Small'
            scale_to_zero_enabled: 'true'
        traffic_config:
          routes:
            - served_model_name: 'my-ads-model-10'
              traffic_percentage: '100'
      tags:
        - key: 'team'
          value: 'data science'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 21:49:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/custom-model-serving-using-databricks-asset-bundles/m-p/112855#M3996</guid>
      <dc:creator>MLOperator</dc:creator>
      <dc:date>2025-03-17T21:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom model serving using Databricks Asset Bundles</title>
      <link>https://community.databricks.com/t5/machine-learning/custom-model-serving-using-databricks-asset-bundles/m-p/112886#M3997</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/153881"&gt;@MLOperator&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since &lt;A href="https://docs.databricks.com/api/workspace/servingendpoints/create#config-served_entities" target="_blank"&gt;model_serving_endpoints&lt;/A&gt; only accepts a version number of a served entity, I think that is not possible. However, the &lt;A href="https://docs.databricks.com/api/workspace/modelversions/getbyalias" target="_self"&gt;get-by-alias version API&lt;/A&gt; can be used to retrieve a version number from a model alias name.&amp;nbsp; Then the model name and its version can be&amp;nbsp;passed as variables.&lt;/P&gt;
&lt;P&gt;As an example, I tested the following configuration:&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;PRE&gt;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'&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;When deploying it, the variables can be assigned like below. I'm using "champion" as the alias name:&lt;/P&gt;
&lt;PRE&gt;export BUNDLE_VAR_model_name="catalog_name.schema_name.model_name"&lt;BR /&gt;export BUNDLE_VAR_model_champion_version=`databricks model-versions get-by-alias $BUNDLE_VAR_model_name champion |grep '"version":' |sed -r 's/.+:(.+)/\1/'`&lt;BR /&gt;databricks bundle deploy&lt;/PRE&gt;
&lt;P&gt;Not ideal, but it worked. I hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 05:22:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/custom-model-serving-using-databricks-asset-bundles/m-p/112886#M3997</guid>
      <dc:creator>koji_kawamura</dc:creator>
      <dc:date>2025-03-18T05:22:08Z</dc:date>
    </item>
  </channel>
</rss>

