Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter#20037
Conversation
🛠 DevTools 🛠
Install mlflow from this PRFor Databricks, use the following command: |
|
Documentation preview for e671f7b is available at: More info
|
1b384a8 to
062003c
Compare
062003c to
a5cba14
Compare
smoorjani
left a comment
There was a problem hiding this comment.
left a few comments about telemetry and tests, but mostly LGTM. Thanks for the fix and extensive testing!
| {"databricks.agents.telemetry": mock_telemetry_module}, | ||
| ), | ||
| ): | ||
| _record_judge_model_usage_success_databricks_telemetry( |
There was a problem hiding this comment.
I don't think we should be getting rid of this, right? Two points here:
- It seems like this should also be in the managed adapter (doesn't seem like it is right now)
- We should still have this in the case of a
databricks:/...endpoint
There was a problem hiding this comment.
Makes sense, mirrored the telemetry related ones in test_litellm_adapter.py
| ], | ||
| ) | ||
| @pytest.mark.parametrize("with_trace", [False, True]) | ||
| def test_invoke_judge_model_databricks_success_not_in_databricks( |
There was a problem hiding this comment.
can we ensure we still have coverage for databricks model URIs via invoke_judge_model? similar to the note above - we should ensure that the appropriate telemetry (and any other databricks-specific behaviors) are being triggered.
| assert model.__class__.__name__ == "DatabricksServingEndpointDeepEvalLLM" | ||
| assert model.get_model_name() == "databricks:/my-endpoint" | ||
| assert model.__class__.__name__ == "LiteLLMModel" | ||
| assert "my-endpoint" in model.get_model_name() |
There was a problem hiding this comment.
can we assert on exact format instead of using in? We may also want to check provider if this is split up
|
|
||
| from mlflow.exceptions import MlflowException | ||
|
|
||
| # Import phoenix.evals - skip tests if not available or incompatible version |
There was a problem hiding this comment.
we should not skip tests
There was a problem hiding this comment.
hmm good catch, claude must have changed this after it was unable to import...
ffea371 to
c417406
Compare
| _suppress_litellm_nonfatal_errors = _SuppressLiteLLMNonfatalErrors() | ||
|
|
||
|
|
||
| def _record_judge_model_usage_success_databricks_telemetry( |
There was a problem hiding this comment.
Aligned with @smoorjani offline that we will keep the telemetry for databricks-served models for now in litellm adapter before we reassess whether it is still needed.
smoorjani
left a comment
There was a problem hiding this comment.
LGTM, left two minor comments to address before merging. Thanks!
| usage = getattr(response, "usage", None) | ||
| prompt_tokens = getattr(usage, "prompt_tokens", None) if usage else None | ||
| completion_tokens = getattr(usage, "completion_tokens", None) if usage else None | ||
| return message.content, total_cost, request_id, prompt_tokens, completion_tokens |
There was a problem hiding this comment.
can we use a dataclass for this instead of returning a tuple?
| mock_job_run_id.assert_called_once() | ||
|
|
||
|
|
||
| def test_record_success_telemetry_without_databricks_agents(): |
There was a problem hiding this comment.
is it possible to assert that nothing was recorded? can we also add this test for failure telemetry?
| _suppress_litellm_nonfatal_errors = _SuppressLiteLLMNonfatalErrors() | ||
|
|
||
|
|
||
| def _record_judge_model_usage_success_databricks_telemetry( |
There was a problem hiding this comment.
Can we move these telemetry methods out to a separate util?
…naged models to litellm adapter Signed-off-by: Xiang Shen <xshen.shc@gmail.com>
Signed-off-by: Xiang Shen <xshen.shc@gmail.com>
…y tests Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Xiang Shen <xshen.shc@gmail.com>
…lpers out of litellm adapter into its own util file Signed-off-by: Xiang Shen <xshen.shc@gmail.com>
ceaafbf to
e671f7b
Compare
|
Updated PR to move telemetry methods to its own util file |
|
I'm going to force merge this PR since the CI failure of |
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width [ML-61125]: resolve conflict
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width [ML-61125]: resolve conflict
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
[ML-61124]: update translation labels [ML-61124]: add feature flag Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> [ML-61125]: set shouldEnableWorkflowBasedNavigation to false [ML-61124]: sidebar width
…naged models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…naged models to litellm adapter (mlflow#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
…naged models to litellm adapter (#20037) Signed-off-by: Xiang Shen <xshen.shc@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
🥞 Stacked PR
Use this link to review incremental changes.
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
Remove the databricks serving endpoint adapter to reduce the number of code paths that we have to manage. Databricks managed models will be redirected to litellm adapter instead.
How is this PR tested?
Manual Testing
Tested with this notebook: https://e2-dogfood.staging.cloud.databricks.com/editor/notebooks/3782812667401322?o=6051921418418893
Verified that the following is working:
create_deepeval_modelandcreate_ragas_modelstill worksVerified that the following is not working:
Agent-as-judge: Databrick-managed Claude model (Filed a ticket to follow up)
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/tracking: Tracking Service, tracking client APIs, autologgingarea/models: MLmodel format, model serialization/deserialization, flavorsarea/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registryarea/scoring: MLflow Model server, model deployment tools, Spark UDFsarea/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflowsarea/gateway: MLflow AI Gateway client APIs, server, and third-party integrationsarea/prompts: MLflow prompt engineering features, prompt templates, and prompt managementarea/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionalityarea/projects: MLproject format, project running backendsarea/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/build: Build and test infrastructure for MLflowarea/docs: MLflow documentation pagesHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Yesshould be selected for bug fixes, documentation updates, and other small changes.Noshould be selected for new features and larger changes. If you're unsure about the release classification of this PR, leave this unchecked to let the maintainers decide.What is a minor/patch release?
Bug fixes, doc updates and new features usually go into minor releases.
Bug fixes and doc updates usually go into patch releases.