Add support for querying Unity Catalog model services - #1584
Open
billiam-wang wants to merge 1 commit into
Open
billiam-wang wants to merge 1 commit into
billiam-wang wants to merge 1 commit into
Conversation
Adds a ModelServicesExt mixin so w.model_services.get_open_ai_client() queries Unity Catalog v3 system.ai.* model services via the AI Gateway, mirroring the existing ServingEndpointsExt query surface. Co-authored-by: Isaac <no-reply@databricks.com> Signed-off-by: Bill Wang <bill.wang@databricks.com>
billiam-wang
force-pushed
the
add-model-services-query-helper
branch
from
September 28, 2026 21:34
cb19f34 to
4fa28d2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
ModelServicesExtmixin exposingw.model_services.get_open_ai_client()andget_langchain_chat_open_ai_client(), so users can query model services (model APIs) through Unity Gateway. A model service is a Unity Catalog securable that represents a governed LLM endpoint. The returned client targets{host}/ai-gateway/mlflow/v1with refreshed Databricks bearer auth; the model service's Unity Catalog three-level name (e.g.system.ai.claude-sonnet-4-5) is passed asmodel. This mirrors the existingServingEndpointsExtquery surface.Usage
Note for maintainers
w.model_serviceshas no backing generated API, so the wiring in the generateddatabricks/sdk/__init__.pywas added by hand. It likely needs to move into the SDK generator config to survive regeneration.Testing
Added
tests/test_model_services_mixin.pymirroringtest_open_ai_mixin.py(base URL, reserved-param guard, bearer-auth wiring). Verified locally that the client resolves to/ai-gateway/mlflow/v1and the guard raises.This pull request and its description were written by Isaac.