Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,27 @@ This starts a local server and opens OpenCode in your default browser. Sessions

See the [OpenCode Web docs](https://opencode.ai/docs/web/) for more.

### GLM reasoning-effort tiers

`glm-latest` (GLM-5.2) reasons by default. To trade thinking depth for speed, the
model picker (`ctrl+x m`) exposes the same model at several reasoning-effort tiers —
GLM-5.2 collapses low/medium into "high", so these are the only distinct levels:

| Picker entry | `reasoning_effort` | Use it for |
|---|---|---|
| `glm-latest` | *(gateway default)* | the default — thinking on |
| `glm-max` | `max` | deepest reasoning |
| `glm-high` | `high` | strong reasoning, faster |
| `glm-fast` | `none` | no thinking, fastest replies |

<figure>
<img alt="Switching GLM reasoning-effort tiers from the OpenCode model picker" src="demo/glm-effort-picker.gif" />
<figcaption>Picking a GLM reasoning-effort tier in OpenCode (<code>ctrl+x m</code>)</figcaption>
</figure>

The tiers are defined in [`coding-agents/opencode/settings/juspay.nix`](coding-agents/opencode/settings/juspay.nix);
all target the same gateway model (`glm-latest`) and differ only in `reasoningEffort`.

## Coding Agent Setup

This repo uses [APM](https://microsoft.github.io/apm/) for coding agent configuration. `.claude/` and `.opencode/` are **vendored** — committed to git and kept in sync by a CI check (`apm-sync` workflow).
Expand Down
43 changes: 36 additions & 7 deletions coding-agents/opencode/settings/juspay.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
let
# All models accept text+image input, text output; name = attr key
mkModel = name: { context, output }: {
inherit name;
modalities = { input = [ "text" "image" ]; output = [ "text" ]; };
limit = { inherit context output; };
};
# All models accept text+image input, text output; name = attr key.
# reasoningEffort (optional) marks the model as a reasoning model and is
# forwarded as the OpenAI-compatible `reasoning_effort` request field —
# @ai-sdk/openai-compatible maps the camelCase key to snake_case for us.
# id (optional) sets the wire model id when the attr key differs from the
# gateway's model name — used to expose one gateway model at several
# reasoning-effort tiers.
mkModel = name: { context, output, reasoningEffort ? null, id ? null }:
let
base = {
inherit name;
modalities = { input = [ "text" "image" ]; output = [ "text" ]; };
limit = { inherit context output; };
} // (if id == null then { } else { inherit id; });
in
if reasoningEffort == null then base
else base // {
reasoning = true;
options = { inherit reasoningEffort; };
};

# GLM-5.2 (glm-latest and its effort-tier siblings) share a 1M-token context
# window (the old 202752 was a copy-paste default). output stays at 32000:
# OpenCode caps the wire max_tokens at 32000 for this custom-provider model
# regardless of this field (verified), so a higher value would only shrink the
# usable input budget without raising the real output limit.
glmLimits = { context = 1000000; output = 32000; };

models = builtins.mapAttrs mkModel {
open-large = { context = 202752; output = 32000; };
Expand All @@ -18,7 +39,15 @@ let
gemini-3-pro-preview = { context = 1048576; output = 65535; };
gemini-3-flash-preview = { context = 1048576; output = 65535; };
minimax-m2 = { context = 202752; output = 32000; };
glm-latest = { context = 202752; output = 32000; };
# glm-latest is GLM-5.2. Its default reasoning is left untouched (no
# reasoning_effort sent — the gateway default, which is thinking-on). The
# effort tiers below are sibling picker entries that target the same gateway
# model via `id`; GLM-5.2 collapses low/medium into "high", so max / high /
# off are the only distinct levels.
glm-latest = glmLimits;
glm-max = glmLimits // { reasoningEffort = "max"; id = "glm-latest"; };
glm-high = glmLimits // { reasoningEffort = "high"; id = "glm-latest"; };
glm-fast = glmLimits // { reasoningEffort = "none"; id = "glm-latest"; };
kimi-latest = { context = 262000; output = 32000; };
};
in
Expand Down
Binary file added demo/glm-effort-picker.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.