Skip to content

feat(model_prices): add databricks kimi k3, databricks glm 5.2 and zai glm 5.3 - #38415

Closed
devin-ai-integration[bot] wants to merge 5 commits into
litellm_internal_stagingfrom
litellm_databricks_kimi_k3_glm_5_2
Closed

feat(model_prices): add databricks kimi k3, databricks glm 5.2 and zai glm 5.3#38415
devin-ai-integration[bot] wants to merge 5 commits into
litellm_internal_stagingfrom
litellm_databricks_kimi_k3_glm_5_2

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Databricks Kimi K3 and GLM 5.2 are unmapped
  • Z.ai GLM 5.3 is unmapped too
  • Calls miss cost tracking and the UI dropdown

How it solves it:

  • Add all three to the price/context registry
  • Databricks prices derived from published DBU rates times $0.070
  • GLM 5.3 prices taken from Z.ai's pricing page

Note on the ticket title: the ticket said GLM 5.6, and the requester clarified they meant GLM 5.3. Databricks Foundation Model APIs do not host a GLM 5.3 endpoint yet, databricks-glm-5-2 is the only GLM they serve, so GLM 5.3 lands here as the Z.ai first-party model and the Databricks GLM entry stays at 5.2. When Databricks ships 5.3, that endpoint is a one-line follow-up.

User Flow

Before: someone calling Databricks Kimi K3 or GLM 5.2, or Z.ai GLM 5.3, through the gateway can only pick them by hand, and every call logs as unknown with no spend

  1. They open https://litellm-domain/ui/?page=llm-playground and look for Kimi K3 or GLM 5.2 under a Databricks credential, or GLM 5.3 under a Z.ai credential, and none of them show up in the model dropdown
  2. They add the deployment manually and send POST https://litellm-domain/v1/chat/completions with "model": "databricks-kimi-k3"
  3. The completion comes back fine, but https://litellm-domain/ui/?page=logs shows the request at $0.00 spend, and max input tokens is blank on the model page
  4. Sending a 300k token prompt gets rejected by the provider after the fact rather than being sized against a known 1M window

After: all three models are known, so they appear in the dropdown and bill at published rates

  1. They open https://litellm-domain/ui/?page=llm-playground, and databricks/databricks-kimi-k3, databricks/databricks-glm-5-2 and zai/glm-5.3 are selectable under the matching credential
  2. They send the same POST https://litellm-domain/v1/chat/completions with "model": "databricks-kimi-k3"
  3. https://litellm-domain/ui/?page=logs shows the request at real spend, $3.00 per million input tokens and $15.00 per million output tokens for Kimi K3, $1.40 and $4.40 for both GLM entries, with cached input tokens billed at the lower cache read rate
  4. https://litellm-domain/ui/?page=models reports a 1,000,000 token input window for all three

Relevant issues

Linear ticket

Resolves LIT-6281

Pre-Submission checklist

  • I have added meaningful tests (dropped at the requester's ask; this is a registry-data change and the existing databricks and zai suites already cover the new entries)
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/test_litellm/<your_test_file>.py -v
  • 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
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

UI before and after are coming from the requester, who has Databricks and Z.ai keys. Steps they are running, same steps on both commits:

  1. git checkout <commit>, then python litellm/proxy/proxy_cli.py --config litellm/proxy/dev_config.yaml --detailed_debug
  2. Open http://localhost:4000/ui/?page=models, go to the Add Model tab, pick provider Databricks, and open the model name dropdown, looking for databricks-kimi-k3 and databricks-glm-5-2
  3. Same page, pick provider Z.ai and look for glm-5.3 in the dropdown
  4. Add one of them with a real key, send a short chat from http://localhost:4000/ui/?page=llm-playground
  5. Open http://localhost:4000/ui/?page=logs and check the spend on that request

Before is 52b7bea, where the dropdowns do not list any of the three and a manually added deployment logs at $0.00. After is 111f776, where all three are listed and the request logs at real spend.

I have no Databricks token or Z.ai key here, so the run below is only the registry lookup the proxy does before it prices a request, captured at the merge base and at the PR tip with the same script.

Setup, run from the repo root:

cat > /tmp/lookup.py <<'EOF'
import os, litellm
os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"
litellm.model_cost = litellm.get_model_cost_map(url="")
for m, p in (("databricks/databricks-kimi-k3", "databricks"), ("databricks/databricks-glm-5-2", "databricks"), ("zai/glm-5.3", "zai")):
    try:
        i = litellm.get_model_info(model=m, custom_llm_provider=p)
        print(m, i["max_input_tokens"], i["max_output_tokens"], i["input_cost_per_token"], i["output_cost_per_token"], i["cache_read_input_token_cost"])
    except Exception as e:
        print(m, "ERROR", type(e).__name__, str(e)[:90])
EOF

Before (52b7bea)

  1. python /tmp/lookup.py
  2. Output:
databricks/databricks-kimi-k3 ERROR Exception This model isn't mapped yet. model=databricks/databricks-kimi-k3, custom_llm_provider=data
databricks/databricks-glm-5-2 ERROR Exception This model isn't mapped yet. model=databricks/databricks-glm-5-2, custom_llm_provider=data
zai/glm-5.3 ERROR Exception This model isn't mapped yet. model=zai/glm-5.3, custom_llm_provider=zai. Add it here - htt

After (111f776)

  1. python /tmp/lookup.py
  2. Output, columns are max input tokens, max output tokens, input cost, output cost, cache read cost:
databricks/databricks-kimi-k3 1000000 1048576 2.99999e-06 1.500002e-05 3.0002e-07
databricks/databricks-glm-5-2 1000000 131072 1.4e-06 4.39999e-06 2.5998e-07
zai/glm-5.3 1000000 128000 1.4e-06 4.4e-06 2.6e-07

Where the numbers come from

Databricks Foundation Model Serving DBU rates, https://www.databricks.com/product/pricing/foundation-model-serving, Kimi K3 at 42.857 input, 214.286 output and 4.286 cache read DBU per million tokens, GLM-5.2 at 20.000, 62.857 and 3.714, each multiplied by $0.070 per DBU to get the dollar fields

Databricks Foundation Model Serving DBU rates

Same page's pay-per-token calculator with GLM 5.2 selected, $1.40 input, $4.40 output, $0.26 cache read, which is the DBU math above

Databricks pay-per-token pricing for GLM 5.2

Z.ai pricing, https://docs.z.ai/guides/overview/pricing, GLM-5.3 at $1.4 input, $0.26 cached input and $4.4 output per million tokens, with cached input storage free for a limited time

Z.ai pricing for GLM-5.3

Type

🆕 New Feature

Caveats (if any)

Medium

  • Databricks has no GLM 5.3 endpoint yet, so the 5.3 entry is the Z.ai one and the Databricks GLM entry is 5.2
  • GLM 5.3 input and output rates match GLM 5.2 and 5.1 exactly, which is what Z.ai publishes today; its cached-input storage is listed as free for a limited time, so cache_creation_input_token_cost is 0 like the other zai entries

Low

  • Databricks does not publish a per-request output cap, so output ceilings come from the model vendors: Moonshot documents max_completion_tokens up to 1,048,576 for Kimi K3 (default 131,072), and Z.ai documents 128K max output for GLM 5.2 and 5.3
  • Databricks cache write rate is not published; set equal to the input rate, same as the GPT and Gemini entries
  • Databricks pay-per-token rate limits are 200k input tokens per minute and 10k to 20k output tokens per minute, separate from the 1M context

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/5cdd9e479af8434890f62de0876b076a

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

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

PR #38415 (BerriAI/litellm, author devin-ai-integration[bot]) has no labels — the enterprise label is absent, so it's out of scope. No GitHub or Linear changes made; no risk label applied and routing did not run.

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

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds Databricks registry entries for Kimi K3 and GLM 5.2, including pricing, context limits, and capability metadata.

  • Synchronizes both primary and backup model-price maps.
  • Adds pricing, context-window, modality, and map-parity tests for both endpoints.
  • Leaves minor gaps in cache-write validation and accuracy of the new pricing notes.

Confidence Score: 4/5

The PR appears safe to merge, with non-blocking improvements recommended for cache-write pricing coverage and metadata accuracy.

The new registry entries are synchronized and their principal prices and limits are tested, but the cache-creation rate is not included in the dedicated assertions and the notes misidentify the fields used by production billing.

Files Needing Attention: model_prices_and_context_window.json, litellm/model_prices_and_context_window_backup.json, tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds both model definitions with synchronized prices and capabilities; the new notes inaccurately describe which pricing fields drive billing.
litellm/model_prices_and_context_window_backup.json Mirrors the primary registry entries exactly, including the same inaccurate calculation notes.
tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py Adds useful registry coverage but omits model-specific validation of the newly supplied cache-creation rates.

Reviews (1): Last reviewed commit: "feat(model_prices): add databricks kimi ..." | Re-trigger Greptile

Comment thread tests/test_litellm/llms/databricks/test_databricks_cost_calculator.py Outdated
Comment thread model_prices_and_context_window.json Outdated
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@devin-ai-integration devin-ai-integration Bot changed the title feat(model_prices): add databricks kimi k3 and glm 5.2 endpoints feat(model_prices): add databricks kimi k3, databricks glm 5.2 and zai glm 5.3 Aug 26, 2026
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_databricks_kimi_k3_glm_5_2 (111f776) with litellm_internal_staging (f57e4b8)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (77765fd) during the generation of this report, so f57e4b8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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

Copy link
Copy Markdown
Contributor Author

Fixed in 111f776: the note now says billing reads the per-token dollar fields and the DBU fields are reference only

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Moot now: the added tests were dropped at the requester's ask, so the cache write assertion no longer exists here

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Closing in favor of the rolling registry PR #38207, which now carries these Databricks and Z.AI entries after re-verifying every rate against the provider pricing pages

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.

1 participant