Extract embedding layers for offline use

Hello there,

I want to utilize the embedding layers of a custom model to test embedding vectors.
But instead of downloading the complete models to test for, I only want to extract the embedding layers of the models for offline use and testing without downloading the complete models (will be too huge)
Is there a way with the hugging.js, transformer.js or other API to download only the embedding layers? And if yes, how to do that?

Some hints will be very nice.

Thank you in advance