@oai2lmapi/opencode-provider 0.3.9 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,6 +102,49 @@ Once you have your model list (from CLI or Plugin), add to `opencode.json`:
102
102
 
103
103
  > **Note**: OpenCode requires the `models` field to know which models are available. The CLI and Plugin tools help you generate this automatically.
104
104
 
105
+ ### Configuring Model Overrides in OpenCode
106
+
107
+ **Important**: Due to how OpenCode passes options to SDK providers, model-specific settings like `usePromptBasedToolCalling` must be configured in `provider.*.options.modelOverrides`, **not** in `provider.*.models.*.options`.
108
+
109
+ ```json
110
+ {
111
+ "$schema": "https://opencode.ai/config.json",
112
+ "provider": {
113
+ "my-api": {
114
+ "npm": "@oai2lmapi/opencode-provider",
115
+ "options": {
116
+ "baseURL": "https://api.example.com/v1",
117
+ "apiKey": "{env:MY_API_KEY}",
118
+ "modelOverrides": {
119
+ "qwq-*": {
120
+ "usePromptBasedToolCalling": true,
121
+ "trimXmlToolParameterWhitespace": true
122
+ },
123
+ "deepseek-r1*": {
124
+ "thinkingLevel": "medium",
125
+ "suppressChainOfThought": true
126
+ }
127
+ }
128
+ },
129
+ "models": {
130
+ "qwq-32b": {
131
+ "name": "QwQ 32B",
132
+ "tool_call": false,
133
+ "limit": { "context": 131072, "output": 65536 }
134
+ },
135
+ "deepseek-r1": {
136
+ "name": "DeepSeek R1",
137
+ "tool_call": true,
138
+ "limit": { "context": 65536, "output": 8192 }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ > **Why not `models.*.options`?** OpenCode stores `models.*.options` on the Model object, but only passes `provider.options` to the SDK's creation function. Therefore, `modelOverrides` inside `provider.options` is the correct place to configure advanced model features.
147
+
105
148
  ## CLI Reference
106
149
 
107
150
  ```bash
@@ -108,6 +108,10 @@
108
108
  "trimXmlToolParameterWhitespace": {
109
109
  "type": "boolean",
110
110
  "description": "Trim whitespace from XML tool parameter values (only when usePromptBasedToolCalling is true)."
111
+ },
112
+ "parseThinkingTags": {
113
+ "type": "boolean",
114
+ "description": "Parse <think> and <thinking> tags from model output and convert to reasoning content. Useful for models that output thinking in XML tags (e.g., DeepSeek, QwQ)."
111
115
  }
112
116
  }
113
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oai2lmapi/opencode-provider",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "AI SDK Provider and OpenCode Plugin for OpenAI-compatible APIs with automatic model discovery",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",