VZLA
Databricks Employee
Databricks Employee
- viable_test.default.egg_chat does not exist, this is the issue I believe

I see. Let's ignore the "rag_chatbot.basic_rag_demo" error for now, and focus on the egg_chat.

 So, you stated in your details: "The model is registered in the Unity Catalog 'My organization' under the 'main' folder, I've tried switching the workspace default catalog to main but the problem still persists.". This indicates that the main catalog is where the model resides. Your config.yml includes: uc_functions: "main.egg_shop.*". This suggests that egg_shop is the schema intended for use with this model. The model name egg_chat is consistent throughout your responses, therefore assuming it’s the correct name, the fully qualified name (FQN) should logically be main.egg_shop.egg_chat (please correct me if I'm wrong), instead of viable_test. Viable_test may be getting prepended as default catalog perhaps? Not really sure, but it does sounds like we have to manually set it to be "main" instead.

Can you please run this code below once, from a notebook? It should check both UC and WMR, and ideally find and extract where it is registered if so along with metadata related to it, hope it helps:

from mlflow.tracking.client import MlflowClient
import mlflow

# Initialize MLflow client
client = MlflowClient()

# Specify the model's logical name or partial name to search for
search_model = "egg_chat"

# Function to search for models in a specific registry
def search_registry(uri, model_name):
    mlflow.set_registry_uri(uri)
    client = MlflowClient()
    models = client.search_registered_models()
    for model in models:
        if model_name in model.name:
            return model
    return None

# Check Unity Catalog first
mlflow.set_registry_uri("databricks-uc")
uc_model = search_registry("databricks-uc", search_model)

# If not found in UC, check Workspace Model Registry
if not uc_model:
    print("Model not found in Unity Catalog. Searching Workspace Model Registry...")
    workspace_model = search_registry(None, search_model)
else:
    workspace_model = None

# Function to print detailed model metadata
def print_model_details(model, registry_type):
    print(f"Model found in {registry_type}: {model.name}")
    parts = model.name.split(".")
    if len(parts) == 3:
        catalog, schema, model_name = parts
        print(f"Catalog: {catalog}, Schema: {schema}, Model: {model_name}")
    else:
        print(f"Model Name: {model.name}")
    
    print(f"Tags: {model.tags}")
    if model.latest_versions:
        for version in model.latest_versions:
            print(f" - Version: {version.version}")
            print(f"   Source: {version.source}")
            print(f"   Stage: {version.current_stage}")
            print(f"   Run ID: {version.run_id}")
    else:
        print("No versions available for this model.")

# Print results for both registries
if uc_model:
    print_model_details(uc_model, "Unity Catalog")
if workspace_model:
    print_model_details(workspace_model, "Workspace Model Registry")
if not uc_model and not workspace_model:
    print("Model not found in either Unity Catalog or Workspace Model Registry.")

Then update both the config.yml and agents.deploy as required.

Going back to the original code, what's the output you're getting from:

import mlflow
mlflow.set_registry_uri("databricks-uc")
model_uri = f"models:/main.egg_shop.egg_chat/1"
try:
    model_info = mlflow.models.get_model_info(model_uri)
    print(f"Model {model_name} version {model_version} exists.")
except mlflow.exceptions.MlflowException as e:
    print(f"Error: {e}")​

* Note: you may need to later on check on the model grants, or version, these other side issues should be straight forward to resolve.