Repository navigation
fix(databricks): price the openjev decision model at its published 0.6 DBU per 1M input tokens - #48694
Conversation
…6 DBU per 1M input tokens Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Merging this PR will not alter performance1 warning
Comparing Footnotes |
|
@BugBot run |
[Medium impact] The PR appears safe to merge SummarySets the OpenJev input price to Cache reads and writes use the input rate. Output remains free. The two billing cases now expect
Reviews (1) · Last reviewed commit: "fix(databricks): price the openjev decis..." · Reviewed by Greptile |
There was a problem hiding this comment.
✅ 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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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/decisionsand/v1/systemonecall todatabricks/databricks-openjev-qwen35-4blogged $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_decidestays at 0 because its response carries no token usageDetails
TLDR
Problem this solves:
How it solves it:
input_cost_per_token: 4.2e-08,input_dbu_cost_per_token: 6e-07on the openjev row (0.6 DBU per 1M input tokens, read from the serving-endpoints API)User Flow
Before: a team routing System One decisions through Databricks sees $0 for every call
"model": "databricks/databricks-openjev-qwen35-4b", an input string and one predicate questionusage.input_tokens: 45and nox-litellm-response-costheaderAfter: the same request is billed at the published Databricks rate
usage.input_tokens: 45andx-litellm-response-cost: 1.89e-06/v1/systemonewith the same state and question bills the samePre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
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 moreDelays 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=Trueon 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 4000Before (e101449)
/v1/decisions
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?"}]}'HTTP/1.1 200 OK, nox-litellm-response-costheader,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
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?"}}}'HTTP/1.1 200 OK, nox-litellm-response-costheader,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
http://localhost:4000/v1/decisionsHTTP/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
http://localhost:4000/v1/systemoneHTTP/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":4545 tokens * 4.2e-08 = 1.89e-06, matching the integration cases
databricks/databricks-openjev-qwen35-4b-decisionsand-systemone, which pass locally through the harness proxyType
🐛 Bug Fix
Caveats (if any)
Low
databricks/ai_decidestill bills 0 because its response has no usage blockFinal Attestation
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-4bon/v1/decisionsand/v1/systemoneby 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_tokenof4.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_decideis unchanged at zero.Integration cost_map and the two OpenJev decision/System One cases now expect 45 input tokens →
1.89e-06spend instead of zero.Reviewed by Cursor Bugbot for commit 2ff2709. Bugbot is set up for automated code reviews on this repo. Configure here.