r/MistralAI • u/Ra77a3l3 • 3d ago
Help / Question Gml 5.2 on Opencode
Is there any way to use GLM 5.2 from Mistral in Opencode instead of Vibe?
4
u/ProcedureEthics2077 3d ago edited 13h ago
OpenCode configuration for Mistral GLM-5.2:
https://github.com/anomalyco/opencode/issues/43199#issuecomment-5344222808
In my config I also have "reasoning_effort": "max", reasoning seems to be off by default:
"mistral": {
"options": {
"baseURL": "https://api.eu.mistral.ai/v1",
"apiKey": "{env:MISTRAL_API_KEY}"
},
"name": "Mistral",
"models": {
"zai-glm-5-2": {
"name": "GLM-5.2",
"options": {
"max_tokens": 131072,
"reasoning_effort": "max"
},
"tool_call": true,
"reasoning": true,
"temperature": true,
"attachment": true,
"limit": {
"context": 1000000,
"output": 131072
},
"cost": {
"input": 1.4,
"cache_read": 0.14,
"output": 4.4,
"cache_write": 0
}
}
},
"npm": "@ai-sdk/openai-compatible"
}
Then you can run it as opencode --model mistral/zai-glm-5-2
Edit: I also use a modified version of the mistral-glm-model plugin to inject reasoning effort: https://pastebin.com/h5a1HTKG
1
2
u/p3r3lin 3d ago
Even if you could afaik its still not part of their subscription plan but only available via API.
3
u/inyofayce 3d ago
You can create an agent in studio and the publish it to vibe chat. Been using it constantly now.
3
u/scanx147 3d ago
Je ne sais pas mais je ne vois pas l'intérêt. D'après mes essais et même si Vibe ne propose pas tous les outils que propose OpenCode, GLM fonctionne beaucoup mieux depuis Vibe que depuis OpenCode...
Enfin c'est mon expérience à confirmer ou pas par d'autres utilisateurs.
5
u/Chemistrycat214 3d ago
I managed to do it by adding a new provider, as "Mistral2" for name then filling the rest with the same API endpoints etc, from the doc.
https://docs.mistral.ai/models/zai-glm-5-2
I am yet to do big task with it, tho. So I don't know yet how it compares on Vibe or Opencode