cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Articles
Dive into a collaborative space where members like YOU can exchange knowledge, tips, and best practices. Join the conversation today and unlock a wealth of collective wisdom to enhance your experience and drive success.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

system.ai model names return 404 on /serving-endpoints with Unity Gateway enforcement off

rajavemuri
New Contributor II

Environment: one Azure Databricks workspace, pay-per-token foundation models, Enforce Unity Gateway off, requests sent with curl and a CLI-issued token.

Symptom. A request naming a Unity Catalog model service, system.ai.claude-haiku-4-5, sent to https://<workspace-host>/serving-endpoints/chat/completions returns:

HTTP 404
{"error_code":"ENDPOINT_NOT_FOUND","message":"The given endpoint does not exist, please retry after checking the specified model and version deployment exists."}

The same request to https://<workspace-host>/ai-gateway/mlflow/v1/chat/completions returns 200. The legacy endpoint name databricks-claude-haiku-4-5 on /serving-endpoints/chat/completions also returns 200. Embeddings split the same way. system.ai.gte-large-en is a 404 on /serving-endpoints/embeddings and a 200 with 1024 dimensions on /ai-gateway/mlflow/v1/embeddings.

Why it matters. The migration guide (https://learn.microsoft.com/azure/databricks/ai-gateway/migrate-to-unity-gateway) says to change the base URL from /serving-endpoints to /ai-gateway/mlflow/v1 and the model from the endpoint name to the fully qualified model service name, and that legacy configurations stay unchanged until Enforce Unity Gateway is turned on. Our legacy name answering is the sign enforcement was off. The 404 for the catalog name came anyway, so a client that lists system.ai names and sends them down the old path fails before any enforcement decision.

Reproduce it. Replace $HOST and $TOKEN:

BODY='{"model":"MODEL","messages":[{"role":"user","content":"Reply with OK"}],"max_tokens":8}'
for MODEL in system.ai.claude-haiku-4-5 databricks-claude-haiku-4-5; do
  for PATH_ in serving-endpoints ai-gateway/mlflow/v1; do
    printf '%s on /%s: ' "$MODEL" "$PATH_"
    curl -s -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
      -d "${BODY/MODEL/$MODEL}" "$HOST/$PATH_/chat/completions"
  done
done

Expected: the system.ai name is 404 on the first path and 200 on the second; the databricks- name is 200 on the first. We did not test the databricks- name on the gateway path or an enforcement-on workspace.

What we changed. Our product stores one URL per Databricks connection, usually the bare workspace host. Switching every bare host to the gateway path was proposed and rejected, because our workspace's custom-named serving endpoint is addressed under /serving-endpoints, the migration guide keeps existing provisioned throughput endpoints in place with a model service referencing them, and model discovery reads GET /api/2.0/serving-endpoints, which has no gateway counterpart. Instead the model name picks the path. For a stored URL with no path or exactly /serving-endpoints, a model id matching ^[^./]+\.[^./]+\.[^./]+$ goes to <origin>/ai-gateway/mlflow/v1 and any other id goes to <origin>/serving-endpoints; a stored URL with any other path is used as typed. Discovery keeps calling the serving-endpoints API with no model name.

Limits. One workspace, one run, enforcement off. A service principal with query rights on a serving endpoint and nothing on the model service may get PERMISSION_DENIED on the gateway path for a three-part name; those calls were 404 before. The embeddings docs page shows the Python SDK passing system.ai.gte-large-en to serving_endpoints.query, which we did not run; our REST call with that name on /serving-endpoints is the one above.

Longer write-up with the routing function: https://www.techfabric.com/blog/unity-catalog-model-names-return-404-on-serving-endpoints

1 REPLY 1

Yougasundar
Contributor

Thanks for the clear tests. I think the 404 is expected, and it is not linked to the enforcement setting.

The three-part names under system.ai are Unity Gateway model services, not serving endpoints. The /serving-endpoints paths look up an endpoint by its name, so system.ai.claude-haiku-4-5 is not found there, with or without enforcement. You query model services on the gateway paths (/ai-gateway/mlflow/v1/chat/completions, /embeddings or /responses), with the three-part name as the model.

โ€œEnforce Unity Gatewayโ€ works in the other direction. It does not make /serving-endpoints accept system.ai names. It blocks the legacy databricks-* pay-per-token endpoints, and those calls then return PERMISSION_DENIED.

So your routing by model name is a good pattern: three-part names go to /ai-gateway/mlflow/v1, and everything else goes to /serving-endpoints.

One note for the service principal case: CAN_QUERY on a serving endpoint does not give access to a model service. The caller needs USE CATALOG, USE SCHEMA and EXECUTE on the model service. When you move a workload to the gateway path, check these grants first.

Docs: https://docs.databricks.com/aws/en/ai-gateway/query-model-services