@bankr/cli 0.1.0 → 0.1.3
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/dist/commands/llm.js +144 -19
- package/package.json +1 -1
package/dist/commands/llm.js
CHANGED
|
@@ -11,100 +11,219 @@ const ERR_LLM_NOT_ENABLED = "LLM Gateway not enabled on this API key. Enable at
|
|
|
11
11
|
* Fallback model catalog — used when the gateway is unreachable or unauthenticated.
|
|
12
12
|
* resolveModels() fetches live data from GET /v1/models; this list is the offline safety net.
|
|
13
13
|
*/
|
|
14
|
+
const IMAGE_INPUT = ["text", "image"];
|
|
15
|
+
const TEXT_INPUT = ["text"];
|
|
14
16
|
const GATEWAY_MODELS = [
|
|
15
|
-
// Claude
|
|
17
|
+
// Claude
|
|
16
18
|
{
|
|
17
19
|
id: "claude-opus-4.6",
|
|
18
20
|
name: "Claude Opus 4.6",
|
|
19
21
|
owned_by: "anthropic",
|
|
20
|
-
|
|
22
|
+
contextWindow: 1000000,
|
|
23
|
+
maxTokens: 128000,
|
|
24
|
+
input: IMAGE_INPUT,
|
|
25
|
+
cost: { input: 5.0, output: 25.0, cacheRead: 0.5, cacheWrite: 6.25 },
|
|
21
26
|
},
|
|
22
27
|
{
|
|
23
28
|
id: "claude-opus-4.5",
|
|
24
29
|
name: "Claude Opus 4.5",
|
|
25
30
|
owned_by: "anthropic",
|
|
26
|
-
|
|
31
|
+
contextWindow: 200000,
|
|
32
|
+
maxTokens: 64000,
|
|
33
|
+
input: IMAGE_INPUT,
|
|
34
|
+
cost: { input: 5.0, output: 25.0, cacheRead: 0.5, cacheWrite: 6.25 },
|
|
27
35
|
},
|
|
28
36
|
{
|
|
29
37
|
id: "claude-sonnet-4.6",
|
|
30
38
|
name: "Claude Sonnet 4.6",
|
|
31
39
|
owned_by: "anthropic",
|
|
40
|
+
contextWindow: 1000000,
|
|
41
|
+
maxTokens: 128000,
|
|
42
|
+
input: IMAGE_INPUT,
|
|
32
43
|
cost: { input: 3.0, output: 15.0, cacheRead: 0.3, cacheWrite: 3.75 },
|
|
33
44
|
},
|
|
34
45
|
{
|
|
35
46
|
id: "claude-sonnet-4.5",
|
|
36
47
|
name: "Claude Sonnet 4.5",
|
|
37
48
|
owned_by: "anthropic",
|
|
49
|
+
contextWindow: 1000000,
|
|
50
|
+
maxTokens: 64000,
|
|
51
|
+
input: IMAGE_INPUT,
|
|
38
52
|
cost: { input: 3.0, output: 15.0, cacheRead: 0.3, cacheWrite: 3.75 },
|
|
39
53
|
},
|
|
40
54
|
{
|
|
41
55
|
id: "claude-haiku-4.5",
|
|
42
56
|
name: "Claude Haiku 4.5",
|
|
43
57
|
owned_by: "anthropic",
|
|
44
|
-
|
|
58
|
+
contextWindow: 200000,
|
|
59
|
+
maxTokens: 64000,
|
|
60
|
+
input: IMAGE_INPUT,
|
|
61
|
+
cost: { input: 1.0, output: 5.0, cacheRead: 0.1, cacheWrite: 1.25 },
|
|
62
|
+
},
|
|
63
|
+
// Gemini
|
|
64
|
+
{
|
|
65
|
+
id: "gemini-3.1-pro",
|
|
66
|
+
name: "Gemini 3.1 Pro",
|
|
67
|
+
owned_by: "google",
|
|
68
|
+
contextWindow: 1048576,
|
|
69
|
+
maxTokens: 65536,
|
|
70
|
+
input: IMAGE_INPUT,
|
|
71
|
+
cost: { input: 2.0, output: 12.0, cacheRead: 0.2, cacheWrite: 0.375 },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "gemini-3.1-flash-lite",
|
|
75
|
+
name: "Gemini 3.1 Flash Lite",
|
|
76
|
+
owned_by: "google",
|
|
77
|
+
contextWindow: 1048576,
|
|
78
|
+
maxTokens: 65536,
|
|
79
|
+
input: IMAGE_INPUT,
|
|
80
|
+
cost: { input: 0.25, output: 1.5, cacheRead: 0.025, cacheWrite: 0.08333 },
|
|
45
81
|
},
|
|
46
|
-
// Gemini — 75% cache read discount
|
|
47
82
|
{
|
|
48
83
|
id: "gemini-3-pro",
|
|
49
84
|
name: "Gemini 3 Pro",
|
|
50
85
|
owned_by: "google",
|
|
51
|
-
|
|
86
|
+
contextWindow: 1048576,
|
|
87
|
+
maxTokens: 65536,
|
|
88
|
+
input: IMAGE_INPUT,
|
|
89
|
+
cost: { input: 2.0, output: 12.0, cacheRead: 0.2, cacheWrite: 0.375 },
|
|
52
90
|
},
|
|
53
91
|
{
|
|
54
92
|
id: "gemini-3-flash",
|
|
55
93
|
name: "Gemini 3 Flash",
|
|
56
94
|
owned_by: "google",
|
|
57
|
-
|
|
95
|
+
contextWindow: 1048576,
|
|
96
|
+
maxTokens: 65535,
|
|
97
|
+
input: IMAGE_INPUT,
|
|
98
|
+
cost: { input: 0.5, output: 3.0, cacheRead: 0.05, cacheWrite: 0.0833 },
|
|
58
99
|
},
|
|
59
100
|
{
|
|
60
101
|
id: "gemini-2.5-pro",
|
|
61
102
|
name: "Gemini 2.5 Pro",
|
|
62
103
|
owned_by: "google",
|
|
63
|
-
|
|
104
|
+
contextWindow: 1048576,
|
|
105
|
+
maxTokens: 65536,
|
|
106
|
+
input: IMAGE_INPUT,
|
|
107
|
+
cost: { input: 1.25, output: 10.0, cacheRead: 0.125, cacheWrite: 0.375 },
|
|
64
108
|
},
|
|
65
109
|
{
|
|
66
110
|
id: "gemini-2.5-flash",
|
|
67
111
|
name: "Gemini 2.5 Flash",
|
|
68
112
|
owned_by: "google",
|
|
69
|
-
|
|
113
|
+
contextWindow: 1048576,
|
|
114
|
+
maxTokens: 65535,
|
|
115
|
+
input: IMAGE_INPUT,
|
|
116
|
+
cost: { input: 0.3, output: 2.5, cacheRead: 0.03, cacheWrite: 0.0833 },
|
|
117
|
+
},
|
|
118
|
+
// OpenAI
|
|
119
|
+
{
|
|
120
|
+
id: "gpt-5.4",
|
|
121
|
+
name: "GPT 5.4",
|
|
122
|
+
owned_by: "openai",
|
|
123
|
+
contextWindow: 1050000,
|
|
124
|
+
maxTokens: 128000,
|
|
125
|
+
input: IMAGE_INPUT,
|
|
126
|
+
cost: { input: 2.5, output: 15.0, cacheRead: 0.25, cacheWrite: 0 },
|
|
70
127
|
},
|
|
71
|
-
// OpenAI — 50% cache read discount
|
|
72
128
|
{
|
|
73
129
|
id: "gpt-5.2",
|
|
74
130
|
name: "GPT 5.2",
|
|
75
131
|
owned_by: "openai",
|
|
76
|
-
|
|
132
|
+
contextWindow: 400000,
|
|
133
|
+
maxTokens: 128000,
|
|
134
|
+
input: TEXT_INPUT,
|
|
135
|
+
cost: { input: 1.75, output: 14.0, cacheRead: 0.175, cacheWrite: 0 },
|
|
77
136
|
},
|
|
78
137
|
{
|
|
79
138
|
id: "gpt-5.2-codex",
|
|
80
139
|
name: "GPT 5.2 Codex",
|
|
81
140
|
owned_by: "openai",
|
|
82
|
-
|
|
141
|
+
contextWindow: 400000,
|
|
142
|
+
maxTokens: 128000,
|
|
143
|
+
input: TEXT_INPUT,
|
|
144
|
+
cost: { input: 1.75, output: 14.0, cacheRead: 0.175, cacheWrite: 0 },
|
|
83
145
|
},
|
|
84
146
|
{
|
|
85
147
|
id: "gpt-5-mini",
|
|
86
148
|
name: "GPT 5 Mini",
|
|
87
149
|
owned_by: "openai",
|
|
88
|
-
|
|
150
|
+
contextWindow: 400000,
|
|
151
|
+
maxTokens: 128000,
|
|
152
|
+
input: TEXT_INPUT,
|
|
153
|
+
cost: { input: 0.25, output: 2.0, cacheRead: 0.025, cacheWrite: 0 },
|
|
89
154
|
},
|
|
90
155
|
{
|
|
91
156
|
id: "gpt-5-nano",
|
|
92
157
|
name: "GPT 5 Nano",
|
|
93
158
|
owned_by: "openai",
|
|
94
|
-
|
|
159
|
+
contextWindow: 400000,
|
|
160
|
+
maxTokens: 128000,
|
|
161
|
+
input: TEXT_INPUT,
|
|
162
|
+
cost: { input: 0.05, output: 0.4, cacheRead: 0.005, cacheWrite: 0 },
|
|
95
163
|
},
|
|
96
164
|
// Other providers
|
|
97
165
|
{
|
|
98
|
-
id: "
|
|
99
|
-
name: "
|
|
100
|
-
owned_by: "
|
|
101
|
-
|
|
166
|
+
id: "grok-4.1-fast",
|
|
167
|
+
name: "Grok 4.1 Fast",
|
|
168
|
+
owned_by: "x-ai",
|
|
169
|
+
contextWindow: 2000000,
|
|
170
|
+
maxTokens: 30000,
|
|
171
|
+
input: TEXT_INPUT,
|
|
172
|
+
cost: { input: 0.2, output: 0.5, cacheRead: 0.05, cacheWrite: 0 },
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "deepseek-v3.2",
|
|
176
|
+
name: "DeepSeek V3.2",
|
|
177
|
+
owned_by: "deepseek",
|
|
178
|
+
contextWindow: 163840,
|
|
179
|
+
maxTokens: 65536,
|
|
180
|
+
input: TEXT_INPUT,
|
|
181
|
+
cost: { input: 0.26, output: 0.38, cacheRead: 0.13, cacheWrite: 0 },
|
|
102
182
|
},
|
|
103
183
|
{
|
|
104
184
|
id: "qwen3-coder",
|
|
105
185
|
name: "Qwen3 Coder",
|
|
106
186
|
owned_by: "qwen",
|
|
107
|
-
|
|
187
|
+
contextWindow: 262144,
|
|
188
|
+
maxTokens: 65536,
|
|
189
|
+
input: TEXT_INPUT,
|
|
190
|
+
cost: { input: 0.12, output: 0.75, cacheRead: 0.06, cacheWrite: 0 },
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: "qwen3.5-plus",
|
|
194
|
+
name: "Qwen3.5 Plus",
|
|
195
|
+
owned_by: "qwen",
|
|
196
|
+
contextWindow: 1000000,
|
|
197
|
+
maxTokens: 65536,
|
|
198
|
+
input: TEXT_INPUT,
|
|
199
|
+
cost: { input: 0.26, output: 1.56, cacheRead: 0, cacheWrite: 0 },
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: "qwen3.5-flash",
|
|
203
|
+
name: "Qwen3.5 Flash",
|
|
204
|
+
owned_by: "qwen",
|
|
205
|
+
contextWindow: 1000000,
|
|
206
|
+
maxTokens: 65536,
|
|
207
|
+
input: TEXT_INPUT,
|
|
208
|
+
cost: { input: 0.1, output: 0.4, cacheRead: 0, cacheWrite: 0 },
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: "kimi-k2.5",
|
|
212
|
+
name: "Kimi K2.5",
|
|
213
|
+
owned_by: "moonshotai",
|
|
214
|
+
contextWindow: 262144,
|
|
215
|
+
maxTokens: 65535,
|
|
216
|
+
input: TEXT_INPUT,
|
|
217
|
+
cost: { input: 0.45, output: 2.2, cacheRead: 0.225, cacheWrite: 0 },
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "minimax-m2.5",
|
|
221
|
+
name: "MiniMax M2.5",
|
|
222
|
+
owned_by: "minimax",
|
|
223
|
+
contextWindow: 196608,
|
|
224
|
+
maxTokens: 196608,
|
|
225
|
+
input: TEXT_INPUT,
|
|
226
|
+
cost: { input: 0.27, output: 0.95, cacheRead: 0.03, cacheWrite: 0 },
|
|
108
227
|
},
|
|
109
228
|
];
|
|
110
229
|
/** Fetch live model list from the gateway; falls back to hardcoded catalog. */
|
|
@@ -126,6 +245,9 @@ async function resolveModels() {
|
|
|
126
245
|
id: m.id,
|
|
127
246
|
name: m.name ?? fallback?.name ?? m.id,
|
|
128
247
|
owned_by: m.owned_by,
|
|
248
|
+
contextWindow: m.context_window ?? fallback?.contextWindow ?? 128000,
|
|
249
|
+
maxTokens: m.max_output_tokens ?? fallback?.maxTokens ?? 32768,
|
|
250
|
+
input: m.input_modalities ?? fallback?.input ?? TEXT_INPUT,
|
|
129
251
|
cost: m.pricing
|
|
130
252
|
? {
|
|
131
253
|
input: m.pricing.input,
|
|
@@ -557,6 +679,9 @@ export async function setupOpenclawCommand(opts) {
|
|
|
557
679
|
id: m.id,
|
|
558
680
|
name: m.name,
|
|
559
681
|
...(m.owned_by === "anthropic" ? { api: "anthropic-messages" } : {}),
|
|
682
|
+
input: m.input,
|
|
683
|
+
contextWindow: m.contextWindow,
|
|
684
|
+
maxTokens: m.maxTokens,
|
|
560
685
|
cost: m.cost,
|
|
561
686
|
})),
|
|
562
687
|
};
|