Skip to content

feat(provider): add LibertAI GLM-5.2 models - #30838

Closed
moshemalawach wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
moshemalawach:add-libertai-glm-5-2
Closed

feat(provider): add LibertAI GLM-5.2 models#30838
moshemalawach wants to merge 1 commit into
BerriAI:litellm_internal_stagingfrom
moshemalawach:add-libertai-glm-5-2

Conversation

@moshemalawach

@moshemalawach moshemalawach commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Adds the new LibertAI GLM-5.2 model IDs to the LiteLLM model cost map after the initial LibertAI provider PR (#30203) was merged.

Models added:

  • libertai/glm-5.2
  • libertai/glm-5.2-thinking

Both entries use 262144 input/output tokens and live pricing from LibertAI: $1.40/M input, $4.40/M output. The thinking variant is marked with supports_reasoning: true.

Validation run locally:

  • jq empty model_prices_and_context_window.json litellm/model_prices_and_context_window_backup.json
  • git diff --check
  • Python JSON assertion for both GLM entries in root + backup cost maps

Could not run pytest in this fresh clone because pytest is not installed and the repo requires uv >=0.10.9 while this environment has uv 0.9.28.

@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR registers two new LibertAI chat models — libertai/glm-5.2 and libertai/glm-5.2-thinking — in both cost-map JSON files and adds corresponding assertions in the existing LibertAI provider test.

  • Token prices (1.4e-06 input / 4.4e-06 output = $1.40/$4.40 per million tokens) match Z.ai's published GLM-5.2 rates and are consistent with the pattern of more expensive models already in the map (e.g. libertai/qwen3.5-122b-a10b).
  • The supports_reasoning: true flag is correctly applied to the thinking variant only, and the test validates both entries without making any real network calls.

Confidence Score: 4/5

Safe to merge — changes are additive JSON-only entries with a correctly priced model and matching backup file; the only concern is the misleading wording in the PR description, not the code itself.

The JSON values are accurate and externally verified, the backup file mirrors them exactly, and the new test assertions are consistent with the existing suite. The sole flag is a description mismatch (says ".40/M" but the actual values are $1.40 and $4.40 per million tokens), which could mislead reviewers but does not affect runtime behavior.

No files require special attention beyond a quick sanity-check of the token prices against the LibertAI pricing page before merging.

Important Files Changed

Filename Overview
model_prices_and_context_window.json Adds libertai/glm-5.2 and libertai/glm-5.2-thinking; token prices (1.4e-06 input / 4.4e-06 output) match Z.ai's published GLM-5.2 rates ($1.40/$4.40 per million tokens), though the PR description says ".40/M" which is misleading.
litellm/model_prices_and_context_window_backup.json Mirrors the root JSON additions for libertai/glm-5.2 and libertai/glm-5.2-thinking; entries are identical and consistent with the root file.
tests/test_litellm/llms/openai_like/test_libertai_provider.py Extends test_libertai_model_cost_map with assertions for the two new model entries; reads from litellm.model_cost (no network calls), consistent with existing test style.

Reviews (1): Last reviewed commit: "feat(provider): add LibertAI GLM-5.2 mod..." | Re-trigger Greptile

Comment on lines +41694 to +41706
"libertai/glm-5.2": {
"max_tokens": 262144,
"max_input_tokens": 262144,
"max_output_tokens": 262144,
"input_cost_per_token": 1.4e-06,
"output_cost_per_token": 4.4e-06,
"litellm_provider": "libertai",
"mode": "chat",
"supports_function_calling": true,
"supports_tool_choice": true,
"supports_system_messages": true,
"supports_vision": false,
"source": "https://docs.libertai.io/apis/text/"

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.

P2 PR description pricing mismatch

The PR description states ".40/M input, .40/M output" for these models, but the actual JSON values are 1.4e-06 ($1.40/M) for input and 4.4e-06 ($4.40/M) for output — 3.5× and 11× higher, respectively. Cross-referencing Z.ai's published GLM-5.2 API rates ($1.40/$4.40 per million tokens) confirms the JSON is correct, so the description appears to have accidentally dropped the leading $1 and $4. No code change is needed, but it would be worth correcting the description to avoid confusion during review.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codecov

codecov Bot commented Jun 19, 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

Copy link
Copy Markdown
Contributor

Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level

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