# mistral: Add Z.ai GLM \(latest version\) and show thinking toggle for supported models \(\#63535\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a4b9dc5f528f95b9dac6995609b8825cab89fcfa)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a4b9dc5f528f95b9dac6995609b8825cab89fcfa

Requested commit: a4b9dc5f528f95b9dac6995609b8825cab89fcfa

Commit: a4b9dc5f528f95b9dac6995609b8825cab89fcfa

Tree: 8ce4d51abdb439ec1e9458814eb458ccb5947da7

Author: ummon-v

Committer: GitHub

## Message

```
mistral: Add Z.ai GLM (latest version) and show thinking toggle for supported models (#63535)

# Objective

- Add Z.ai GLM, now hosted by Mistral as a third-party open model, to
the
  built-in Mistral model list.
- Fix the thinking selector never appearing for Mistral models that
support
  reasoning (mistral-medium-latest, mistral-small-latest).

## Solution

- Added a `ZaiGlmLatest` variant to `mistral::Model` that uses Mistral's
`zai-glm-latest` model id: 1M token context window, tool calling
enabled,
image input disabled, thinking enabled. The provider builds its model
list
  by iterating this enum, so no further wiring was needed.
- This PR initially targeted GLM 5.2 (`zai-glm-5-2`), but Mistral
released
5.3 while it was open. Switching to the `zai-glm-latest` alias keeps Zed
on
the newest GLM release without requiring a new PR each time Mistral
bumps
the version, mirroring how Mistral's own model ids work for their
flagship
  models.
- Implemented the missing `LanguageModel::supports_thinking()` override
in the
Mistral provider, delegating to `mistral::Model::supports_thinking()`.
The
request-building code already sent `reasoning_effort` and serialized
thinking
parts, but the UI toggle was hidden because the trait method fell back
to the
  default `false`.

## Testing

- `./script/clippy -p mistral` and `cargo check -p language_models`
pass.
- Existing unit tests in the provider cover the `reasoning_effort`
request
mapping; no new behavior beyond the enum variant and the trait
delegation.
- Reviewers can test with a Mistral API key: `zai-glm-latest` appears in
the
  model dropdown, and the thinking toggle now shows for zai-glm-latest,
  mistral-medium-latest, and mistral-small-latest.
- Tested on macOS; changes are platform-independent.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- Added Z.ai GLM to the Mistral provider and fixed the thinking toggle
for Mistral Small and Medium.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

- [02238cd4b7523f31e6c9f920ea65382193b0ea76](https://git.cafe/gitcafe/zed/commit/02238cd4b7523f31e6c9f920ea65382193b0ea76?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a4b9dc5f528f95b9dac6995609b8825cab89fcfa?format=markdown)
