feat: Add Google Cloud Storage CDN for models.soulcraft.com

- Primary source: models.soulcraft.com on GCS
- Backup: GitHub releases
- Fallback: Hugging Face
- Immutable with SHA256 verification
This commit is contained in:
David Snelling 2025-08-18 18:58:26 -07:00
parent a9c5fd0eeb
commit 1096d285f5
13 changed files with 1058 additions and 15 deletions

16
dist/brainyData.js vendored
View file

@ -656,6 +656,22 @@ export class BrainyData {
return;
}
this.isInitializing = true;
// CRITICAL: Ensure model is available before ANY operations
// This is THE most critical part of the system
// Without the model, users CANNOT access their data
if (typeof this.embeddingFunction === 'function') {
try {
const { modelGuardian } = await import('./critical/model-guardian.js');
await modelGuardian.ensureCriticalModel();
}
catch (error) {
console.error('🚨 CRITICAL: Model verification failed!');
console.error('Brainy cannot function without the transformer model.');
console.error('Users cannot access their data without it.');
this.isInitializing = false;
throw error;
}
}
try {
// Pre-load the embedding model early to ensure it's always available
// This helps prevent issues with the Universal Sentence Encoder not being loaded