Skip to content

Commit 1802c9e

Browse files
Nathan LuxfordNathan Luxford
authored andcommitted
Downgrade Lightning model metadata and document reasoning
Kimi K2.5 Lightning and GLM-5 Lightning are speed-optimized models that do not support reasoning, vision, or interleaved reasoning streams. Previously configured with full base-model metadata, this caused model pausing and failed tool calls in OpenCode. Changes: - Set reasoning: false for both Lightning variants - Set attachment: false and text-only modalities - Removed interleaved field - Added /v1/models API verification table to README - Added Lightning limitations and downgrade reasoning to README
1 parent 0455f9f commit 1802c9e

2 files changed

Lines changed: 61 additions & 10 deletions

File tree

README.md

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,60 @@ That metadata includes:
188188
- `modalities`
189189
- `interleaved` when available
190190

191-
This was only applied where there was an exact canonical match. The Kimi Lightning and GLM-5 Lightning variants are the exceptions: they keep their own display names and Crof backend `id` values, but reuse the standard family metadata so they behave more like the main Kimi and GLM-5 models in OpenCode.
191+
This was only applied where there was an exact canonical match. The Lightning variants (Kimi K2.5 Lightning and GLM-5 Lightning) are intentionally downgraded: they keep `tool_call: true` and `temperature: true` but drop `reasoning`, `attachment`, `interleaved`, and multimodal input because they are speed-optimized models that trade off reasoning depth and vision capabilities for faster responses.
192+
193+
## Models API Verification
194+
195+
Crof's `/v1/models` endpoint returns the following fields for each model:
196+
197+
- `id`
198+
- `context_length`
199+
- `max_completion_tokens`
200+
- `pricing`
201+
202+
The `/v1/models` response does **not** include capability metadata like `reasoning`, `tool_call`, `modalities`, or `attachment`. Those fields must be inferred and set manually in the OpenCode config.
203+
204+
All `limit.context` and `limit.output` values in this config were verified against the live `/v1/models` API response. The following table shows the exact match:
205+
206+
| Model | API `context_length` | API `max_completion_tokens` | Config `limit.context` | Config `limit.output` |
207+
|---|---|---|---|---|
208+
| `kimi-k2.5` | 262144 | 262144 | 262144 | 262144 |
209+
| `kimi-k2.5-lightning` | 131072 | 32768 | 131072 | 32768 |
210+
| `glm-5` | 202752 | 202752 | 202752 | 202752 |
211+
| `glm-5-lightning` | 202752 | 202752 | 202752 | 202752 |
212+
| `glm-4.7` | 202752 | 202752 | 202752 | 202752 |
213+
| `glm-4.7-flash` | 202752 | 131072 | 202752 | 131072 |
214+
| `gemma-4-31b-it` | 262144 | 262144 | 262144 | 262144 |
215+
| `minimax-m2.5` | 204800 | 131072 | 204800 | 131072 |
216+
| `qwen3.5-397b-a17b` | 262144 | 262144 | 262144 | 262144 |
217+
| `deepseek-v3.2` | 163840 | 163840 | 163840 | 163840 |
218+
219+
## Lightning Model Limitations
220+
221+
The Lightning variants are speed-optimized models. They differ from their base counterparts in important ways:
222+
223+
- **No reasoning**: Lightning models do not produce extended reasoning output. They are configured with `reasoning: false` and no `interleaved` field.
224+
- **No vision**: Lightning models are text-only. They are configured with `attachment: false` and `modalities.input: ["text"]`.
225+
- **Tool calling**: Lightning models still support tool calling, but may be less reliable than base models for complex agentic workflows.
226+
- **Lower output limits**: Kimi K2.5 Lightning has a much smaller output limit (32768 vs 262144) which can cause truncation on long responses.
227+
228+
If you experience pausing or failed tool calls with Lightning models, switch to the base model (e.g. `moonshotai/kimi-k2.5` instead of `moonshotai/kimi-k2.5:lightning`).
229+
230+
### Why Lightning Models Were Downgraded
231+
232+
The Lightning entries were initially configured with the same `reasoning: true`, `attachment`, `interleaved`, and multimodal settings as their base models. This caused two problems in practice:
233+
234+
1. **Model pausing**: OpenCode expected reasoning output (via `interleaved`) that Lightning models do not produce, causing the stream to hang while waiting for reasoning tokens that never arrive.
235+
2. **Failed tool calls**: Lightning models struggle with complex tool-calling formats. Marking them as `reasoning: true` made OpenCode expect deeper agentic behavior that the speed-optimized models cannot reliably deliver.
236+
237+
The fix was to downgrade Lightning metadata to match reality:
238+
239+
- `reasoning: false` — no extended thinking output
240+
- `attachment: false` — no image or video input
241+
- `interleaved` removed — no reasoning stream field
242+
- `modalities.input: ["text"]` — text-only
243+
244+
This prevents OpenCode from expecting capabilities the Lightning models do not have, eliminating the pausing and reducing tool call failures.
192245

193246
## Why This Is A Safe OpenCode Custom Provider
194247

@@ -306,7 +359,7 @@ Examples:
306359
- `z-ai/glm-4.7-flash` -> `interleaved.field = reasoning_details`
307360
- `minimax/minimax-m2.5` -> `interleaved.field = reasoning_details`
308361

309-
Kimi Lightning and GLM-5 Lightning were explicitly aligned to the standard Kimi and GLM-5 family metadata to reduce behavior differences while keeping their own backend `id` values and display names.
362+
The Lightning variants (Kimi K2.5 Lightning and GLM-5 Lightning) are intentionally configured with `reasoning: false`, no `interleaved` field, and text-only modalities because they are speed-optimized models.
310363

311364
## Limits
312365

@@ -361,7 +414,7 @@ Some things were intentionally not added or not assumed.
361414

362415
- no API keys are stored in this repo
363416
- no default `model` is forced in the template
364-
- no metadata was guessed for Crof-only variants beyond `id`, `name`, and `limit`, except for Kimi Lightning and GLM-5 Lightning which are intentionally aligned to their standard family metadata
417+
- no metadata was guessed for Crof-only variants beyond `id`, `name`, and `limit`, except for Lightning variants which are intentionally downgraded to speed-optimized settings (no reasoning, no vision, text-only)
365418
- `structured_output` was not added because it does not appear to be supported on custom provider model entries in the current OpenCode schema
366419

367420
## How To Use This Globally

opencode.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
"name": "Kimi K2.5 (lightning)",
2626
"limit": { "context": 131072, "output": 32768 },
2727
"family": "kimi",
28-
"attachment": true,
29-
"reasoning": true,
28+
"attachment": false,
29+
"reasoning": false,
3030
"tool_call": true,
3131
"temperature": true,
32-
"modalities": { "input": ["text", "image", "video"], "output": ["text"] },
33-
"interleaved": { "field": "reasoning_details" }
32+
"modalities": { "input": ["text"], "output": ["text"] }
3433
},
3534
"z-ai/glm-5": {
3635
"id": "glm-5",
@@ -50,11 +49,10 @@
5049
"limit": { "context": 202752, "output": 202752 },
5150
"family": "glm",
5251
"attachment": false,
53-
"reasoning": true,
52+
"reasoning": false,
5453
"tool_call": true,
5554
"temperature": true,
56-
"modalities": { "input": ["text"], "output": ["text"] },
57-
"interleaved": { "field": "reasoning_content" }
55+
"modalities": { "input": ["text"], "output": ["text"] }
5856
},
5957
"z-ai/glm-4.7": {
6058
"id": "glm-4.7",

0 commit comments

Comments
 (0)