Skip to content

Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter#20037

Merged
AveshCSingh merged 4 commits intomlflow:masterfrom
xsh310:stack/remove-databricks_serving_endpoint_adapter-and-direct-databricks-managed-models-to-litellm-adapter
Jan 21, 2026
Merged

Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter#20037
AveshCSingh merged 4 commits intomlflow:masterfrom
xsh310:stack/remove-databricks_serving_endpoint_adapter-and-direct-databricks-managed-models-to-litellm-adapter

Conversation

@xsh310
Copy link
Collaborator

@xsh310 xsh310 commented Jan 15, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Related Issues/PRs

#xxx

What 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?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Manual Testing

Tested with this notebook: https://e2-dogfood.staging.cloud.databricks.com/editor/notebooks/3782812667401322?o=6051921418418893

Verified that the following is working:

  • LLM judge invocation: Databrick-manged OpenAI models, Gemini models, Claude models
  • Agent-as-judge: Databrick-managed OpenAI, Gemini models
  • create_deepeval_model and create_ragas_model still works
  • Conversation Simulation with databricks model

Verified 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?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/tracking: Tracking Service, tracking client APIs, autologging
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/evaluation: MLflow model evaluation features, evaluation metrics, and evaluation workflows
  • area/gateway: MLflow AI Gateway client APIs, server, and third-party integrations
  • area/prompts: MLflow prompt engineering features, prompt templates, and prompt management
  • area/tracing: MLflow Tracing features, tracing APIs, and LLM tracing functionality
  • area/projects: MLproject format, project running backends
  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages

How 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" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

Yes should be selected for bug fixes, documentation updates, and other small changes. No should 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?
  • Minor release: a release that increments the second part of the version number (e.g., 1.2.0 -> 1.3.0).
    Bug fixes, doc updates and new features usually go into minor releases.
  • Patch release: a release that increments the third part of the version number (e.g., 1.2.0 -> 1.2.1).
    Bug fixes and doc updates usually go into patch releases.
  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)

@xsh310 xsh310 changed the title remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter Remove databricks serving endpoint adapter and redirect databricks managed models to litellm adapter Jan 15, 2026
@xsh310 xsh310 marked this pull request as ready for review January 15, 2026 22:10
@github-actions
Copy link
Contributor

🛠 DevTools 🛠

Install mlflow from this PR

# mlflow
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/20037/merge
# mlflow-skinny
pip install git+https://github.com/mlflow/mlflow.git@refs/pull/20037/merge#subdirectory=libs/skinny

For Databricks, use the following command:

%sh curl -LsSf https://raw.githubusercontent.com/mlflow/mlflow/HEAD/dev/install-skinny.sh | sh -s pull/20037/merge

@github-actions github-actions bot added area/evaluation MLflow Evaluation rn/none List under Small Changes in Changelogs. labels Jan 15, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Documentation preview for e671f7b is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

@xsh310 xsh310 force-pushed the stack/remove-databricks_serving_endpoint_adapter-and-direct-databricks-managed-models-to-litellm-adapter branch from 1b384a8 to 062003c Compare January 15, 2026 22:28
@xsh310 xsh310 force-pushed the stack/remove-databricks_serving_endpoint_adapter-and-direct-databricks-managed-models-to-litellm-adapter branch from 062003c to a5cba14 Compare January 15, 2026 22:50
Copy link
Collaborator

@smoorjani smoorjani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be getting rid of this, right? Two points here:

  1. It seems like this should also be in the managed adapter (doesn't seem like it is right now)
  2. We should still have this in the case of a databricks:/... endpoint

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not skip tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm good catch, claude must have changed this after it was unable to import...

@xsh310 xsh310 force-pushed the stack/remove-databricks_serving_endpoint_adapter-and-direct-databricks-managed-models-to-litellm-adapter branch 2 times, most recently from ffea371 to c417406 Compare January 17, 2026 02:17
_suppress_litellm_nonfatal_errors = _SuppressLiteLLMNonfatalErrors()


def _record_judge_model_usage_success_databricks_telemetry(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@smoorjani smoorjani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to assert that nothing was recorded? can we also add this test for failure telemetry?

Copy link
Collaborator

@dbczumar dbczumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Can we get approval from @B-Step62 as well?

Copy link
Collaborator

@B-Step62 B-Step62 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

_suppress_litellm_nonfatal_errors = _SuppressLiteLLMNonfatalErrors()


def _record_judge_model_usage_success_databricks_telemetry(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move these telemetry methods out to a separate util?

xsh310 and others added 4 commits January 21, 2026 12:37
…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>
@xsh310 xsh310 force-pushed the stack/remove-databricks_serving_endpoint_adapter-and-direct-databricks-managed-models-to-litellm-adapter branch from ceaafbf to e671f7b Compare January 21, 2026 20:49
@xsh310
Copy link
Collaborator Author

xsh310 commented Jan 21, 2026

Updated PR to move telemetry methods to its own util file

@xsh310 xsh310 enabled auto-merge January 21, 2026 20:56
@AveshCSingh
Copy link
Collaborator

I'm going to force merge this PR since the CI failure of test_projects_cli.py is unrelated to this change.

@AveshCSingh AveshCSingh merged commit 6ed06c4 into mlflow:master Jan 21, 2026
82 of 86 checks passed
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 21, 2026
[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>
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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>
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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>
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
ispoljari added a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
daniellok-db pushed a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
daniellok-db pushed a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
daniellok-db pushed a commit to ispoljari/mlflow that referenced this pull request Jan 22, 2026
[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
harupy pushed a commit to harupy/mlflow that referenced this pull request Jan 28, 2026
…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>
harupy pushed a commit to harupy/mlflow that referenced this pull request Jan 28, 2026
…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>
harupy pushed a commit that referenced this pull request Jan 28, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/evaluation MLflow Evaluation rn/none List under Small Changes in Changelogs. v3.8.2 v3.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants