# ESMF — C++ Inference for ESMC Protein Language Models

A standalone C++ inference engine, built on the GGML tensor library, that runs ESMC protein language models on CPU with no Python, PyTorch or LibTorch at runtime.

ESMF runs ESMC (ESM Cambrian) protein language model variants on CPU using GGML, producing a portable compiled binary that drops into existing C, C++ or Rust pipelines for structural biology and sequence analysis without a Python or PyTorch dependency at runtime.

The goal is a small, auditable, hardware-efficient runner whose outputs match the reference PyTorch implementation, with optional integer quantization for memory-constrained machines. A graph planner computes activations in place in a small reusable buffer to keep peak memory bounded even for long sequences, and built-in 8-bit and 4-bit quantization shrink weight size on disk and in memory.

Correctness is checked by comparing per-layer activations and final logits against the reference ESMC-300M and ESMC-600M models on a fixed set of sequences, and a debug flag dumps layer-0 activation statistics for troubleshooting discrepancies. The project is in beta and is looking for contributors, particularly on numerical correctness and support for larger ESMC variants.

Website: https://github.com/Dox45/protein.cpp
