qwen-opencode-provider 1.0.5 → 1.0.6
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 +19 -43
- package/index.js +61 -64
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenCode Qwen Plugin
|
|
2
2
|
|
|
3
|
-
OpenCode plugin for Qwen AI - auto-
|
|
3
|
+
OpenCode plugin for Qwen AI - auto-registers provider with 28+ models.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -11,40 +11,9 @@ Add to `opencode.json`:
|
|
|
11
11
|
}
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Usage
|
|
15
15
|
|
|
16
|
-
###
|
|
17
|
-
|
|
18
|
-
Add this to your `opencode.json`:
|
|
19
|
-
|
|
20
|
-
```json
|
|
21
|
-
{
|
|
22
|
-
"$schema": "https://opencode.ai/config.json",
|
|
23
|
-
"plugin": ["qwen-opencode-provider"],
|
|
24
|
-
"provider": {
|
|
25
|
-
"qwen": {
|
|
26
|
-
"npm": "@ai-sdk/openai-compatible",
|
|
27
|
-
"name": "Qwen AI",
|
|
28
|
-
"options": {
|
|
29
|
-
"baseURL": "https://qwen.aikit.club/v1"
|
|
30
|
-
},
|
|
31
|
-
"models": {
|
|
32
|
-
"qwen-max": { "name": "Qwen Max" },
|
|
33
|
-
"qwen2.5-max": { "name": "Qwen2.5 Max" },
|
|
34
|
-
"qwen2.5-plus": { "name": "Qwen2.5 Plus" },
|
|
35
|
-
"qwen2.5-turbo": { "name": "Qwen2.5 Turbo" },
|
|
36
|
-
"qwen2.5-coder-32b-instruct": { "name": "Qwen2.5 Coder 32B" },
|
|
37
|
-
"qwen3-coder": { "name": "Qwen3 Coder" },
|
|
38
|
-
"qwen3-max": { "name": "Qwen3 Max" },
|
|
39
|
-
"qwq-32b": { "name": "QWQ 32B" },
|
|
40
|
-
"qwen-deep-research": { "name": "Qwen Deep Research" }
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Step 2: Connect
|
|
16
|
+
### Connect
|
|
48
17
|
|
|
49
18
|
```bash
|
|
50
19
|
/connect
|
|
@@ -53,12 +22,27 @@ Add this to your `opencode.json`:
|
|
|
53
22
|
# Enter your Qwen token
|
|
54
23
|
```
|
|
55
24
|
|
|
56
|
-
###
|
|
25
|
+
### Get Token
|
|
57
26
|
|
|
58
27
|
1. Visit https://chat.qwen.ai and login
|
|
59
28
|
2. Open Developer Console (F12)
|
|
60
29
|
3. Run: `localStorage.getItem('token')`
|
|
61
30
|
|
|
31
|
+
### Select Model
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
/models
|
|
35
|
+
# Choose any Qwen model
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
- 👁️ Vision (image analysis)
|
|
41
|
+
- 🌐 Web Search
|
|
42
|
+
- 🧠 Thinking Mode
|
|
43
|
+
- 🎨 Image Generation
|
|
44
|
+
- 👨💻 Code Generation
|
|
45
|
+
|
|
62
46
|
## Supported Models
|
|
63
47
|
|
|
64
48
|
| Model | Description |
|
|
@@ -75,11 +59,3 @@ Add this to your `opencode.json`:
|
|
|
75
59
|
| qwen-web-dev | Web development |
|
|
76
60
|
| qwen-full-stack | Full-stack apps |
|
|
77
61
|
| qwen-cogview | Image generation |
|
|
78
|
-
|
|
79
|
-
## Features
|
|
80
|
-
|
|
81
|
-
- 👁️ Vision (image analysis)
|
|
82
|
-
- 🌐 Web Search
|
|
83
|
-
- 🧠 Thinking Mode
|
|
84
|
-
- 🎨 Image Generation
|
|
85
|
-
- 👨💻 Code Generation
|
package/index.js
CHANGED
|
@@ -1,80 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenCode Qwen API Plugin
|
|
3
3
|
*
|
|
4
|
-
* Automatically
|
|
5
|
-
* No
|
|
4
|
+
* Automatically registers Qwen provider with OpenCode.
|
|
5
|
+
* No manual config needed - just add plugin to opencode.json!
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
8
|
* 1. Add to opencode.json: { "plugin": ["qwen-opencode-provider"] }
|
|
9
|
-
* 2.
|
|
10
|
-
* 3. Run /connect and select "Other" -> "qwen"
|
|
11
|
-
*
|
|
12
|
-
* Provider config for opencode.json:
|
|
13
|
-
* {
|
|
14
|
-
* "provider": {
|
|
15
|
-
* "qwen": {
|
|
16
|
-
* "npm": "@ai-sdk/openai-compatible",
|
|
17
|
-
* "name": "Qwen AI",
|
|
18
|
-
* "options": {
|
|
19
|
-
* "baseURL": "https://qwen.aikit.club/v1"
|
|
20
|
-
* },
|
|
21
|
-
* "models": {
|
|
22
|
-
* "qwen-max": { "name": "Qwen Max" },
|
|
23
|
-
* "qwen2.5-max": { "name": "Qwen2.5 Max" },
|
|
24
|
-
* ...
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* }
|
|
9
|
+
* 2. Run /connect -> Select "Other" -> Enter "qwen"
|
|
29
10
|
*/
|
|
30
11
|
|
|
31
12
|
const QWEN_PROVIDER_ID = 'qwen';
|
|
32
13
|
|
|
33
|
-
const
|
|
34
|
-
"qwen-max": { name: "Qwen Max", description: "Latest Qwen Max model" },
|
|
35
|
-
"qwen-max-latest": { name: "Qwen Max Latest", description: "Latest version of Qwen Max" },
|
|
36
|
-
"qwen2.5-max": { name: "Qwen2.5 Max", description: "Best overall with vision + web search" },
|
|
37
|
-
"qwen2.5-plus": { name: "Qwen2.5 Plus", description: "Balanced performance" },
|
|
38
|
-
"qwen2.5-turbo": { name: "Qwen2.5 Turbo", description: "Fast responses" },
|
|
39
|
-
"qwen2.5-14b-instruct-1m": { name: "Qwen2.5 14B Instruct 1M", description: "1M context" },
|
|
40
|
-
"qwen2.5-72b-instruct": { name: "Qwen2.5 72B Instruct", description: "72B parameters" },
|
|
41
|
-
"qwen2.5-coder-32b-instruct": { name: "Qwen2.5 Coder 32B", description: "Code generation" },
|
|
42
|
-
"qwen2.5-omni-7b": { name: "Qwen2.5 Omni 7B", description: "Multimodal" },
|
|
43
|
-
"qwen2.5-vl-32b-instruct": { name: "Qwen2.5 VL 32B", description: "Vision-language" },
|
|
44
|
-
"qwen3-next-80b-a3b": { name: "Qwen3 Next 80B A3B", description: "Next gen" },
|
|
45
|
-
"qwen3-235b-a22b-2507": { name: "Qwen3 235B A22B", description: "Large model" },
|
|
46
|
-
"qwen3-30b-a3b-2507": { name: "Qwen3 30B A3B", description: "Compact high-perf" },
|
|
47
|
-
"qwen3-coder": { name: "Qwen3 Coder", description: "Code + tool calling" },
|
|
48
|
-
"qwen3-coder-flash": { name: "Qwen3 Coder Flash", description: "Fast code" },
|
|
49
|
-
"qwen3-max": { name: "Qwen3 Max", description: "Best Qwen3" },
|
|
50
|
-
"qwen3-omni-flash": { name: "Qwen3 Omni Flash", description: "Fast multimodal" },
|
|
51
|
-
"qwen3-vl-235b-a22b": { name: "Qwen3 VL 235B", description: "Large vision" },
|
|
52
|
-
"qwen3-vl-32b": { name: "Qwen3 VL 32B", description: "Vision 32B" },
|
|
53
|
-
"qwen3-vl-30b-a3b": { name: "Qwen3 VL 30B A3B", description: "Compact vision" },
|
|
54
|
-
"qvq-max": { name: "QVQ Max", description: "Vision reasoning" },
|
|
55
|
-
"qwq-32b": { name: "QWQ 32B", description: "Reasoning with thinking" },
|
|
56
|
-
"qwen-deep-research": { name: "Qwen Deep Research", description: "Research + web search" },
|
|
57
|
-
"qwen-web-dev": { name: "Qwen Web Dev", description: "Web development" },
|
|
58
|
-
"qwen-full-stack": { name: "Qwen Full Stack", description: "Full-stack apps" },
|
|
59
|
-
"qwen-cogview": { name: "Qwen CogView", description: "Image generation" }
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const QwenPlugin = async ({ client }) => {
|
|
14
|
+
export const QwenPlugin = async (ctx) => {
|
|
63
15
|
return {
|
|
64
|
-
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
16
|
+
config: async (config) => {
|
|
17
|
+
// Auto-add Qwen provider to config
|
|
18
|
+
if (!config.provider) {
|
|
19
|
+
config.provider = {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (!config.provider[QWEN_PROVIDER_ID]) {
|
|
23
|
+
config.provider[QWEN_PROVIDER_ID] = {
|
|
24
|
+
npm: '@ai-sdk/openai-compatible',
|
|
25
|
+
name: 'Qwen AI',
|
|
26
|
+
options: {
|
|
27
|
+
baseURL: 'https://qwen.aikit.club/v1'
|
|
28
|
+
},
|
|
29
|
+
models: {
|
|
30
|
+
'qwen-max': { name: 'Qwen Max' },
|
|
31
|
+
'qwen-max-latest': { name: 'Qwen Max Latest' },
|
|
32
|
+
'qwen2.5-max': { name: 'Qwen2.5 Max' },
|
|
33
|
+
'qwen2.5-plus': { name: 'Qwen2.5 Plus' },
|
|
34
|
+
'qwen2.5-turbo': { name: 'Qwen2.5 Turbo' },
|
|
35
|
+
'qwen2.5-14b-instruct-1m': { name: 'Qwen2.5 14B Instruct 1M' },
|
|
36
|
+
'qwen2.5-72b-instruct': { name: 'Qwen2.5 72B Instruct' },
|
|
37
|
+
'qwen2.5-coder-32b-instruct': { name: 'Qwen2.5 Coder 32B' },
|
|
38
|
+
'qwen2.5-omni-7b': { name: 'Qwen2.5 Omni 7B' },
|
|
39
|
+
'qwen2.5-vl-32b-instruct': { name: 'Qwen2.5 VL 32B' },
|
|
40
|
+
'qwen3-next-80b-a3b': { name: 'Qwen3 Next 80B A3B' },
|
|
41
|
+
'qwen3-235b-a22b-2507': { name: 'Qwen3 235B A22B' },
|
|
42
|
+
'qwen3-30b-a3b-2507': { name: 'Qwen3 30B A3B' },
|
|
43
|
+
'qwen3-coder': { name: 'Qwen3 Coder' },
|
|
44
|
+
'qwen3-coder-flash': { name: 'Qwen3 Coder Flash' },
|
|
45
|
+
'qwen3-max': { name: 'Qwen3 Max' },
|
|
46
|
+
'qwen3-omni-flash': { name: 'Qwen3 Omni Flash' },
|
|
47
|
+
'qwen3-vl-235b-a22b': { name: 'Qwen3 VL 235B' },
|
|
48
|
+
'qwen3-vl-32b': { name: 'Qwen3 VL 32B' },
|
|
49
|
+
'qwen3-vl-30b-a3b': { name: 'Qwen3 VL 30B A3B' },
|
|
50
|
+
'qvq-max': { name: 'QVQ Max' },
|
|
51
|
+
'qwq-32b': { name: 'QWQ 32B' },
|
|
52
|
+
'qwen-deep-research': { name: 'Qwen Deep Research' },
|
|
53
|
+
'qwen-web-dev': { name: 'Qwen Web Dev' },
|
|
54
|
+
'qwen-full-stack': { name: 'Qwen Full Stack' },
|
|
55
|
+
'qwen-cogview': { name: 'Qwen CogView' }
|
|
73
56
|
}
|
|
74
|
-
}
|
|
75
|
-
} catch (error) {
|
|
76
|
-
// Silent fail
|
|
57
|
+
};
|
|
77
58
|
}
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
auth: {
|
|
62
|
+
provider: QWEN_PROVIDER_ID,
|
|
63
|
+
loader: async (auth, provider) => {
|
|
64
|
+
// Load and return the API key
|
|
65
|
+
return {
|
|
66
|
+
apiKey: auth?.apiKey || ''
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
methods: [
|
|
70
|
+
{
|
|
71
|
+
type: 'api',
|
|
72
|
+
label: 'API Key'
|
|
73
|
+
}
|
|
74
|
+
]
|
|
78
75
|
}
|
|
79
76
|
};
|
|
80
77
|
};
|