platform. The install is about 5.6 GB and the local examples load the model with device set to cuda, so plan for a GPU box and disk space.
Who it is forA computational biologist who needs protein representations for a downstream model.
The problemTraining a protein model from scratch is out of reach for most teams.
The outcomeEmbeddings and logits for each sequence you pass in, ready for a downstream classifier.
What you need first
- Python with pip; `pip install esm` is about 5.6 GB, of which about 4.6 GB is the CUDA build of torch
- A CUDA GPU for the local examples, which load models with device set to cuda
- A Biohub Platform API token if you use the hosted client instead of local weights
Steps
- Install the package with
pip install esm - Load the model and tokenizer with EsmcForMaskedLM.from_pretrained and EsmcTokenizer as in the README example
- Tokenize your sequences with return_tensors set to pt and padding set to True, then move the inputs to model.device
- Run the model inside torch.inference_mode, and pass output_hidden_states=True to get hidden states from all transformer layers
Prompt for your agent
Using Biohub/esm, write a script that installs esm with `pip install esm`, loads ESMC-6B with EsmcForMaskedLM.from_pretrained, and saves all layer hidden states for every sequence in <my FASTA file> as a NumPy array.
Caveat. On a machine with no NVIDIA GPU the README suggests installing torch from its CPU only index to replace the 4.6 GB CUDA build.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for Biohub/esm and "Turn protein sequences into embeddings with ESMC"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer