Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Merge branch 'dev' into dev-forhad

Forhad Hosain1596785f98c6
diff --cc packages/app/src/backend/services/LLMHelper/index.ts
index d9bbdea4,f8d3dfaf..2ee339f2
--- a/packages/app/src/backend/services/LLMHelper/index.ts
+++ b/packages/app/src/backend/services/LLMHelper/index.ts
@@@ -24,36 -25,24 +25,32 @@@ async function getUserLLMModels(req: Re
if (modelTpl.alias) {
const aliasOptions = JSON.parse(JSON.stringify(LLMModels[modelTpl.alias] || {}));
delete aliasOptions.hidden; //do not override hide option because we may want to hide the original model but keep the alias
- modelTpl = { ...modelTpl, ...aliasOptions }; //override the model config with the alias config
+
+ const aliasOverrides = {
+ label: modelTpl.label,
+ modelId: modelTpl.modelId,
+ tags: modelTpl.tags,
+ };
+
+ modelTpl = { ...modelTpl, ...aliasOptions, ...aliasOverrides }; //override the model config with the alias config
+ modelTpl.tags.push('alias: ' + modelTpl.alias);
}
- // get the key options
- const modelKeyOptions = modelTpl.keyOptions || {};
- delete modelTpl.keyOptions;
+ let enabled =
- typeof LLMModels[modelId].enabled === 'function'
- ? LLMModels[modelId].enabled({ user: req.user, team: req._team })
++ typeof LLMModels[modelEntryId].enabled === 'function'
++ ? LLMModels[modelEntryId].enabled({ user: req.user, team: req._team })
+ : modelTpl.enabled;
const provider = modelTpl?.provider?.toLowerCase();
const hasAPIKey = !!keys[provider?.toLowerCase()];
- if (hasAPIKey) {
- modelTpl = { ...modelTpl, ...modelKeyOptions }; //override the model config with the key config
- modelTpl.hasKey = true;
+ // If the credentials are only 'vault' and the team doesn't have their own API key, disable the model.
+ if (modelTpl.credentials === 'vault' && !hasAPIKey) {
+ enabled = false;
}
- let enabled =
- typeof LLMModels[modelEntryId].enabled === 'function'
- ? LLMModels[modelEntryId].enabled({ user: req.user, team: req._team })
- : modelTpl.enabled;
-
// Skip legacy models for users with built-in model access to avoid confusion
- if (_hasBuiltInModels(req) && modelId.startsWith('legacy/')) {
+ if (_hasBuiltInModels(req) && modelEntryId.startsWith('legacy/')) {
enabled = false;
}