Librime is a cross-platform C++ input method engine library, primarily used for Chinese text input. It provides a modular architecture with a C API that allows frontends like ibus-rime, Squirrel, and Weasel to integrate it. The engine processes key events through a pipeline of components: processors, segmentors, translators, filters, and formatters, all configurable via YAML schema files. It includes sophisticated algorithms for syllable graph building, spelling correction, user learning, and dictionary management (supporting LevelDB, memory-mapped files, and text databases). A config compiler with include/patch directives enables modular schema definitions. The library also offers a plugin system for extending functionality.