@openclaw/chutes-provider 2026.7.2-beta.4 → 2026.7.2-beta.7
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/api.js +3 -3
- package/dist/index.js +1 -2
- package/dist/models-BEC8VGou.js +245 -0
- package/dist/models.js +2 -2
- package/dist/onboard.js +18 -22
- package/dist/provider-catalog.js +3 -3
- package/openclaw.plugin.json +41 -8
- package/package.json +4 -5
- package/dist/models-C-sxoYI8.js +0 -184
- package/npm-shrinkwrap.json +0 -12
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig } from "./onboard.js";
|
|
1
|
+
import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-BEC8VGou.js";
|
|
2
|
+
import { CHUTES_DEFAULT_MODEL_ID, CHUTES_DEFAULT_MODEL_REF, applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig } from "./onboard.js";
|
|
3
3
|
import { buildChutesProvider } from "./provider-catalog.js";
|
|
4
|
-
export { CHUTES_BASE_URL, CHUTES_DEFAULT_MODEL_ID, CHUTES_DEFAULT_MODEL_REF, CHUTES_MODEL_CATALOG, applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig,
|
|
4
|
+
export { CHUTES_BASE_URL, CHUTES_DEFAULT_MODEL_ID, CHUTES_DEFAULT_MODEL_REF, CHUTES_MODEL_CATALOG, applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig, buildChutesProvider, discoverChutesModels };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { loginChutes } from "./oauth.js";
|
|
2
|
-
import {
|
|
3
|
-
import { applyChutesApiKeyConfig, applyChutesProviderConfig } from "./onboard.js";
|
|
2
|
+
import { CHUTES_DEFAULT_MODEL_REF, applyChutesApiKeyConfig, applyChutesProviderConfig } from "./onboard.js";
|
|
4
3
|
import { buildChutesProvider, buildStaticChutesProvider } from "./provider-catalog.js";
|
|
5
4
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
6
5
|
import { buildOauthProviderAuthResult, resolveOAuthApiKeyMarker } from "openclaw/plugin-sdk/provider-auth";
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { isChutesModelDiscoveryTestEnvironment } from "./model-discovery-env.js";
|
|
2
|
+
import { asPositiveSafeInteger, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { buildManifestModelDefinition } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
4
|
+
import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
|
|
5
|
+
import { buildLiveModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
6
|
+
import { fetchWithSsrFGuard, ssrfPolicyFromHttpBaseUrlAllowedHostname } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
7
|
+
//#region extensions/chutes/openclaw.plugin.json
|
|
8
|
+
var openclaw_plugin_default = {
|
|
9
|
+
id: "chutes",
|
|
10
|
+
activation: { "onStartup": false },
|
|
11
|
+
enabledByDefault: true,
|
|
12
|
+
providers: ["chutes"],
|
|
13
|
+
providerEndpoints: [{
|
|
14
|
+
"endpointClass": "chutes-native",
|
|
15
|
+
"hosts": ["llm.chutes.ai"]
|
|
16
|
+
}],
|
|
17
|
+
providerRequest: { "providers": { "chutes": { "family": "chutes" } } },
|
|
18
|
+
setup: { "providers": [{
|
|
19
|
+
"id": "chutes",
|
|
20
|
+
"envVars": ["CHUTES_API_KEY", "CHUTES_OAUTH_TOKEN"]
|
|
21
|
+
}] },
|
|
22
|
+
providerAuthChoices: [{
|
|
23
|
+
"provider": "chutes",
|
|
24
|
+
"method": "oauth",
|
|
25
|
+
"choiceId": "chutes",
|
|
26
|
+
"appGuidedAuth": "oauth",
|
|
27
|
+
"choiceLabel": "Chutes (OAuth)",
|
|
28
|
+
"choiceHint": "Browser sign-in",
|
|
29
|
+
"groupId": "chutes",
|
|
30
|
+
"groupLabel": "Chutes",
|
|
31
|
+
"groupHint": "OAuth + API key"
|
|
32
|
+
}, {
|
|
33
|
+
"provider": "chutes",
|
|
34
|
+
"method": "api-key",
|
|
35
|
+
"choiceId": "chutes-api-key",
|
|
36
|
+
"appGuidedSecret": true,
|
|
37
|
+
"choiceLabel": "Chutes API key",
|
|
38
|
+
"choiceHint": "Open-source models including Llama, DeepSeek, and more",
|
|
39
|
+
"groupId": "chutes",
|
|
40
|
+
"groupLabel": "Chutes",
|
|
41
|
+
"groupHint": "OAuth + API key",
|
|
42
|
+
"optionKey": "chutesApiKey",
|
|
43
|
+
"cliFlag": "--chutes-api-key",
|
|
44
|
+
"cliOption": "--chutes-api-key <key>",
|
|
45
|
+
"cliDescription": "Chutes API key"
|
|
46
|
+
}],
|
|
47
|
+
configSchema: {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"properties": {}
|
|
51
|
+
},
|
|
52
|
+
modelCatalog: {
|
|
53
|
+
"providers": { "chutes": {
|
|
54
|
+
"baseUrl": "https://llm.chutes.ai/v1",
|
|
55
|
+
"api": "openai-completions",
|
|
56
|
+
"defaultModel": "zai-org/GLM-5.2-TEE",
|
|
57
|
+
"models": [
|
|
58
|
+
{
|
|
59
|
+
"id": "deepseek-ai/DeepSeek-V3.2-TEE",
|
|
60
|
+
"name": "deepseek-ai/DeepSeek-V3.2-TEE",
|
|
61
|
+
"reasoning": true,
|
|
62
|
+
"input": ["text"],
|
|
63
|
+
"contextWindow": 131072,
|
|
64
|
+
"maxTokens": 65536,
|
|
65
|
+
"cost": {
|
|
66
|
+
"input": 1,
|
|
67
|
+
"output": 1,
|
|
68
|
+
"cacheRead": .5,
|
|
69
|
+
"cacheWrite": 0
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"id": "moonshotai/Kimi-K2.6-TEE",
|
|
74
|
+
"name": "moonshotai/Kimi-K2.6-TEE",
|
|
75
|
+
"reasoning": true,
|
|
76
|
+
"input": ["text", "image"],
|
|
77
|
+
"contextWindow": 262144,
|
|
78
|
+
"maxTokens": 65535,
|
|
79
|
+
"cost": {
|
|
80
|
+
"input": .66,
|
|
81
|
+
"output": 3.5,
|
|
82
|
+
"cacheRead": .33,
|
|
83
|
+
"cacheWrite": 0
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"id": "moonshotai/Kimi-K2.5-TEE",
|
|
88
|
+
"name": "moonshotai/Kimi-K2.5-TEE",
|
|
89
|
+
"reasoning": true,
|
|
90
|
+
"input": ["text", "image"],
|
|
91
|
+
"contextWindow": 262144,
|
|
92
|
+
"maxTokens": 65535,
|
|
93
|
+
"cost": {
|
|
94
|
+
"input": .44,
|
|
95
|
+
"output": 2,
|
|
96
|
+
"cacheRead": .22,
|
|
97
|
+
"cacheWrite": 0
|
|
98
|
+
},
|
|
99
|
+
"status": "deprecated",
|
|
100
|
+
"replacedBy": "moonshotai/Kimi-K2.6-TEE"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "zai-org/GLM-5.2-TEE",
|
|
104
|
+
"name": "zai-org/GLM-5.2-TEE",
|
|
105
|
+
"reasoning": true,
|
|
106
|
+
"input": ["text"],
|
|
107
|
+
"contextWindow": 1048576,
|
|
108
|
+
"maxTokens": 65535,
|
|
109
|
+
"cost": {
|
|
110
|
+
"input": 1.25,
|
|
111
|
+
"output": 3.95,
|
|
112
|
+
"cacheRead": .625,
|
|
113
|
+
"cacheWrite": 0
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "MiniMaxAI/MiniMax-M2.5-TEE",
|
|
118
|
+
"name": "MiniMaxAI/MiniMax-M2.5-TEE",
|
|
119
|
+
"reasoning": true,
|
|
120
|
+
"input": ["text"],
|
|
121
|
+
"contextWindow": 196608,
|
|
122
|
+
"maxTokens": 65536,
|
|
123
|
+
"cost": {
|
|
124
|
+
"input": .15,
|
|
125
|
+
"output": 1.2,
|
|
126
|
+
"cacheRead": .075,
|
|
127
|
+
"cacheWrite": 0
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "Qwen/Qwen3.6-27B-TEE",
|
|
132
|
+
"name": "Qwen/Qwen3.6-27B-TEE",
|
|
133
|
+
"reasoning": true,
|
|
134
|
+
"input": ["text", "image"],
|
|
135
|
+
"contextWindow": 262144,
|
|
136
|
+
"maxTokens": 65536,
|
|
137
|
+
"cost": {
|
|
138
|
+
"input": .3,
|
|
139
|
+
"output": 2,
|
|
140
|
+
"cacheRead": .15,
|
|
141
|
+
"cacheWrite": 0
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "Qwen/Qwen3.5-397B-A17B-TEE",
|
|
146
|
+
"name": "Qwen/Qwen3.5-397B-A17B-TEE",
|
|
147
|
+
"reasoning": true,
|
|
148
|
+
"input": ["text", "image"],
|
|
149
|
+
"contextWindow": 262144,
|
|
150
|
+
"maxTokens": 65536,
|
|
151
|
+
"cost": {
|
|
152
|
+
"input": .45,
|
|
153
|
+
"output": 3,
|
|
154
|
+
"cacheRead": .225,
|
|
155
|
+
"cacheWrite": 0
|
|
156
|
+
},
|
|
157
|
+
"status": "deprecated",
|
|
158
|
+
"replacedBy": "Qwen/Qwen3.6-27B-TEE"
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
} },
|
|
162
|
+
"discovery": { "chutes": "refreshable" }
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region extensions/chutes/models.ts
|
|
167
|
+
/**
|
|
168
|
+
* Chutes model catalog, static model definitions, and dynamic model discovery.
|
|
169
|
+
*/
|
|
170
|
+
const CHUTES_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers.chutes;
|
|
171
|
+
/** Base URL for Chutes OpenAI-compatible inference. */
|
|
172
|
+
const CHUTES_BASE_URL = CHUTES_MANIFEST_CATALOG.baseUrl;
|
|
173
|
+
const CHUTES_DEFAULT_CONTEXT_WINDOW = 128e3;
|
|
174
|
+
const CHUTES_DEFAULT_MAX_TOKENS = 4096;
|
|
175
|
+
function decorateChutesModelDefinition(model) {
|
|
176
|
+
return {
|
|
177
|
+
...model,
|
|
178
|
+
compat: {
|
|
179
|
+
...model.compat,
|
|
180
|
+
supportsUsageInStreaming: false
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** Bundled fallback Chutes model catalog, normalized from the plugin manifest. */
|
|
185
|
+
const CHUTES_MODEL_CATALOG = CHUTES_MANIFEST_CATALOG.models.map(buildManifestModelDefinition({
|
|
186
|
+
providerId: "chutes",
|
|
187
|
+
catalog: CHUTES_MANIFEST_CATALOG,
|
|
188
|
+
decorate: decorateChutesModelDefinition
|
|
189
|
+
}));
|
|
190
|
+
const CACHE_TTL = 300 * 1e3;
|
|
191
|
+
function projectChutesModels(rows) {
|
|
192
|
+
const seen = /* @__PURE__ */ new Set();
|
|
193
|
+
const models = [];
|
|
194
|
+
for (const row of rows) {
|
|
195
|
+
if (!row || typeof row !== "object" || Array.isArray(row)) continue;
|
|
196
|
+
const entry = row;
|
|
197
|
+
const id = normalizeOptionalString(entry.id) ?? "";
|
|
198
|
+
if (!id || seen.has(id)) continue;
|
|
199
|
+
seen.add(id);
|
|
200
|
+
const lowerId = normalizeLowercaseStringOrEmpty(id);
|
|
201
|
+
models.push({
|
|
202
|
+
id,
|
|
203
|
+
name: id,
|
|
204
|
+
reasoning: entry.supported_features?.includes("reasoning") || lowerId.includes("r1") || lowerId.includes("thinking") || lowerId.includes("reason") || lowerId.includes("tee"),
|
|
205
|
+
input: (entry.input_modalities || ["text"]).filter((item) => item === "text" || item === "image"),
|
|
206
|
+
cost: {
|
|
207
|
+
input: entry.pricing?.prompt || 0,
|
|
208
|
+
output: entry.pricing?.completion || 0,
|
|
209
|
+
cacheRead: entry.pricing?.input_cache_read || 0,
|
|
210
|
+
cacheWrite: 0
|
|
211
|
+
},
|
|
212
|
+
contextWindow: asPositiveSafeInteger(entry.context_length) ?? CHUTES_DEFAULT_CONTEXT_WINDOW,
|
|
213
|
+
maxTokens: asPositiveSafeInteger(entry.max_output_length) ?? CHUTES_DEFAULT_MAX_TOKENS,
|
|
214
|
+
compat: { supportsUsageInStreaming: false }
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return models;
|
|
218
|
+
}
|
|
219
|
+
/** Discovers Chutes models dynamically, falling back to the bundled static catalog. */
|
|
220
|
+
async function discoverChutesModels(accessToken) {
|
|
221
|
+
if (isChutesModelDiscoveryTestEnvironment()) return structuredClone(CHUTES_MODEL_CATALOG);
|
|
222
|
+
return (await buildLiveModelProviderConfig({
|
|
223
|
+
providerId: "chutes",
|
|
224
|
+
endpoint: `${CHUTES_BASE_URL}/models`,
|
|
225
|
+
providerConfig: {
|
|
226
|
+
baseUrl: CHUTES_BASE_URL,
|
|
227
|
+
api: "openai-completions"
|
|
228
|
+
},
|
|
229
|
+
models: structuredClone(CHUTES_MODEL_CATALOG),
|
|
230
|
+
discoveryApiKey: normalizeOptionalString(accessToken),
|
|
231
|
+
timeoutMs: 1e4,
|
|
232
|
+
ttlMs: CACHE_TTL,
|
|
233
|
+
buildRequestHeaders: ({ discoveryApiKey }) => ({
|
|
234
|
+
Accept: "application/json",
|
|
235
|
+
...discoveryApiKey ? { Authorization: `Bearer ${discoveryApiKey}` } : {}
|
|
236
|
+
}),
|
|
237
|
+
policy: ssrfPolicyFromHttpBaseUrlAllowedHostname(CHUTES_BASE_URL),
|
|
238
|
+
auditContext: "chutes-model-discovery",
|
|
239
|
+
fetchGuard: (params) => fetchWithSsrFGuard(withTrustedEnvProxyGuardedFetchMode(params)),
|
|
240
|
+
fallbackToAnonymousOnUnauthorized: true,
|
|
241
|
+
projectRows: projectChutesModels
|
|
242
|
+
})).models;
|
|
243
|
+
}
|
|
244
|
+
//#endregion
|
|
245
|
+
export { openclaw_plugin_default as i, CHUTES_MODEL_CATALOG as n, discoverChutesModels as r, CHUTES_BASE_URL as t };
|
package/dist/models.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { CHUTES_BASE_URL,
|
|
1
|
+
import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-BEC8VGou.js";
|
|
2
|
+
export { CHUTES_BASE_URL, CHUTES_MODEL_CATALOG, discoverChutesModels };
|
package/dist/onboard.js
CHANGED
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { i as openclaw_plugin_default, n as CHUTES_MODEL_CATALOG, t as CHUTES_BASE_URL } from "./models-BEC8VGou.js";
|
|
2
|
+
import { readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
|
+
import { applyAgentDefaultModelPrimary, createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
3
4
|
//#region extensions/chutes/onboard.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Registers all catalog models and convenience aliases.
|
|
10
|
-
*/
|
|
11
|
-
function applyChutesProviderConfig(cfg) {
|
|
12
|
-
return applyProviderConfigWithModelCatalogPreset(cfg, {
|
|
5
|
+
const CHUTES_DEFAULT_MODEL_ID = openclaw_plugin_default.modelCatalog.providers.chutes.defaultModel;
|
|
6
|
+
const CHUTES_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef(openclaw_plugin_default, "chutes");
|
|
7
|
+
const chutesPresetAppliers = createModelCatalogPresetAppliers({
|
|
8
|
+
primaryModelRef: CHUTES_DEFAULT_MODEL_REF,
|
|
9
|
+
resolveParams: (_cfg) => ({
|
|
13
10
|
providerId: "chutes",
|
|
14
11
|
api: "openai-completions",
|
|
15
12
|
baseUrl: CHUTES_BASE_URL,
|
|
16
|
-
catalogModels: CHUTES_MODEL_CATALOG
|
|
13
|
+
catalogModels: structuredClone(CHUTES_MODEL_CATALOG),
|
|
17
14
|
aliases: [
|
|
18
15
|
...CHUTES_MODEL_CATALOG.map((model) => `chutes/${model.id}`),
|
|
19
16
|
{
|
|
20
17
|
modelRef: "chutes-vision",
|
|
21
|
-
alias: "chutes/moonshotai/Kimi-K2.
|
|
18
|
+
alias: "chutes/moonshotai/Kimi-K2.6-TEE"
|
|
22
19
|
},
|
|
23
20
|
{
|
|
24
21
|
modelRef: "chutes-pro",
|
|
25
22
|
alias: "chutes/deepseek-ai/DeepSeek-V3.2-TEE"
|
|
26
23
|
}
|
|
27
24
|
]
|
|
28
|
-
})
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
function applyChutesProviderConfig(cfg) {
|
|
28
|
+
return chutesPresetAppliers.applyProviderConfig(cfg);
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Apply Chutes provider configuration AND set Chutes as the default model.
|
|
32
|
-
*/
|
|
33
30
|
function applyChutesConfig(cfg) {
|
|
34
31
|
const next = applyChutesProviderConfig(cfg);
|
|
35
32
|
return {
|
|
@@ -40,19 +37,18 @@ function applyChutesConfig(cfg) {
|
|
|
40
37
|
...next.agents?.defaults,
|
|
41
38
|
model: {
|
|
42
39
|
primary: CHUTES_DEFAULT_MODEL_REF,
|
|
43
|
-
fallbacks: ["chutes/deepseek-ai/DeepSeek-V3.2-TEE", "chutes/moonshotai/Kimi-K2.
|
|
40
|
+
fallbacks: ["chutes/deepseek-ai/DeepSeek-V3.2-TEE", "chutes/moonshotai/Kimi-K2.6-TEE"]
|
|
44
41
|
},
|
|
45
42
|
imageModel: {
|
|
46
|
-
primary: "chutes/moonshotai/Kimi-K2.
|
|
47
|
-
fallbacks: ["chutes/Qwen/Qwen3.
|
|
43
|
+
primary: "chutes/moonshotai/Kimi-K2.6-TEE",
|
|
44
|
+
fallbacks: ["chutes/Qwen/Qwen3.6-27B-TEE"]
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
};
|
|
52
49
|
}
|
|
53
|
-
/** Applies Chutes provider config and sets the default model for API-key auth. */
|
|
54
50
|
function applyChutesApiKeyConfig(cfg) {
|
|
55
51
|
return applyAgentDefaultModelPrimary(applyChutesProviderConfig(cfg), CHUTES_DEFAULT_MODEL_REF);
|
|
56
52
|
}
|
|
57
53
|
//#endregion
|
|
58
|
-
export { CHUTES_DEFAULT_MODEL_REF, applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig };
|
|
54
|
+
export { CHUTES_DEFAULT_MODEL_ID, CHUTES_DEFAULT_MODEL_REF, applyChutesApiKeyConfig, applyChutesConfig, applyChutesProviderConfig };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as CHUTES_MODEL_CATALOG, r as discoverChutesModels, t as CHUTES_BASE_URL } from "./models-BEC8VGou.js";
|
|
2
2
|
//#region extensions/chutes/provider-catalog.ts
|
|
3
3
|
/** Builds the static Chutes provider catalog from bundled model metadata. */
|
|
4
4
|
function buildStaticChutesProvider() {
|
|
5
5
|
return {
|
|
6
6
|
baseUrl: CHUTES_BASE_URL,
|
|
7
7
|
api: "openai-completions",
|
|
8
|
-
models: CHUTES_MODEL_CATALOG
|
|
8
|
+
models: structuredClone(CHUTES_MODEL_CATALOG)
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -18,7 +18,7 @@ async function buildChutesProvider(accessToken) {
|
|
|
18
18
|
return {
|
|
19
19
|
baseUrl: CHUTES_BASE_URL,
|
|
20
20
|
api: "openai-completions",
|
|
21
|
-
models: models.length > 0 ? models : CHUTES_MODEL_CATALOG
|
|
21
|
+
models: models.length > 0 ? models : structuredClone(CHUTES_MODEL_CATALOG)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
package/openclaw.plugin.json
CHANGED
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"chutes": {
|
|
65
65
|
"baseUrl": "https://llm.chutes.ai/v1",
|
|
66
66
|
"api": "openai-completions",
|
|
67
|
+
"defaultModel": "zai-org/GLM-5.2-TEE",
|
|
67
68
|
"models": [
|
|
68
69
|
{
|
|
69
70
|
"id": "deepseek-ai/DeepSeek-V3.2-TEE",
|
|
@@ -79,6 +80,20 @@
|
|
|
79
80
|
"cacheWrite": 0
|
|
80
81
|
}
|
|
81
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"id": "moonshotai/Kimi-K2.6-TEE",
|
|
85
|
+
"name": "moonshotai/Kimi-K2.6-TEE",
|
|
86
|
+
"reasoning": true,
|
|
87
|
+
"input": ["text", "image"],
|
|
88
|
+
"contextWindow": 262144,
|
|
89
|
+
"maxTokens": 65535,
|
|
90
|
+
"cost": {
|
|
91
|
+
"input": 0.66,
|
|
92
|
+
"output": 3.5,
|
|
93
|
+
"cacheRead": 0.33,
|
|
94
|
+
"cacheWrite": 0
|
|
95
|
+
}
|
|
96
|
+
},
|
|
82
97
|
{
|
|
83
98
|
"id": "moonshotai/Kimi-K2.5-TEE",
|
|
84
99
|
"name": "moonshotai/Kimi-K2.5-TEE",
|
|
@@ -91,19 +106,21 @@
|
|
|
91
106
|
"output": 2,
|
|
92
107
|
"cacheRead": 0.22,
|
|
93
108
|
"cacheWrite": 0
|
|
94
|
-
}
|
|
109
|
+
},
|
|
110
|
+
"status": "deprecated",
|
|
111
|
+
"replacedBy": "moonshotai/Kimi-K2.6-TEE"
|
|
95
112
|
},
|
|
96
113
|
{
|
|
97
|
-
"id": "zai-org/GLM-5-TEE",
|
|
98
|
-
"name": "zai-org/GLM-5-TEE",
|
|
114
|
+
"id": "zai-org/GLM-5.2-TEE",
|
|
115
|
+
"name": "zai-org/GLM-5.2-TEE",
|
|
99
116
|
"reasoning": true,
|
|
100
117
|
"input": ["text"],
|
|
101
|
-
"contextWindow":
|
|
118
|
+
"contextWindow": 1048576,
|
|
102
119
|
"maxTokens": 65535,
|
|
103
120
|
"cost": {
|
|
104
|
-
"input":
|
|
105
|
-
"output":
|
|
106
|
-
"cacheRead": 0.
|
|
121
|
+
"input": 1.25,
|
|
122
|
+
"output": 3.95,
|
|
123
|
+
"cacheRead": 0.625,
|
|
107
124
|
"cacheWrite": 0
|
|
108
125
|
}
|
|
109
126
|
},
|
|
@@ -121,6 +138,20 @@
|
|
|
121
138
|
"cacheWrite": 0
|
|
122
139
|
}
|
|
123
140
|
},
|
|
141
|
+
{
|
|
142
|
+
"id": "Qwen/Qwen3.6-27B-TEE",
|
|
143
|
+
"name": "Qwen/Qwen3.6-27B-TEE",
|
|
144
|
+
"reasoning": true,
|
|
145
|
+
"input": ["text", "image"],
|
|
146
|
+
"contextWindow": 262144,
|
|
147
|
+
"maxTokens": 65536,
|
|
148
|
+
"cost": {
|
|
149
|
+
"input": 0.3,
|
|
150
|
+
"output": 2,
|
|
151
|
+
"cacheRead": 0.15,
|
|
152
|
+
"cacheWrite": 0
|
|
153
|
+
}
|
|
154
|
+
},
|
|
124
155
|
{
|
|
125
156
|
"id": "Qwen/Qwen3.5-397B-A17B-TEE",
|
|
126
157
|
"name": "Qwen/Qwen3.5-397B-A17B-TEE",
|
|
@@ -133,7 +164,9 @@
|
|
|
133
164
|
"output": 3,
|
|
134
165
|
"cacheRead": 0.225,
|
|
135
166
|
"cacheWrite": 0
|
|
136
|
-
}
|
|
167
|
+
},
|
|
168
|
+
"status": "deprecated",
|
|
169
|
+
"replacedBy": "Qwen/Qwen3.6-27B-TEE"
|
|
137
170
|
}
|
|
138
171
|
]
|
|
139
172
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/chutes-provider",
|
|
3
|
-
"version": "2026.7.2-beta.
|
|
3
|
+
"version": "2026.7.2-beta.7",
|
|
4
4
|
"description": "OpenClaw Chutes.ai provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.7.2-beta.
|
|
21
|
+
"pluginApi": ">=2026.7.2-beta.7"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.7.2-beta.
|
|
24
|
+
"openclawVersion": "2026.7.2-beta.7",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -35,11 +35,10 @@
|
|
|
35
35
|
"files": [
|
|
36
36
|
"dist/**",
|
|
37
37
|
"openclaw.plugin.json",
|
|
38
|
-
"npm-shrinkwrap.json",
|
|
39
38
|
"README.md"
|
|
40
39
|
],
|
|
41
40
|
"peerDependencies": {
|
|
42
|
-
"openclaw": ">=2026.7.2-beta.
|
|
41
|
+
"openclaw": ">=2026.7.2-beta.7"
|
|
43
42
|
},
|
|
44
43
|
"peerDependenciesMeta": {
|
|
45
44
|
"openclaw": {
|
package/dist/models-C-sxoYI8.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { isChutesModelDiscoveryTestEnvironment } from "./model-discovery-env.js";
|
|
2
|
-
import { asPositiveSafeInteger, normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
|
|
4
|
-
import { LiveModelCatalogHttpError, getCachedLiveProviderModelRows } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
5
|
-
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
6
|
-
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
7
|
-
import { fetchWithSsrFGuard, ssrfPolicyFromHttpBaseUrlAllowedHostname } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
8
|
-
//#region extensions/chutes/openclaw.plugin.json
|
|
9
|
-
var modelCatalog = {
|
|
10
|
-
"providers": { "chutes": {
|
|
11
|
-
"baseUrl": "https://llm.chutes.ai/v1",
|
|
12
|
-
"api": "openai-completions",
|
|
13
|
-
"models": [
|
|
14
|
-
{
|
|
15
|
-
"id": "deepseek-ai/DeepSeek-V3.2-TEE",
|
|
16
|
-
"name": "deepseek-ai/DeepSeek-V3.2-TEE",
|
|
17
|
-
"reasoning": true,
|
|
18
|
-
"input": ["text"],
|
|
19
|
-
"contextWindow": 131072,
|
|
20
|
-
"maxTokens": 65536,
|
|
21
|
-
"cost": {
|
|
22
|
-
"input": 1,
|
|
23
|
-
"output": 1,
|
|
24
|
-
"cacheRead": .5,
|
|
25
|
-
"cacheWrite": 0
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"id": "moonshotai/Kimi-K2.5-TEE",
|
|
30
|
-
"name": "moonshotai/Kimi-K2.5-TEE",
|
|
31
|
-
"reasoning": true,
|
|
32
|
-
"input": ["text", "image"],
|
|
33
|
-
"contextWindow": 262144,
|
|
34
|
-
"maxTokens": 65535,
|
|
35
|
-
"cost": {
|
|
36
|
-
"input": .44,
|
|
37
|
-
"output": 2,
|
|
38
|
-
"cacheRead": .22,
|
|
39
|
-
"cacheWrite": 0
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"id": "zai-org/GLM-5-TEE",
|
|
44
|
-
"name": "zai-org/GLM-5-TEE",
|
|
45
|
-
"reasoning": true,
|
|
46
|
-
"input": ["text"],
|
|
47
|
-
"contextWindow": 202752,
|
|
48
|
-
"maxTokens": 65535,
|
|
49
|
-
"cost": {
|
|
50
|
-
"input": .95,
|
|
51
|
-
"output": 2.55,
|
|
52
|
-
"cacheRead": .475,
|
|
53
|
-
"cacheWrite": 0
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"id": "MiniMaxAI/MiniMax-M2.5-TEE",
|
|
58
|
-
"name": "MiniMaxAI/MiniMax-M2.5-TEE",
|
|
59
|
-
"reasoning": true,
|
|
60
|
-
"input": ["text"],
|
|
61
|
-
"contextWindow": 196608,
|
|
62
|
-
"maxTokens": 65536,
|
|
63
|
-
"cost": {
|
|
64
|
-
"input": .15,
|
|
65
|
-
"output": 1.2,
|
|
66
|
-
"cacheRead": .075,
|
|
67
|
-
"cacheWrite": 0
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"id": "Qwen/Qwen3.5-397B-A17B-TEE",
|
|
72
|
-
"name": "Qwen/Qwen3.5-397B-A17B-TEE",
|
|
73
|
-
"reasoning": true,
|
|
74
|
-
"input": ["text", "image"],
|
|
75
|
-
"contextWindow": 262144,
|
|
76
|
-
"maxTokens": 65536,
|
|
77
|
-
"cost": {
|
|
78
|
-
"input": .45,
|
|
79
|
-
"output": 3,
|
|
80
|
-
"cacheRead": .225,
|
|
81
|
-
"cacheWrite": 0
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
} },
|
|
86
|
-
"discovery": { "chutes": "refreshable" }
|
|
87
|
-
};
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region extensions/chutes/models.ts
|
|
90
|
-
/**
|
|
91
|
-
* Chutes model catalog, static model definitions, and dynamic model discovery.
|
|
92
|
-
*/
|
|
93
|
-
const log = createSubsystemLogger("chutes-models");
|
|
94
|
-
const CHUTES_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
95
|
-
providerId: "chutes",
|
|
96
|
-
catalog: modelCatalog.providers.chutes
|
|
97
|
-
});
|
|
98
|
-
/** Base URL for Chutes OpenAI-compatible inference. */
|
|
99
|
-
const CHUTES_BASE_URL = CHUTES_MANIFEST_PROVIDER.baseUrl;
|
|
100
|
-
/** Default Chutes model id used for onboarding. */
|
|
101
|
-
const CHUTES_DEFAULT_MODEL_ID = "zai-org/GLM-5-TEE";
|
|
102
|
-
/** Default Chutes model ref used for onboarding. */
|
|
103
|
-
const CHUTES_DEFAULT_MODEL_REF = `chutes/${CHUTES_DEFAULT_MODEL_ID}`;
|
|
104
|
-
const CHUTES_DEFAULT_CONTEXT_WINDOW = 128e3;
|
|
105
|
-
const CHUTES_DEFAULT_MAX_TOKENS = 4096;
|
|
106
|
-
/** Bundled fallback Chutes model catalog, normalized from the plugin manifest. */
|
|
107
|
-
const CHUTES_MODEL_CATALOG = CHUTES_MANIFEST_PROVIDER.models;
|
|
108
|
-
/** Adds Chutes provider compat metadata to one model catalog entry. */
|
|
109
|
-
function buildChutesModelDefinition(model) {
|
|
110
|
-
return {
|
|
111
|
-
...model,
|
|
112
|
-
compat: {
|
|
113
|
-
...model.compat,
|
|
114
|
-
supportsUsageInStreaming: false
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
const CACHE_TTL = 300 * 1e3;
|
|
119
|
-
async function fetchChutesModelRows(accessToken) {
|
|
120
|
-
return await getCachedLiveProviderModelRows({
|
|
121
|
-
providerId: "chutes",
|
|
122
|
-
endpoint: `${CHUTES_BASE_URL}/models`,
|
|
123
|
-
discoveryApiKey: accessToken,
|
|
124
|
-
timeoutMs: 1e4,
|
|
125
|
-
ttlMs: CACHE_TTL,
|
|
126
|
-
buildRequestHeaders: ({ discoveryApiKey }) => ({
|
|
127
|
-
Accept: "application/json",
|
|
128
|
-
...discoveryApiKey ? { Authorization: `Bearer ${discoveryApiKey}` } : {}
|
|
129
|
-
}),
|
|
130
|
-
policy: ssrfPolicyFromHttpBaseUrlAllowedHostname(CHUTES_BASE_URL),
|
|
131
|
-
auditContext: "chutes-model-discovery",
|
|
132
|
-
fetchGuard: (params) => fetchWithSsrFGuard(withTrustedEnvProxyGuardedFetchMode(params))
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
/** Discovers Chutes models dynamically, falling back to the bundled static catalog. */
|
|
136
|
-
async function discoverChutesModels(accessToken) {
|
|
137
|
-
const trimmedKey = normalizeOptionalString(accessToken) ?? "";
|
|
138
|
-
if (isChutesModelDiscoveryTestEnvironment()) return CHUTES_MODEL_CATALOG.map(buildChutesModelDefinition);
|
|
139
|
-
const staticCatalog = () => CHUTES_MODEL_CATALOG.map(buildChutesModelDefinition);
|
|
140
|
-
try {
|
|
141
|
-
const data = await fetchChutesModelRows(trimmedKey || void 0);
|
|
142
|
-
if (data.length === 0) {
|
|
143
|
-
log.warn("No models in response, using static catalog");
|
|
144
|
-
return staticCatalog();
|
|
145
|
-
}
|
|
146
|
-
const seen = /* @__PURE__ */ new Set();
|
|
147
|
-
const models = [];
|
|
148
|
-
for (const entry of data) {
|
|
149
|
-
const id = normalizeOptionalString(entry?.id) ?? "";
|
|
150
|
-
if (!id || seen.has(id)) continue;
|
|
151
|
-
seen.add(id);
|
|
152
|
-
const lowerId = normalizeLowercaseStringOrEmpty(id);
|
|
153
|
-
const isReasoning = entry.supported_features?.includes("reasoning") || lowerId.includes("r1") || lowerId.includes("thinking") || lowerId.includes("reason") || lowerId.includes("tee");
|
|
154
|
-
const input = (entry.input_modalities || ["text"]).filter((i) => i === "text" || i === "image");
|
|
155
|
-
models.push({
|
|
156
|
-
id,
|
|
157
|
-
name: id,
|
|
158
|
-
reasoning: isReasoning,
|
|
159
|
-
input,
|
|
160
|
-
cost: {
|
|
161
|
-
input: entry.pricing?.prompt || 0,
|
|
162
|
-
output: entry.pricing?.completion || 0,
|
|
163
|
-
cacheRead: entry.pricing?.input_cache_read || 0,
|
|
164
|
-
cacheWrite: 0
|
|
165
|
-
},
|
|
166
|
-
contextWindow: asPositiveSafeInteger(entry.context_length) ?? CHUTES_DEFAULT_CONTEXT_WINDOW,
|
|
167
|
-
maxTokens: asPositiveSafeInteger(entry.max_output_length) ?? CHUTES_DEFAULT_MAX_TOKENS,
|
|
168
|
-
compat: { supportsUsageInStreaming: false }
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
if (models.length === 0) return staticCatalog();
|
|
172
|
-
return models;
|
|
173
|
-
} catch (error) {
|
|
174
|
-
if (error instanceof LiveModelCatalogHttpError && error.status === 401 && trimmedKey) return await discoverChutesModels(void 0);
|
|
175
|
-
if (error instanceof LiveModelCatalogHttpError && error.status !== 401 && error.status !== 503) {
|
|
176
|
-
log.warn(`GET /v1/models failed: HTTP ${error.status}, using static catalog`);
|
|
177
|
-
return staticCatalog();
|
|
178
|
-
}
|
|
179
|
-
log.warn(`Discovery failed: ${String(error)}, using static catalog`);
|
|
180
|
-
return staticCatalog();
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
//#endregion
|
|
184
|
-
export { buildChutesModelDefinition as a, CHUTES_MODEL_CATALOG as i, CHUTES_DEFAULT_MODEL_ID as n, discoverChutesModels as o, CHUTES_DEFAULT_MODEL_REF as r, CHUTES_BASE_URL as t };
|
package/npm-shrinkwrap.json
DELETED