Skip to content

feat(model_prices): add zai/glm-5.2 vendor entry - #38866

Closed
wait4xx wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
wait4xx:fix/zai-glm-5.2-vendor-entry
Closed

feat(model_prices): add zai/glm-5.2 vendor entry#38866
wait4xx wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
wait4xx:fix/zai-glm-5.2-vendor-entry

Conversation

@wait4xx

@wait4xx wait4xx commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Adds the official Z.AI vendor entry zai/glm-5.2 to model_prices_and_context_window.json and litellm/model_prices_and_context_window_backup.json.

The registry currently covers GLM-5.2 only through third-party deployments (dashscope/glm-5.2, together_ai/zai-org/GLM-5.2, deepinfra/zai-org/glm-5.2, cloudflare/@cf/zai-org/glm-5.2, novita/zai-org/glm-5.2, ...). The two-segment zai/ vendor entry is missing, so zai/glm-5.2 resolves without pricing/context metadata.

Values (per official docs)

Field Value Source
input_cost_per_token 1.4e-06 ($1.4/M) pricing page, GLM-5.2 row
cache_read_input_token_cost 2.6e-07 ($0.26/M) pricing page, "Cached Input"
cache_creation_input_token_cost 0 "Cached Input Storage: Limited-time Free"
output_cost_per_token 4.4e-06 ($4.4/M) pricing page, GLM-5.2 row
max_input_tokens 1000000 model page, "Context Length: 1M"
max_output_tokens 128000 model page, "Maximum Output Tokens: 128K"
capability flags function calling / prompt caching / reasoning / tool choice = true model page capability cards

Sources:

The entry mirrors sibling zai/glm-5.3 field-for-field: on the official pricing page GLM-5.2 and GLM-5.3 sit in the same row group ($1.4 / $0.26 / $4.4), and the model pages document the same 1M / 128K limits and the same capability set (text-only input/output, so no supports_vision, consistent with the sibling).

Tests

  • Both JSONs parse after the change
  • New blocks in the two files are byte-identical; git diff shows only the two +15-line additions
  • No duplicate zai/glm-5.2 key; no other registry entries touched

Adds the official Z.AI vendor entry for GLM-5.2 to
model_prices_and_context_window.json and the backup copy. GLM-5.2 was
previously covered only through third-party deployments (dashscope,
together_ai, deepinfra, cloudflare, ...); the two-segment zai/ vendor
entry is missing.

Values per official docs:
- https://docs.z.ai/guides/llm/glm-5.2 — 1M context, 128K max output,
  text-only input/output, thinking / function calling / context caching /
  structured output / MCP
- https://docs.z.ai/guides/overview/pricing — $1.4/M input, $0.26/M
  cached input (storage limited-time free), $4.4/M output (same row
  group as GLM-5.3/GLM-5.1)

Entry mirrors sibling zai/glm-5.3 field-for-field.
@wait4xx
wait4xx requested a review from mateo-berri as a code owner August 30, 2026 03:33
@CLAassistant

CLAassistant commented Aug 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds direct Z.AI metadata for zai/glm-5.2 to both synchronized model registries.

  • Records input, output, and cached-input pricing.
  • Defines the model’s input and output token limits.
  • Advertises function calling, prompt caching, reasoning, and tool-choice support.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds the direct zai/glm-5.2 pricing, context-limit, provider, and capability metadata.
litellm/model_prices_and_context_window_backup.json Mirrors the new zai/glm-5.2 entry from the primary model registry.

Reviews (2): Last reviewed commit: "feat(model_prices): add zai/glm-5.2 vend..." | Re-trigger Greptile

@codspeed-hq

codspeed-hq Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing wait4xx:fix/zai-glm-5.2-vendor-entry (f2b695a) with litellm_internal_staging (d44d281)

Open in CodSpeed

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wait4xx
wait4xx changed the base branch from main to litellm_internal_staging August 30, 2026 03:45
@wait4xx wait4xx closed this Aug 30, 2026
@wait4xx wait4xx reopened this Aug 30, 2026
@wait4xx

wait4xx commented Aug 30, 2026

Copy link
Copy Markdown
Author

Note on the proxy-infra / Run tests failure: it looks pre-existing on the base branch rather than caused by this change.

The failing test (test_savings.py::test_a_baseline_with_no_cache_read_rate_is_charged_its_input_rate) asserts that xai/grok-4 has no cache_read_input_token_cost ("pick a baseline with no cache-read rate"). On the PR base (litellm_internal_staging @ d44d281, without this PR's commit) the registry entry already carries it:

"xai/grok-4": { ..., "cache_read_input_token_cost": 2e-07, ... }

The entry is byte-identical on this PR's branch — the diff only adds the zai/glm-5.2 key. The same test passes on main (10631eb), where xai/grok-4 does not carry the field yet, so the regression came in via an earlier staging commit, not this one.

Everything that validates the registry change itself is green on this PR: validate-model-prices-json, Greptile 5/5, CodSpeed no-change.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by the rolling registry PR #38990, which absorbs this change (values re-verified against the official provider docs). Closing per the one-rolling-registry-PR policy.

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