Skip to content

Add GLM-5.2 (Zhipu) to the default savings pricing table #373

Description

@madeinoz67

Problem

GLM-5.2 (Zhipu AI) is not in the default pricing table (defaultPricing in internal/savings/pricing.go). When it's the active client model, both gortex savings and the daemon's cumulative_savings.per_model_actual report $0 cost-avoided for it — the tokens are counted, but priced at zero because the model isn't in the table.

Rate

Zhipu's official GLM-5.2 pricing (docs.z.ai/pricing):

  • Input: $1.40 / 1M tokens (this is the field savings uses — cost-avoided is priced against the client model's input rate)
  • Output: $4.40 / 1M tokens (not currently used by the savings calc, noted for completeness)

Suggested entry

Add to defaultPricing in internal/savings/pricing.go:

{Model: "glm-5.2", USDPerMInput: 1.40},

Why built-in

GLM-5.2 is increasingly used as a client model — e.g. Claude Code pointed at Zhipu's Anthropic-compatible endpoint (api.z.ai), or via Ollama Cloud. Currently users have to work around the $0 by exporting GORTEX_MODEL_PRICING_JSON, but that replaces the entire default table (losing the popular-models comparison view), so a built-in entry is the cleaner fix.

Happy to open a PR if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions