qwen-opencode-provider 1.0.8 → 1.0.9

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.
Files changed (3) hide show
  1. package/README.md +43 -29
  2. package/index.js +17 -46
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,25 +1,43 @@
1
1
  # OpenCode Qwen Plugin
2
2
 
3
- OpenCode plugin for Qwen AI - auto-registers provider with 28+ models.
3
+ OpenCode plugin for Qwen API - auto-configures models.
4
+
5
+ ## Important Limitation
6
+
7
+ ⚠️ **Plugin cannot auto-register provider** - You must add provider config manually to `opencode.json`.
8
+
9
+ Plugin only auto-configures the model list.
4
10
 
5
11
  ## Installation
6
12
 
7
- Add to `opencode.json`:
13
+ ### Step 1: Add to opencode.json
14
+
8
15
  ```json
9
16
  {
10
17
  "plugin": ["qwen-opencode-provider"]
11
18
  }
12
19
  ```
13
20
 
14
- ## Usage
21
+ ### Step 2: Add Provider Config
15
22
 
16
- ### Connect
23
+ You must manually add this provider config to your `opencode.json`:
17
24
 
18
- ```bash
19
- /connect
20
- # Select: Other
21
- # Enter: qwen
22
- # Enter your Qwen token
25
+ ```json
26
+ {
27
+ "$schema": "https://opencode.ai/config.json",
28
+ "plugin": ["qwen-opencode-provider"],
29
+ "provider": {
30
+ "qwen": {
31
+ "npm": "@ai-sdk/openai-compatible",
32
+ "name": "Qwen",
33
+ "options": {
34
+ "baseURL": "https://qwen.aikit.club/v1",
35
+ "apiKey": "YOUR_QWEN_TOKEN_HERE"
36
+ },
37
+ "models": {}
38
+ }
39
+ }
40
+ }
23
41
  ```
24
42
 
25
43
  ### Get Token
@@ -28,34 +46,30 @@ Add to `opencode.json`:
28
46
  2. Open Developer Console (F12)
29
47
  3. Run: `localStorage.getItem('token')`
30
48
 
31
- ### Select Model
49
+ ## Usage
32
50
 
33
51
  ```bash
34
52
  /models
35
- # Choose any Qwen model
53
+ # Select Qwen model
36
54
  ```
37
55
 
56
+ ## Supported Models
57
+
58
+ Plugin auto-configures these models:
59
+
60
+ | Model | Context | Output |
61
+ |-------|---------|--------|
62
+ | qwen3-max-2026-01-23 | 262K | 32K |
63
+ | qwen3-vl-plus | 262K | 32K |
64
+ | qwen3-coder-plus | 1M | 65K |
65
+ | qwen3-vl-32b | 131K | 32K |
66
+ | qwen3-coder-flash | 262K | 65K |
67
+ | qwq-32b | - | - |
68
+ | qwen-deep-research | - | - |
69
+
38
70
  ## Features
39
71
 
40
72
  - 👁️ Vision (image analysis)
41
73
  - 🌐 Web Search
42
74
  - 🧠 Thinking Mode
43
- - 🎨 Image Generation
44
75
  - 👨‍💻 Code Generation
45
-
46
- ## Supported Models
47
-
48
- | Model | Description |
49
- |-------|-------------|
50
- | qwen-max | Latest Qwen Max |
51
- | qwen2.5-max | Best overall + vision + web search |
52
- | qwen2.5-turbo | Fast responses |
53
- | qwen2.5-plus | Balanced performance |
54
- | qwen2.5-coder-32b | Code generation |
55
- | qwen3-coder | Code + tool calling |
56
- | qwen3-max | Best Qwen3 |
57
- | qwq-32b | Reasoning with thinking |
58
- | qwen-deep-research | Research + web search |
59
- | qwen-web-dev | Web development |
60
- | qwen-full-stack | Full-stack apps |
61
- | qwen-cogview | Image generation |
package/index.js CHANGED
@@ -1,43 +1,28 @@
1
1
  /**
2
2
  * OpenCode Qwen API Plugin
3
3
  *
4
- * Automatically registers Qwen provider with OpenCode.
5
- * No manual config needed - just add plugin to opencode.json!
4
+ * Auto-configures Qwen provider models - but requires manual provider config.
6
5
  *
7
6
  * Usage:
8
- * 1. Add to opencode.json: { "plugin": ["qwen-opencode-provider"] }
9
- * 2. Run /connect -> Select "Other" -> Enter "qwen"
7
+ * 1. Add plugin to opencode.json
8
+ * 2. Add provider config (see below)
10
9
  */
11
10
 
12
- const QWEN_PROVIDER_ID = 'qwen';
13
-
14
11
  const QWEN_MODELS = {
12
+ 'qwen3-max-2026-01-23': { name: 'Qwen3-Max', limit: { context: 262144, output: 32768 } },
13
+ 'qwen3-vl-plus': { name: 'Qwen3-VL-235B-A22B', limit: { context: 262144, output: 32768 } },
14
+ 'qwen3-coder-plus': { name: 'Qwen3-Coder', limit: { context: 1048576, output: 65536 } },
15
+ 'qwen3-vl-32b': { name: 'Qwen3-VL-32B', limit: { context: 131072, output: 32768 } },
16
+ 'qwen3-vl-30b-a3b': { name: 'Qwen3-VL-30B-A3B', limit: { context: 131072, output: 32768 } },
17
+ 'qwen3-omni-flash-2025-12-01': { name: 'Qwen3-Omni-Flash', limit: { context: 65536, output: 13684 } },
18
+ 'qwen3-30b-a3b': { name: 'Qwen3-30B-A3B', limit: { context: 131072, output: 32768 } },
19
+ 'qwen3-coder-30b-a3b-instruct': { name: 'Qwen3-Coder-Flash', limit: { context: 262144, output: 65536 } },
15
20
  'qwen-max': { name: 'Qwen Max' },
16
- 'qwen-max-latest': { name: 'Qwen Max Latest' },
17
21
  'qwen2.5-max': { name: 'Qwen2.5 Max' },
18
22
  'qwen2.5-plus': { name: 'Qwen2.5 Plus' },
19
23
  'qwen2.5-turbo': { name: 'Qwen2.5 Turbo' },
20
- 'qwen2.5-14b-instruct-1m': { name: 'Qwen2.5 14B Instruct 1M' },
21
- 'qwen2.5-72b-instruct': { name: 'Qwen2.5 72B Instruct' },
22
- 'qwen2.5-coder-32b-instruct': { name: 'Qwen2.5 Coder 32B' },
23
- 'qwen2.5-omni-7b': { name: 'Qwen2.5 Omni 7B' },
24
- 'qwen2.5-vl-32b-instruct': { name: 'Qwen2.5 VL 32B' },
25
- 'qwen3-next-80b-a3b': { name: 'Qwen3 Next 80B A3B' },
26
- 'qwen3-235b-a22b-2507': { name: 'Qwen3 235B A22B' },
27
- 'qwen3-30b-a3b-2507': { name: 'Qwen3 30B A3B' },
28
- 'qwen3-coder': { name: 'Qwen3 Coder' },
29
- 'qwen3-coder-flash': { name: 'Qwen3 Coder Flash' },
30
- 'qwen3-max': { name: 'Qwen3 Max' },
31
- 'qwen3-omni-flash': { name: 'Qwen3 Omni Flash' },
32
- 'qwen3-vl-235b-a22b': { name: 'Qwen3 VL 235B' },
33
- 'qwen3-vl-32b': { name: 'Qwen3 VL 32B' },
34
- 'qwen3-vl-30b-a3b': { name: 'Qwen3 VL 30B A3B' },
35
- 'qvq-max': { name: 'QVQ Max' },
36
24
  'qwq-32b': { name: 'QWQ 32B' },
37
- 'qwen-deep-research': { name: 'Qwen Deep Research' },
38
- 'qwen-web-dev': { name: 'Qwen Web Dev' },
39
- 'qwen-full-stack': { name: 'Qwen Full Stack' },
40
- 'qwen-cogview': { name: 'Qwen CogView' }
25
+ 'qwen-deep-research': { name: 'Qwen Deep Research' }
41
26
  };
42
27
 
43
28
  export const QwenPlugin = async (ctx) => {
@@ -47,32 +32,18 @@ export const QwenPlugin = async (ctx) => {
47
32
  config.provider = {};
48
33
  }
49
34
 
50
- if (!config.provider[QWEN_PROVIDER_ID]) {
51
- config.provider[QWEN_PROVIDER_ID] = {
35
+ if (!config.provider.qwen) {
36
+ config.provider.qwen = {
52
37
  npm: '@ai-sdk/openai-compatible',
53
- name: 'Qwen AI',
38
+ name: 'Qwen',
54
39
  options: {
55
40
  baseURL: 'https://qwen.aikit.club/v1'
56
41
  },
57
42
  models: QWEN_MODELS
58
43
  };
44
+ } else if (config.provider.qwen?.models) {
45
+ config.provider.qwen.models = { ...QWEN_MODELS, ...config.provider.qwen.models };
59
46
  }
60
- },
61
-
62
- auth: {
63
- provider: QWEN_PROVIDER_ID,
64
- loader: async (auth) => {
65
- if (auth?.apiKey) {
66
- return { apiKey: auth.apiKey };
67
- }
68
- return { apiKey: '' };
69
- },
70
- methods: [
71
- {
72
- type: 'api',
73
- label: 'API Key'
74
- }
75
- ]
76
47
  }
77
48
  };
78
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qwen-opencode-provider",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "OpenCode plugin for Qwen API - auto adds provider with 28+ models",
5
5
  "main": "index.js",
6
6
  "type": "module",