← Files Biohub ESMARCHIVED FILE
skills/esmc/references/self-hosted.md
1.52 KB · Sep 30, 2026 · 23:14 UTC
# ESMC self-hosting
Public IDs and pinned revisions are in [`source-pins.md`](../../../references/source-pins.md). Public weights do not require `HF_TOKEN`. Install both `Biohub/esm` and the Biohub Transformers fork at the exact listed Git revisions; do not inherit the mutable upstream branch.
```python
import torch
from transformers import AutoModelForMaskedLM, AutoTokenizer
repo = "biohub/ESMC-300M"
revision = "a59b831785f907e96e6a246b1d142bfb76df31ee"
tokenizer = AutoTokenizer.from_pretrained(repo, revision=revision)
model = AutoModelForMaskedLM.from_pretrained(repo, revision=revision).eval()
inputs = tokenizer([sequence], return_tensors="pt", padding=True)
with torch.inference_mode():
output = model(**inputs, output_hidden_states=True)
```
Use 300M for a quick smoke, then choose 600M or 6B according to the scientific goal and available memory/latency envelope. For private/offline work, stage the exact model snapshot and dependencies inside the controlled environment, verify checksums, disable network access as required, and record the snapshot revision. Do not send telemetry or input sequences outside the intended environment and security boundary.
For public independent ESMC calls, use the managed API with a bounded concurrent pool so the backend can auto-batch them. The plugin ships no ESMC Modal function. Use this self-hosted route when privacy, offline execution, customization, fine-tuning, sustained ownership, or an explicit requirement to use owned compute justifies operating the pinned public weights locally.
SHA-256: 9f4b49b4ef50d2b6cafe83127c2025967c7c17947a18bb737c53d8921988fc1c