Possible to reduce node package size?
dmb0058 opened this issue · 6 comments
Describe the bug
AWS Lambda functions are restricted to 250Mb including layers. Packaging the aws-sdk, faiss-node, fs, langchain, openai and adm-zip blows the limit.
I've pulled out only the aws sub-packages I need (s3 and secrets-manager) and the fs and adm-zip packages are tiny, but faiss-node is pretty big. I see it has Readme files and stuff, so I guess it's not 'minimal' - any chance of a slimmed down npm package?
Environment:
- Operating system: AWS Lambda
- Nodejs Version: v18.x
- Package Version: latest
To Reproduce
Steps to reproduce the behavior:
- Zip the nodejs/node_modules hierarchy
- Attempt to create a Lambda layer
- Error is "Layer max. size is 250Mb" (paraphrased)
Expected behavior
The layer is correctly created.
@dmb0058 Now use MKL
on linux and openblas
on musllinux.
We can consider replacing it with openblas
for reducing size.
Just checking if the latest version is the one on https://www.npmjs.com/package/faiss-node, or need to install from git?
@dmb0058 I will publish a new version to npm soon.
You can check pre-release version here: https://github.com/ewfian/faiss-node/releases/tag/v0.2.3-alpha.0