Cloud Run cold starts taking 139 seconds due to 90MB WASM file with embedded 87MB model weights. WASM compilation scales with file size. Solution: Split into 2.4MB WASM (code only) + external model files. - WASM compile: 139,000ms → 6-8ms - Model load: N/A → 30-115ms - Total init: 139,000ms → 136-240ms New modelLoader.ts handles all environments: - Node.js: fs.readFile() - Bun: Bun.file() - Bun --compile: auto-embedded assets - Browser: fetch() Zero config - same API, npm package includes model files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| AssetLoader.ts | ||
| CandleEmbeddingEngine.ts | ||
| EmbeddingPostProcessor.ts | ||
| index.ts | ||
| modelLoader.ts | ||
| types.ts | ||
| WASMEmbeddingEngine.ts | ||
| wasmLoader.ts | ||
| WordPieceTokenizer.ts | ||