Practical provider notes from a real working setup
Date: 2026-05-06
GLM-5.1 works in OpenCode today if you wire it in as an additive OpenAI-compatible provider instead of trying to replace your existing default stack.
Validated working routes:
glm-nvidia/glm-5.1glm-puter/glm-5.1
Conditionally useful:
- local gateway route, but only when the local service is actually online
The clean pattern is simple:
- Leave your main OpenCode default model alone.
- Add
GLM-5.1as extra providers. - Keep a separate fast fallback model for background or title-style work.
- Surface local gateways only when they are reachable.
That gives you GLM without turning the rest of the setup brittle.
Route
- OpenCode model:
glm-nvidia/glm-5.1 - Provider style: OpenAI-compatible
- Upstream model ID:
z-ai/glm-5.1
Result
- working
Verification
- direct completion call succeeded
opencode run -m glm-nvidia/glm-5.1 ...returned a valid response
Route
- OpenCode model:
glm-puter/glm-5.1 - Provider style: OpenAI-compatible
- Upstream model ID:
z-ai/glm-5.1
Result
- working
Verification
- direct completion call succeeded
opencode run -m glm-puter/glm-5.1 ...returned a valid response
Caveat
- this path may rely on session-style auth, so it is convenient but less durable than a standard API-key provider
A local gateway is still worth keeping around, but it should behave like a live system status, not a fake permanent option:
- if the service is listening, show it as available
- if the service is down, hide it or mark it clearly offline
That keeps the model picker honest and avoids dead choices in the UI.
If you want this to feel stable in daily use:
- keep the main reasoning/default path on your existing Google or Antigravity stack
- expose GLM as extra working models, not a forced replacement
- prefer stable remote GLM providers first
- keep a fast fallback model for background work and metadata generation
In practice, additive integration is the difference between a flexible setup and a fragile one.
Safe to publish:
- provider pattern
- model IDs
- high-level status notes
- fallback strategy
- UI and routing behavior
Do not publish:
- local absolute filesystem paths
- account emails
- bearer tokens
- refresh tokens
- session cookies
- API keys
- private repository remotes
GLM-5.1 is usable in OpenCode right now through OpenAI-compatible providers, and the safest pattern is to layer it on top of your existing setup rather than swap the whole stack around it.