From dd020e08893b3aaeb0095a1839dddc53403cb51d Mon Sep 17 00:00:00 2001 From: David Snelling Date: Fri, 29 Aug 2025 10:07:37 -0700 Subject: [PATCH] fix: allow automatic model downloads without requiring BRAINY_ALLOW_REMOTE_MODELS Models should download automatically when not present locally. Fixed the environment variable check to only block downloads when explicitly set to 'false' rather than blocking when undefined. --- src/utils/embedding.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/embedding.ts b/src/utils/embedding.ts index a7987343..22499183 100644 --- a/src/utils/embedding.ts +++ b/src/utils/embedding.ts @@ -108,9 +108,9 @@ export class TransformerEmbedding implements EmbeddingModel { if (options.localFilesOnly !== undefined) { // 1. Explicit option takes highest priority localFilesOnly = options.localFilesOnly - } else if (process.env.BRAINY_ALLOW_REMOTE_MODELS !== undefined) { - // 2. Environment variable override - localFilesOnly = process.env.BRAINY_ALLOW_REMOTE_MODELS !== 'true' + } else if (process.env.BRAINY_ALLOW_REMOTE_MODELS === 'false') { + // 2. Environment variable explicitly disables remote models + localFilesOnly = true } else if (process.env.NODE_ENV === 'development') { // 3. Development mode allows remote models localFilesOnly = false