103 Downloads Updated 3 days ago
ollama run igovet/glm-5.2-opencode
Modelfile & provider preset tuned for stable work inside OpenCode over Ollama Cloud.
When using Ollama Cloud models from OpenCode, several issues surface out of the box:
The settings below were arrived at empirically and raise the stability of Ollama Cloud + OpenCode to roughly 95%. The remaining edge cases look like Ollama Cloud throughput / model overload bugs, not configuration problems.
⚠️ These settings are experimental. They are not endorsed by Ollama or OpenCode — they are what happened to work best in our environment.
| Field | Value |
|---|---|
| Base model | glm-5.2:cloud |
| Context window | 1048576 |
| Output limit (in OpenCode) | 1000000 (equals context) |
| Temperature | 1.0 |
| Top-p | 0.95 |
| Frequency / Presence penalty | 0.1 / 0.1 |
| Repeat penalty | 1.1 (last 2048 tokens) |
| Variants | (no variants block — model has no reasoningEffort surface) |
FROM glm-5.2:cloud
PARAMETER num_ctx 1048576
PARAMETER num_predict 131072
PARAMETER temperature 1.0
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.1
PARAMETER repeat_last_n 2048
PARAMETER frequency_penalty 0.1
PARAMETER presence_penalty 0.1
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama",
"options": {
"baseURL": "http://localhost:11434/v1",
"timeout": 1200000,
"headerTimeout": 1200000
},
"models": {
"igovet/glm-5.2-opencode": {
"_launch": false,
"name": "GLM 5.2 OpenCode",
"limit": {
"context": 1048576,
"output": 131072
}
}
}
}
}
}
output is set equal to contextOllama does not honor a separate output (max output tokens) reliably through the OpenAI-compatible surface that @ai-sdk/openai-compatible speaks to. If you set output near 16384 you will see the stream cut off mid-response with no error.
The workaround used here is to make output formally equal to context. The model still decides when to stop on its own; we just stop clipping it on the client side.
timeout and headerTimeout are bumped to 20 minutes (1200000 ms). Cloud models occasionally queue for several minutes during peak load, and the default AI SDK timeouts will fire long before that.
GLM 5.2 raises the effective context window of the 5.1 family from ~200K to ~1M tokens while keeping the same penalties. Use 5.1 when latency matters more than recall, 5.2 when you need to dump entire repositories into the prompt.
This preset does not declare variants, so the OpenCode reasoning-effort selector will be unavailable for this model. Use the default model selection.
If you want explicit effort control anyway, you can add the standard block — Ollama will ignore unknown values rather than error out:
"variants": {
"high": { "reasoningEffort": "high" },
"medium": { "reasoningEffort": "medium" },
"low": { "reasoningEffort": "low" },
"none": { "reasoningEffort": "none" }
}
Recommended use inside OpenCode (when variants are added):
| Variant | Use it for |
|---|---|
high |
Whole-codebase reviews, large migrations, full-repo refactors — anything where the 1M context window is the actual win. |
medium |
Default for sub-agents (backend-developer, frontend-developer, full-stack-developer). |
low |
code-reviewer, qa-engineer, security-auditor on small scopes. |
none |
Inline completions / quick classification. |