feat(provider): add LibertAI GLM-5.2 models - #30838
Conversation
Greptile SummaryThis PR registers two new LibertAI chat models —
Confidence Score: 4/5Safe 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.
|
| 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
| "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/" |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Superseded by rolling registry audit #37902, which reverified and absorbed the provider-documented metadata changes at field level |
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.2libertai/glm-5.2-thinkingBoth 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.jsongit diff --checkCould not run pytest in this fresh clone because
pytestis not installed and the repo requiresuv >=0.10.9while this environment hasuv 0.9.28.