Skip to content

fix(databricks): price the openjev decision model at its published 0.6 DBU per 1M input tokens - #48694

Merged
kerry-berri merged 1 commit into
mainfrom
litellm_databricks_openjev_pricing
Oct 28, 2026
Merged

kerry-berri merged 1 commit into
mainfrom
litellm_databricks_openjev_pricing

Conversation

@kerry-berri

@kerry-berri kerry-berri commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Databricks now lists its OpenJev decision endpoint at 0.6 DBUs per 1M input tokens, but our cost-map row for it was still 0.0, so every /v1/decisions and /v1/systemone call to databricks/databricks-openjev-qwen35-4b logged $0 spend. This prices the row at that rate (converted at $0.070 per DBU like every other databricks row) so the proxy bills real spend for it. databricks/ai_decide stays at 0 because its response carries no token usage

Details

TLDR

Problem this solves:

  • Databricks openjev decision calls were billed at $0 even though usage comes back
  • The row was added before Databricks published a rate

How it solves it:

  • input_cost_per_token: 4.2e-08, input_dbu_cost_per_token: 6e-07 on the openjev row (0.6 DBU per 1M input tokens, read from the serving-endpoints API)
  • Cache read and write bill at the input rate, output stays 0
  • Suite cost-map row and the two openjev cost cases now expect 45 tokens -> 1.89e-06

User Flow

Before: a team routing System One decisions through Databricks sees $0 for every call

  1. They send POST https://litellm-domain/v1/decisions with "model": "databricks/databricks-openjev-qwen35-4b", an input string and one predicate question
  2. The 200 response carries usage.input_tokens: 45 and no x-litellm-response-cost header
  3. https://litellm-domain/ui/?page=logs shows the request at $0 spend

After: the same request is billed at the published Databricks rate

  1. They send the same POST https://litellm-domain/v1/decisions
  2. The 200 response carries usage.input_tokens: 45 and x-litellm-response-cost: 1.89e-06
  3. https://litellm-domain/ui/?page=logs shows the request at $0.00000189 spend, and /v1/systemone with the same state and question bills the same

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Two proxies on the same config against the real Databricks QA workspace, LITELLM_LOCAL_MODEL_COST_MAP=True on both so each prices from its own checkout's JSON. Before is a worktree at the merge base on port 4010, After is this branch on port 4000

model_list:
  - model_name: openjev
    litellm_params:
      model: databricks/databricks-openjev-qwen35-4b
      api_key: os.environ/DATABRICKS_API_KEY
      api_base: https://<workspace>.azuredatabricks.net/serving-endpoints

Before (e101449)

/v1/decisions

  1. curl -s -D - http://localhost:4010/v1/decisions -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"model":"openjev","input":"My order arrived broken and I want a refund today.","questions":[{"type":"predicate","name":"is_refund","instructions":"Is the customer asking for a refund?"}]}'
  2. HTTP/1.1 200 OK, no x-litellm-response-cost header, x-litellm-response-cost-input: 0.0, body {"model":"databricks-openjev-qwen35-4b","answers":[{"type":"predicate","name":"is_refund","probability":0.9046505248181417}],"usage":{"input_tokens":45,...,"total_tokens":45}}

/v1/systemone

  1. curl -s -D - http://localhost:4010/v1/systemone -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"model":"openjev","state":"My order arrived broken and I want a refund today.","questions":{"is_refund":{"type":"noul","instructions":"Is the customer asking for a refund?"}}}'
  2. HTTP/1.1 200 OK, no x-litellm-response-cost header, x-litellm-response-cost-input: 0.0, body {"model":"databricks-openjev-qwen35-4b","answers":{"is_refund":{"type":"noul","noul":0.9046505248181417}},"usage":{"input_tokens":45,"output_tokens":0}}

After (2ff2709)

/v1/decisions

  1. Same curl against http://localhost:4000/v1/decisions
  2. HTTP/1.1 200 OK, x-litellm-response-cost: 1.89e-06, x-litellm-response-cost-input: 1.89e-06, x-litellm-response-cost-output: 0.0, same body with "input_tokens":45

/v1/systemone

  1. Same curl against http://localhost:4000/v1/systemone
  2. HTTP/1.1 200 OK, x-litellm-response-cost: 1.89e-06, x-litellm-response-cost-input: 1.89e-06, x-litellm-response-cost-output: 0.0, same body with "input_tokens":45

45 tokens * 4.2e-08 = 1.89e-06, matching the integration cases databricks/databricks-openjev-qwen35-4b-decisions and -systemone, which pass locally through the harness proxy

Type

🐛 Bug Fix

Caveats (if any)

Low

  • Cache read and write rates are not published by Databricks, set equal to the input rate
  • databricks/ai_decide still bills 0 because its response has no usage block

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

Link to Devin session: https://app.devin.ai/sessions/c05717cfb3934484969dc926ff0bc6dd
Open in Devin Desktop: https://app.devin.ai/desktop/session/c05717cfb3934484969dc926ff0bc6dd?variant=devin
Requested by: @kerry-berri


Note

Low Risk
JSON and test-only pricing correction for one evaluation model; spend logs and cost headers will show non-zero values where they were previously $0, with no auth or routing changes.

Overview
Fixes $0 spend for databricks/databricks-openjev-qwen35-4b on /v1/decisions and /v1/systemone by setting input pricing from Databricks’s published 0.6 DBU per 1M input tokens (converted with the same $0.070/DBU rule as other Databricks rows).

The model cost map rows now use input_cost_per_token / input_dbu_cost_per_token of 4.2e-08 / 6e-07, cache read/write at the input rate (no separate cache rate published), and free output. Metadata notes were updated accordingly; databricks/ai_decide is unchanged at zero.

Integration cost_map and the two OpenJev decision/System One cases now expect 45 input tokens → 1.89e-06 spend instead of zero.

Reviewed by Cursor Bugbot for commit 2ff2709. Bugbot is set up for automated code reviews on this repo. Configure here.

…6 DBU per 1M input tokens

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@codspeed

codspeed Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 35 untouched benchmarks


Comparing litellm_databricks_openjev_pricing (2ff2709) with main (15eca24)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (8d30009) during the generation of this report, so 15eca24 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@joshua-berri joshua-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@kerry-berri

Copy link
Copy Markdown
Contributor Author

@BugBot run

@kerry-berri

Copy link
Copy Markdown
Contributor Author

@greptileai

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge

Summary

Sets the OpenJev input price to 4.2e-08 dollars per token in both price maps, using the stated 0.6 DBU per million tokens rate

Cache reads and writes use the input rate. Output remains free. The two billing cases now expect 1.89e-06 for 45 input tokens. No actionable issues were found

kerry-berri explicitly states that databricks/ai_decide remains zero because its response carries no token usage. This PR does not change that row

  • OpenJev decision calls now record their input-token cost.

Reviews (1) · Last reviewed commit: "fix(databricks): price the openjev decis..." · Reviewed by Greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2ff2709. Configure here.

@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kerry-berri
kerry-berri merged commit 017e08a into main Oct 28, 2026
92 of 93 checks passed
@kerry-berri
kerry-berri deleted the litellm_databricks_openjev_pricing branch October 28, 2026 01:49
@mateo-berri mateo-berri mentioned this pull request Oct 28, 2026
6 tasks done
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.

2 participants