--- license: cc-by-4.0 language: - en library_name: onnxruntime tags: - autocorrect - keyboard - on-device - onnx - ort - preview --- # Keylime m1 (34M) — Preview This repo has the Keylime on-device autocorrect language model. The files are in the pre-optimized ORT format of onnxruntime. The Keylime keyboard for Android and the Keylime app for macOS download these files when they start for the first time. m1 is an autoregressive decoder language model with 34M parameters. It has a 16k SentencePiece vocabulary and int8 weights. The Keylime apps use m1 as the battery-saver model. m1 is a **preview** model. It is not perfect, and can often be flaky, inconsistent, or make dumb mistakes. The reason why we have published this version of the model is to collect feedback and data regarding the model and how to better utilize it, as well as general public consensus of the model's quality. The model can be used in our [MacOS app](https://github.com/Mostlime12195/keylime-mac) or [Android keyboard](https://github.com/Mostlime12195/keylime-android), which downloads the our Keylime models automatically. You can opt-in to a data sharing program that sends your typing data to our servers for future model training. The program sends **ALL** typing data, including the messages you send. If you care about your own privacy, it is not recommended to opt-in. Unlike our later m2 model, m1 does not use style tokens to control the level of autocorrection. The manifest id of m1 is `block4` ("m1 34M int8"). The manifest has the file list, the step-graph layout and the decode parameters. The manifest is at https://autocorrect.mostlime.hackclub.app/autocorrect-android/manifest.json. A copy of the manifest is in the `models-v1` release of [Mostlime12195/keylime-models](https://github.com/Mostlime12195/keylime-models). ## Files | file | bytes | sha256 | what it is | |---|---|---|---| | `lm_block4.step.int8.ort` | 42312320 | `5d10b91d18cfa4f5174cbf0fca7987ccb5dc2316334b2cdcae01862adede2533` | step graph (batched candidates), pre-optimized onnxruntime (ORT) format | | `lm_block4.step.int8t.ort` | 42342088 | `12095b069d372b4814c7ab37ad405a9b267841c4e597e7e5783f9f2f863b3e69` | tree step graph (one call scores every candidate of a word), ORT format | | `vocab.json` | 340209 | `70ad9ddc0b46857a66de5f14218103e26cf18728bc7bdec2388c56255cbd22b3` | SentencePiece vocabulary | | `LICENSE` | 18659 | `5eebefd3682e32d661f307a28539b304e5e52fb1eb33ba214e61d7a57663e4f0` | CC BY 4.0 license text | To download a file, use this URL. Replace `` with the name of the file. `https://huggingface.co/MostLime/keylime-m1-preview/resolve/main/` ## Graph layout (manifest meta) | key | value | |---|---| | params | 34,279,552 | | d_model | 384 | | vocab_size | 16384 | | n_kv_heads | 2 | | head_dim | 64 | | conv_kernel | 7 | | state_names | `k0`, `v0`, `k1`, `v1`, `k2`, `v2`, `k3`, `v3`, `k4`, `v4`, `c0`, `c1`, `c2`, `c3`, `c4`, `c5`, `c6`, `c7`, `c8` | Each graph is a single-step decoder. Each graph has the KV cache (`k*`/`v*`) and the short-conv state (`c*`) as inputs and outputs. Thus, the keyboard uses the shared left context again. The keyboard then scores only the candidate words. This repo has no code and no training data. It has only the exported weights and the vocabulary that the keyboard needs. ## License Copyright © Mostlime12195. The license for the model files is [Creative Commons Attribution 4.0 International (CC BY 4.0)](LICENSE).