twinclaw 1.2.4 → 1.2.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/dist/core/onboarding.js
CHANGED
|
@@ -97,11 +97,29 @@ async function showModelStatus() {
|
|
|
97
97
|
}
|
|
98
98
|
async function setModel(modelArg) {
|
|
99
99
|
if (!modelArg) {
|
|
100
|
-
console.log('\nUsage: /model set <model
|
|
101
|
-
console.log('
|
|
102
|
-
console.log('
|
|
103
|
-
console.log(' /model set
|
|
104
|
-
console.log(' /model set
|
|
100
|
+
console.log('\nUsage: /model set <provider/model>');
|
|
101
|
+
console.log('\nValid providers: modal, groq, openrouter, google, github');
|
|
102
|
+
console.log('\nExamples:');
|
|
103
|
+
console.log(' /model set modal (your custom model)');
|
|
104
|
+
console.log(' /model set groq/qwen/qwen3-32b');
|
|
105
|
+
console.log(' /model set openrouter/meta-llama/llama-3.3-70b-instruct');
|
|
106
|
+
console.log(' /model set google/gemini-2.0-flash');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// Validate the model format
|
|
110
|
+
const validProviders = ['modal', 'groq', 'openrouter', 'google', 'github', 'anthropic'];
|
|
111
|
+
const modelLower = modelArg.toLowerCase();
|
|
112
|
+
// Check if it follows provider/model format
|
|
113
|
+
if (!modelLower.includes('/')) {
|
|
114
|
+
console.log('\n⚠️ Invalid format. Use: provider/model');
|
|
115
|
+
console.log('Example: /model set modal');
|
|
116
|
+
console.log('Valid providers: modal, groq, openrouter, google, github');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const [provider] = modelLower.split('/');
|
|
120
|
+
if (!validProviders.includes(provider)) {
|
|
121
|
+
console.log(`\n⚠️ Unknown provider: ${provider}`);
|
|
122
|
+
console.log('Valid providers: modal, groq, openrouter, google, github');
|
|
105
123
|
return;
|
|
106
124
|
}
|
|
107
125
|
try {
|
|
@@ -110,6 +128,7 @@ async function setModel(modelArg) {
|
|
|
110
128
|
config.models.primaryModel = modelArg;
|
|
111
129
|
await writeConfig(config);
|
|
112
130
|
console.log(`\n✅ Primary model set to: ${modelArg}\n`);
|
|
131
|
+
console.log('Note: Restart gateway for changes to take effect.');
|
|
113
132
|
}
|
|
114
133
|
catch (err) {
|
|
115
134
|
console.log('Error setting model:', err);
|
|
@@ -1081,17 +1081,27 @@ export class ModelRouter {
|
|
|
1081
1081
|
const groqInfo = PROVIDER_INFO.groq;
|
|
1082
1082
|
configModels.push({
|
|
1083
1083
|
id: MODEL_SLOT_IDS.FALLBACK_1,
|
|
1084
|
-
model: '
|
|
1084
|
+
model: 'qwen/qwen3-32b',
|
|
1085
1085
|
baseURL: groqInfo?.baseURL || 'https://api.groq.com/openai/v1/chat/completions',
|
|
1086
1086
|
apiKeyEnvName: 'GROQ_API_KEY',
|
|
1087
1087
|
});
|
|
1088
1088
|
}
|
|
1089
1089
|
else if (openRouterApiKey && !configModels.find((m) => m.id === MODEL_SLOT_IDS.FALLBACK_1)) {
|
|
1090
|
-
//
|
|
1090
|
+
// Use OpenRouter free models that support tools
|
|
1091
1091
|
const orInfo = PROVIDER_INFO.openrouter;
|
|
1092
1092
|
configModels.push({
|
|
1093
1093
|
id: MODEL_SLOT_IDS.FALLBACK_1,
|
|
1094
|
-
model: '
|
|
1094
|
+
model: 'arcee-ai/trinity-large-preview:free',
|
|
1095
|
+
baseURL: orInfo?.baseURL ? (orInfo.baseURL.endsWith('/chat/completions') ? orInfo.baseURL : `${orInfo.baseURL}/chat/completions`) : 'https://openrouter.ai/api/v1/chat/completions',
|
|
1096
|
+
apiKeyEnvName: 'OPENROUTER_API_KEY',
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
// Add OpenRouter free model as FALLBACK_2 if available
|
|
1100
|
+
if (openRouterApiKey && !configModels.find((m) => m.id === MODEL_SLOT_IDS.FALLBACK_2)) {
|
|
1101
|
+
const orInfo = PROVIDER_INFO.openrouter;
|
|
1102
|
+
configModels.push({
|
|
1103
|
+
id: MODEL_SLOT_IDS.FALLBACK_2,
|
|
1104
|
+
model: 'arcee-ai/trinity-mini:free',
|
|
1095
1105
|
baseURL: orInfo?.baseURL ? (orInfo.baseURL.endsWith('/chat/completions') ? orInfo.baseURL : `${orInfo.baseURL}/chat/completions`) : 'https://openrouter.ai/api/v1/chat/completions',
|
|
1096
1106
|
apiKeyEnvName: 'OPENROUTER_API_KEY',
|
|
1097
1107
|
});
|