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.
This commit is contained in:
David Snelling 2025-08-29 10:07:37 -07:00
parent b4f0a1c46b
commit dd020e0889

View file

@ -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