---
title: Diagnose model serving endpoints with Genie Code
description: Diagnose model serving endpoints with Genie Code. Check endpoint health, investigate high latency, and get configuration guidance.
canonical_url: https://docs.databricks.com/gcp/en/machine-learning/model-serving/model-serving-genie-code
---

# Diagnose model serving endpoints with Genie Code

> [!NOTE]
> **Preview**
>
> This feature is in [Public Preview](https://docs.databricks.com/gcp/en/release-notes/release-types.md).

Genie Code can help you diagnose issues, analyze performance, and get guidance for your model serving endpoints. This page covers how to open it on an endpoint page, what it can help with, and example prompts to try.

## Requirements

To use Genie Code for model serving observability, your workspace needs the following:

* Partner-powered AI features enabled for both the account and workspace. See [Partner-powered AI features](https://docs.databricks.com/gcp/en/databricks-ai/partner-powered.md).
* Your workspace must be in a supported region. Genie Code is a [Designated Service](https://docs.databricks.com/gcp/en/resources/designated-services.md) that uses Geos to manage data residency. See [Geo availability of Genie Code features](https://docs.databricks.com/gcp/en/genie-code/index.md#geo-availability).

> [!NOTE]
>
> Genie Code currently only supports custom model serving endpoints.

## <a id="get-started" /> Open Genie Code on an endpoint

1. Select **Serving** in the sidebar, then select the endpoint you want to check.
2. In the top bar, click ![Sparkle genie code icon.](https://docs.databricks.com/gcp/en/images/product-icons/SparkleGenieCodeIcon.svg) to open the Genie Code pane.
3. Enter a prompt describing what you need help with. For example, "Check the health of this endpoint" or "Why is my latency so high?"

## <a id="what-can-genie-code-help-with" /> Check, diagnose, and get guidance on endpoints

Genie Code can inspect your endpoints and provide recommendations, step-by-step instructions, and links to documentation.

![Genie Code pane on an endpoint page](https://docs.databricks.com/gcp/en/images/machine-learning/genie-code-endpoint-pane.png)

## <a id="capabilities" /> Review capabilities by job type

### Health checks and diagnostics

Genie Code can analyze your endpoint's status and configuration to identify potential issues:

* Check endpoint health and deployment states.
* Review configuration against best practices.
* Assess scaling and resource utilization.

### Troubleshooting and analysis

Genie Code can help resolve issues with your endpoints:

* Diagnose deployment failures using build logs, events, and endpoint state.
* Investigate high latency or timeout issues using metrics, events, and inference table data (when inference tables are turned on).
* Analyze error patterns from service logs and inference tables.
* Identify misconfigurations or resource constraints.
* Compare the served models in the current and pending configurations during an update, and rate the risk of each change as high, medium, or low.

### Guidance and best practices

Genie Code has recommendations based on your endpoint's configuration:

* Recommend optimal scaling configurations for production and development workloads.
* Explain endpoint states and transitions.
* Guide you on monitoring and observability setup.
* Search Databricks documentation and provide links to relevant articles.

## <a id="use-cases" /> Example prompts

The following sections provide example prompts you can use based on your observability goals.

### Health checks

* "Check the health of this endpoint."
* "Is my endpoint configured correctly?"
* "Review my endpoint's scaling configuration."

### Deployment failures

* "/diagnose" or "Why did my deployment fail?"
* "Help me fix deployment errors."
* "My endpoint is stuck in a pending state."

### Latency debugging

* "Why is my latency so high?"
* "Analyze the latency spike from this morning."
* "Show me the performance metrics for the last 24 hours."

### Configuration review

* "What changed in my pending configuration?"
* "Is my concurrency setting appropriate for production?"
* "Show me my inference table configuration."

### Request history

* "Show me recent requests to this endpoint."
* "What errors are my users hitting?"
* "Analyze error patterns from the last week."

## <a id="additional-resources" /> Additional resources

* [Genie Code](https://docs.databricks.com/gcp/en/genie-code/index.md)
* [Genie Code features and capabilities](https://docs.databricks.com/gcp/en/genie-code/features-capabilities.md)
* [Monitor Model Serving endpoints](https://docs.databricks.com/gcp/en/machine-learning/model-serving/monitor-diagnose-endpoints.md)
* [Troubleshoot Model Serving endpoints](https://docs.databricks.com/gcp/en/machine-learning/model-serving/model-serving-debug.md)
* [Optimize Model Serving endpoints for production](https://docs.databricks.com/gcp/en/machine-learning/model-serving/production-optimization.md)
