LispM LLM: Natural Language Emacs Control
2 min readupdated
A compact local model that translates English requests into ready-to-use Emacs Lisp commands. It features a mere 184,625 parameters, is built with PyTorch, and was trained from scratch without relying on large base architectures. The model functions as a command router inside an agent wrapper: it either selects one of 48 supported actions (editing, buffer and window management, navigation, and LispM applications) or rejects unsupported requests. It is useful for developers building local AI agents or voice assistants for the Emacs text editor.
Key features
- Microscopic size: Only 184,625 parameters, trained from scratch using PyTorch.
- Fixed action set: Supports 48 Emacs and LispM commands and can reject requests that fall outside the supported set.
- Safe output: The CLI utility only suggests the generated command (including JSON-formatted output) without executing it automatically.
- Open license: The code, synthetic dataset, and weights are published under the AGPL-3.0-only license.
What you can do
- Integrate into an Emacs agent environment: Use the model as a fast local router to turn user text instructions into editor commands with subsequent confirmation.
- Automate routine tasks in the editor: Run basic operations like saving a buffer
(save-buffer), splitting windows(split-window-right), or opening files(find-file)without memorizing keyboard shortcuts. - Fine-tune for your own tasks: Take the open-source code and synthetic data from the repository to adapt the classifier for your own set of Emacs macros.
Example
python -m pip install -r requirements.txt
python lispm.py --infer 'save the current buffer'
python lispm.py --infer 'open file "notes.el"' --format jsonRead more
DetailsBenchmarks (English robustness set): 93.0% accuracy on supported requests (266 out of 286, 6 errors, 14 rejected); 115 out of 126 unsupported requests correctly rejected (11 false positives).
Limitations: Supports English only; does not work through the standard Transformers
pipeline and requires manual verification before execution (for example, a request like "back in browser" might be mistakenly recognized as closing a tab).Hardware: Runs locally on Python 3.11; thanks to its size of 184 thousand parameters, it does not require a powerful graphics card.










Comments