{"slug": "show-hn-running-a-esmc-protein-language-model-as-a-single-c-binary", "title": "Show HN: Running a ESMC protein language model as a single C++ binary", "summary": "A developer ported ESM Cambrian 300M, a protein language model, from PyTorch to C++ on top of ggml, shipping it as a single binary. The 4-bit model file is 228 MB on disk and peaks around 520 MB of RAM, while the 8-bit version is 337 MB, measured on an M4 Max with 36 GB of memory; the F16 output matches the PyTorch reference at a per-residue cosine of 0.9999996 across 10,000 Swiss-Prot sequences. The developer said the experiment aimed to learn something new and to compare ggml against PyTorch for encoder-only models.", "body_md": "Hi HN, I ported ESM Cambrian 300M — a protein language model — from PyTorch to C++ on top of ggml. The 4-bit model file is 228 MB on disk and peaks around 520 MB of RAM; 8-bit is 337 MB (measured on m4max 36 gb Memory). The F16 output matches the PyTorch reference at a per-residue cosine of 0.9999996 across 10k Swiss-Prot sequences. Please checkout the github readme for more stats regarding memory, inference time and numerical accuracy viz-a-viz pytorch.\n\nThe goal of this experiment was: 1) challenge myself to learn something new and out of my comfort zone 2) check how ggml backend performs vs pytorch backend for encoder only models.\n\nComments URL: [https://news.ycombinator.com/item?id=50640661](https://news.ycombinator.com/item?id=50640661)\n\nPoints: 1\n\n# Comments: 0", "url": "https://wpnews.pro/news/show-hn-running-a-esmc-protein-language-model-as-a-single-c-binary", "canonical_source": "https://github.com/AnanyaP-WDW/esmc.cpp", "published_at": "2026-11-25 10:19:43+00:00", "updated_at": "2026-11-25 10:46:42.146585+00:00", "lang": "en", "topics": ["machine-learning", "ai-research", "ai-infrastructure", "large-language-models"], "entities": ["ESM Cambrian 300M", "PyTorch", "ggml", "C++", "Swiss-Prot", "M4 Max"], "also_reported_by": [], "takeaway": "The ggml C++ port of ESM Cambrian 300M reproduces PyTorch F16 output at a per-residue cosine of 0.9999996 across 10,000 Swiss-Prot sequences while the 4-bit model runs in 228 MB on disk and peaks near 520 MB of RAM.", "recommendation": {"advice": "Quantize encoder-only protein models like ESM Cambrian 300M to 4-bit ggml for roughly 228 MB on disk and 520 MB peak RAM, and validate against the PyTorch reference with per-residue cosine before deploying.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/show-hn-running-a-esmc-protein-language-model-as-a-single-c-binary", "markdown": "https://wpnews.pro/news/show-hn-running-a-esmc-protein-language-model-as-a-single-c-binary.md", "text": "https://wpnews.pro/news/show-hn-running-a-esmc-protein-language-model-as-a-single-c-binary.txt", "jsonld": "https://wpnews.pro/news/show-hn-running-a-esmc-protein-language-model-as-a-single-c-binary.jsonld"}}