Proposal: Databricks Unity AI Gateway model class for apache-airflow-providers-common-ai #67581
-
|
Hello Airflow maintainers and community. I am an enterprise AI/ML architect and a daily user of Databricks Unity AI Gateway (formerly Mosaic AI Gateway) in production. I am opening this as my first contribution thread to apache/airflow to propose adding a Databricks model class to apache-airflow-providers-common-ai, and to ask the maintainers to choose between two implementation paths before any PR lands. I would like to align on direction before writing code so that the work fits cleanly into the AIP-99 "Common Data Access Pattern + AI" scope and does not collide with the upstream pydantic-ai effort. GA: https:///serving-endpoints (the existing model serving surface, formerly fronted by Mosaic AI Gateway features). Both surfaces speak the OpenAI Chat Completions schema, except that message.content is typed str | list[ContentItem] rather than str | None. That is exactly the divergence tracked by pydantic-ai issue pydantic/pydantic-ai#2947 and PR pydantic/pydantic-ai#4036 by @aayushchou-db, which is currently in draft (the author wrote, verbatim, "Converting this to draft, just so I can iron out the auth a bit more!"). Support both base URLs (GA /serving-endpoints and Beta /ai-gateway/mlflow/v1) selected by a simple surface connection field. The fork in the road AI Gateway feature toggles on the client side (rate limits, guardrails, payload logging configuration via PUT /api/2.0/serving-endpoints/{name}/ai-gateway). Defer to a follow-up. Alignment with AIP-99 Path A or Path B? This is the blocker. Closing |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Thanks for the detailed writeup, @aman210122. Path A, gated on a pydantic-ai release (not just the merge). Quick correction on the upstream status: pydantic/pydantic-ai#4036 is no longer in draft. It's open, ~3,400 lines, 42 commits, 63 review comments, assigned to @DouweM, last activity Apr 6. So the "blocked on upstream timing" framing for Path B is weaker than the proposal suggests. The work is happening, the bottleneck is review on that PR. Why Path A:
Why "wait for the release," not just the merge: The On the other questions:
The AI Gateway feature toggles, embeddings, agent-specific bits are correctly out of v1 scope. Concretely: nothing to open on apache/airflow right now. Let's watch pydantic/pydantic-ai#4036 land and get into a pydantic-ai release, and then the common.ai PR is small and mechanical. Happy to review it when that point comes. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @kaxil, agreed on Path A and gating on a pydantic-ai release. Confirmed on home (common.ai), connection type (pydanticai-databricks), pip extra (databricks), CI approach (pydantic-ai test doubles), and surface selection (connection extra field). I will track pydantic/pydantic-ai#4036 and engage on review there where I can be useful on the Databricks workspace auth side. Will open the common.ai PR matching your shape once a release ships with DatabricksModel. Appreciate the guidance. |
Beta Was this translation helpful? Give feedback.
Thanks for the detailed writeup, @aman210122.
Path A, gated on a pydantic-ai release (not just the merge).
Quick correction on the upstream status: pydantic/pydantic-ai#4036 is no longer in draft. It's open, ~3,400 lines, 42 commits, 63 review comments, assigned to @DouweM, last activity Apr 6. So the "blocked on upstream timing" framing for Path B is weaker than the proposal suggests. The work is happening, the bottleneck is review on that PR.
Why Path A:
pydantic-aiModels rather than fork them. A local subclass ofOpenAIChatModelhere would duplicate a 3.4k-line PR that's still under active review, and we'd inher…