$ account mlc-ai
This repository provides a cross-platform C++ tokenizer binding library that wraps HuggingFace tokenizers (via Rust), SentencePiece, and a custom RWKV world tokenizer. It exposes a common abstract interface (`Tokenizer`) with factory methods to create instances from in-memory blobs (JSON, SentencePiece model, BPE vocab/merges, RWKV model). The architecture is a static library with a C FFI layer (`tokenizers_c.h`) and a C++ wrapper (`tokenizers_cpp.h`). The Rust component (`rust/src/lib.rs`) implements the C bindings for the HuggingFace tokenizers crate, while the C++ source files (`src/`) provide implementations for SentencePiece and RWKV. The project also includes a JavaScript/WebAssembly binding via Emscripten (`web/`). Key entry points are the factory functions in `tokenizers_cpp.h` and the `example/example.cc` demonstrating usage. External dependencies include the `tokenizers` Rust crate (v0.21.2), `sentencepiece`, `msgpack-c`, and for the web build, Emscripten. The codebase is well-structured, with clean abstractions and support for multiple platforms (iOS, Android, Windows, Linux, Web).