Skip to content

fix(databricks): update Unity Gateway model mappings - #43158

Closed
Ryanakml wants to merge 4 commits into
BerriAI:mainfrom
Ryanakml:litellm_databricks_unity_catalog_model_map
Closed

Ryanakml wants to merge 4 commits into
BerriAI:mainfrom
Ryanakml:litellm_databricks_unity_catalog_model_map

Conversation

@Ryanakml

@Ryanakml Ryanakml commented Sep 25, 2026 •

Copy link
Copy Markdown

TLDR

Problem this solves:

  • /v1/models advertises a retired Databricks Sonnet 5 name
  • Unity Catalog Sonnet 5 requests report zero cost

How it solves it:

  • Register Sonnet 5 under its system.ai model name
  • Preserve pricing for the legacy endpoint identifier

User Flow

Before: a developer using a wildcard Databricks route receives an obsolete Sonnet 5 model name and cannot use the replacement with correct cost tracking

  1. They configure LiteLLM with model_name: "databricks/*"
  2. They send GET https://litellm-domain/v1/models
  3. The response includes databricks/databricks-claude-sonnet-5
  4. Using that model returns Databricks 403 PERMISSION_DENIED
  5. Using databricks/system.ai.claude-sonnet-5 instead records zero cost

After: the same wildcard route exposes the Unity Catalog model name with correct pricing

  1. They configure LiteLLM with model_name: "databricks/*"
  2. They send GET https://litellm-domain/v1/models
  3. The response includes databricks/system.ai.claude-sonnet-5
  4. Requests using that identifier use the existing Sonnet 5 pricing
  5. Legacy Sonnet 5 references still resolve to the same pricing

Relevant issues

Fixes #43146

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

A live Databricks E2E run was not available for this change.

The reported provider-side failure is the 403 PERMISSION_DENIED from #43146 when using databricks-claude-sonnet-5.

Local regression coverage confirms the LiteLLM-side paths changed by this PR:

  • wildcard Databricks model discovery now returns databricks/system.ai.claude-sonnet-5
  • the obsolete databricks/databricks-claude-sonnet-5 is no longer advertised
  • databricks/system.ai.claude-sonnet-5 resolves to non-zero pricing
  • legacy Sonnet 5 cost lookup resolves to the same pricing

Local validation:

uv run pytest tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py -v
28 passed

uv run pytest tests/test_litellm/llms/databricks/ -v
83 passed, 13 skipped

Type

🐛 Bug Fix

Caveats (if any)

Medium

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Updates Databricks model name mappings and cost lookups.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR replaces retired Databricks registry names with Unity Catalog names and retains legacy pricing and metadata lookups through provider-specific aliases.

  • The latest commit moves Databricks alias handling into DatabricksModelInfo and adds regression coverage for its registration.

Reviews (4) · Last reviewed commit: "fix(databricks): encapsulate provider mo..."

Comment thread model_prices_and_context_window.json
@codspeed

codspeed Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing Ryanakml:litellm_databricks_unity_catalog_model_map (2da7f37) with main (081f73f)

Open in CodSpeed

@codecov

codecov Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.55172% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/llms/databricks/cost_calculator.py 94.44% 1 Missing ⚠️
litellm/utils.py 94.44% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Ryanakml

Copy link
Copy Markdown
Author

@greptileai please re-review the latest commit.

Comment thread litellm/utils.py Outdated
@Ryanakml

Copy link
Copy Markdown
Author

@greptileai please re-review the latest commit.

@Ryanakml Ryanakml changed the title fix(databricks): update Sonnet 5 Unity Catalog model map fix(databricks): update Unity Gateway model mappings Sep 25, 2026
Comment thread litellm/utils.py Outdated
@Ryanakml

Copy link
Copy Markdown
Author

@greptileai please re-review the latest commit.

@Ryanakml

Copy link
Copy Markdown
Author

Closing this out — it has gone stale and is no longer something I can maintain. Sorry for the noise, and thanks to the maintainers for the review. Feel free to reopen if it's ever useful.

@Ryanakml

Copy link
Copy Markdown
Author

Closed as stale — I can't keep this maintained. Sorry for the noise.

@Ryanakml Ryanakml closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Databricks model map needs to be updated for Unity Gateway

1 participant