41 releases (6 breaking)
Uses new Rust 2024
| new 0.6.0 | Nov 28, 2026 |
|---|---|
| 0.5.0 | Nov 21, 2026 |
| 0.4.3 | Nov 15, 2026 |
| 0.3.7 | Nov 11, 2026 |
| 0.0.1 | Apr 10, 2026 |
#384 in Machine learning
116 downloads per month
Used in 3 crates
(via lmm-agent)
7MB
52K
SLoC
๐ LMM ๐ฆ
LMM (Large Mathematical Model) empowers you to build ethical AI systems, without GPUs, training data, or API keys. Grounded in pure mathematics and transparent symbolic reasoning, LMM gives every developer, regardless of compute budget, the ability to create AI that is auditable, explainable, and bias-free by design. No data exploitation. No environmental cost. Just mathematics.
๐ง Linux (Recommended) |
๐ช Windows | ๐ณ Docker |
|---|---|---|
Download lmm binary |
Download lmm.exe binary |
docker pull wiseaidev/lmm |
cargo install lmm --all-features |
cargo install lmm --all-features |
docker run -it wiseaidev/lmm |
lmm โ launches TUI |
lmm โ launches TUI |
Read DOCKER.md |
๐ฌ Demo
The following demonstrates the full TRAM (Text Reasoning and Applied Mathematics) pipeline generating coherent, non-repetitive English prose powered entirely by deterministic mathematics and transparent symbolic reasoning. The pipeline runs through six stages: web knowledge retrieval, adaptive thought engine reasoning, symbolic inference, global deduplication, structural shaping, and stochastic enhancement. For higher-quality answers, enable the Recursive Belief Propagation loop (--loop N) to re-run the full pipeline up to N times with Bayesian belief updates between passes.
TRAM is LMM's default reasoning engine. All TRAM options are available directly at the top-level CLI command or via the explicit tram subcommand:
# Launch the TUI:
lmm
# Top-level direct execution (default TRAM mode):
lmm -p "rust programming" --verbose
lmm -p "machine learning" --probability=0.1 --knowledge-base ./papers --iterations 20 --verbose
lmm -p "stochastic determinism" -k ./papers -i 15 --probability=0.1 --verbose
lmm -p "rust programming" --cf-threshold 0.35 --inference-depth 4 --verbose
# Intent-aware enrichment + response framing (always on):
lmm -p "what are the advantages of rust?" --verbose
lmm -p "rust vs python" --verbose
lmm -p "write a hello world in python" --verbose
# With Adaptive Thought Engine enabled:
lmm -p "why does Rust not have a garbage collector?" --think --verbose
lmm -p "rust vs python" --think --think-steps 4 --think-threshold 0.7 --verbose
lmm -p "machine learning" --think --think-steps 6 --think-patience 2 --verbose
# Recursive belief-propagation loop (--loop N):
lmm -p "what are the advantages of rust?" --think --loop 2 --verbose
lmm -p "what are the advantages of water?" --think --deep --loop 3 --verbose
lmm -p "what are the advantages of python?" --think --loop 5 --loop-threshold 0.3 --verbose
# Control decomposition and framing:
lmm -p "advantages of rust" --max-tasks 6 --verbose
lmm -p "rust programming" --no-frame --verbose
# Or via explicit subcommand (identical behavior):
lmm tram -p "rust programming" --verbose
lmm tram -p "machine learning" --probability=0.1 --knowledge-base ./papers --iterations 20 --verbose
lmm tram -p "stochastic determinism" -k ./papers -i 15 --verbose
lmm tram -p "rust programming" --cf 0.35 --inf-depth 4 --verbose
lmm tram -p "what is WebAssembly?" --think --verbose
lmm tram -p "write hello world in rust" --max-tasks 4 --verbose
๐๏ธ Modes of Operations
LMM supports 5 modes of operations: ask (regular web search), think (ATE engine), deep search, think & deep search, and recursive belief-propagation loop (--loop N). The following demonstrates the output of two of these modes:
| Search | Think + Deep Search |
|---|---|
For more information, see the Architecture document.
๐ฆ Installation
๐ฆ Rust
The lmm library is available on crates.io. For the complete API reference, installation guide, and worked examples, see the Rust usage guide.
๐ป Command-Line Interface
The lmm binary supports 15 subcommands spanning simulation, discovery, encoding, prediction, summarisation, and rich text generation: all powered by pure equations.
For the full option reference and usage examples, see the CLI documentation or run lmm --help after installing with cargo install lmm --all-features.
๐ Python
The Python bindings are published to PyPI as lmm-rs and are installed with pip install lmm-rs. Built with maturin, the package ships pre-compiled wheels for major CPython versions and runs a fully embedded Tokio runtime; no asyncio required.
For installation instructions, configuration options, and full method signatures, see the Python usage guide.
๐ฉ Node.js
The Node.js bindings are published to npm as @wiseaidev/lmm and are installed with npm install @wiseaidev/lmm. Built with napi-rs, the package ships a pre-compiled .node add-on with TypeScript type definitions.
For installation instructions, type definitions, and examples, see the Node.js usage guide.
๐ WebAssembly (WASM)
LMM natively targets wasm32-unknown-unknown. Because reqwest switches to the browser fetch API automatically, you can deploy LMM inside Rust frontend frameworks such as Yew, Dioxus, and Leptos without any additional glue code.
For CORS considerations, build steps, and usage details, see the WASM usage guide.
๐ค Agent Framework
The lmm-agent crate extends LMM with a fully autonomous, equation-based agent layer; no LLM, no API key, no training data.
| Document | Description |
|---|---|
| AGENT.md | Architecture, quick-start, types, and async API reference |
| DERIVE.md | #[derive(Auto)] macro: generated traits and field contract |
| lmm-agent README | Crate-level API reference, builder, and example |
| lmm-derive README | Macro crate details and field rules |
โก Performance
TRAM is benchmarked end-to-end with Criterion (100 samples, release build, no GPU).
โ See BENCH.md for full per-stage tables, numbers, and methodology.
TRAM vs. LLM at a Glance
| Training COโ | Inference latency* | Parameters | RAM | |
|---|---|---|---|---|
| TRAM (cached) | 0 t | 0.015 ms | 0 | < 8 MB |
| TRAM (live web) | 0 t | ~554 ms | 0 | < 8 MB |
| GPT-2 CPU | 284 t | ~2,500 ms | 117 M | ~500 MB |
| GPT-3 API | 502 t | 1,000-4,000 ms | 175 B | 350 GB |
| GPT-4 API | 3,900+ t | 2,000-8,000 ms | ~1 T est. | cloud |
*Per ~100-word response. Full E2E offline pipeline: 101.8 ms (1-pass), 314 ms (3-pass loop).
| COโ Training Cost | Inference Latency |
|---|---|
| Throughput (words/sec) | Memory Footprint |
|---|---|
Key Facts
- 3.8 ns per certainty-factor combination: pure ALU, zero allocation
- 8.8 ยตs top-k knowledge retrieval (k=1-10, 50-sentence corpus)
- Zero training cost: no data, no GPUs, no COโ at training time
- < 8 MB RAM vs. gigabytes for the smallest quantised open-source LLMs
- Runs on any CPU: from embedded ARM to cloud servers, no drivers needed
- Fully auditable: every inference step emits a human-readable proof trace
๐ฐ Publications & Research
The architecture, formal mathematics, and paradigm are fully documented in the official whitepaper: Read the Whitepaper (PDF).
For the full Criterion benchmark results, methodology, per-stage tables, and all PNG charts: Read BENCH.md.
๐ Examples
| Example | Description |
|---|---|
| chat | Interactive chat UI powered by all LMM generation modes: Ask (DuckDuckGo), Sentence, Paragraph, Essay, Summarize, Predict. |
| yap | Two LMM agents conversing non-stop using the full TRAM pipeline in WASM: web fetch โ SentenceFilter โ KnowledgeIndex โ RuleBase โ InferenceEngine โ ProseBuilder โ GlobalDeduplicator โ ParagraphShaper. Agent Alpha queries a topic; Agent Beta derives the next sub-topic and queries back: producing varied, non-repetitive debate indefinitely. |
| arc-lmm-agent | Autonomous ARC-AGI-3 solver using LMM's episodic reasoning. WIP: Achieves 100% success across games with $0 cost and no external AI APIs. |
Blog Posts
- LLMs are Useful. LMMs will Break Reality: the original post that started this project.
- Training Is An Evil Concept. LMMs Eliminates It Altogether: ethical, architectural, and data advantages of training-free models.
๐ Citation
If you use LMM in your research, please cite our whitepaper:
@article{harmouch2026lmm,
author = {Mahmoud Harmouch},
title = {Mathematics Is All You Need: Training-Free Language Generation via
Symbolic Regression and Stochastic Determinism},
year = {2026},
url = {https://github.com/wiseaidotdev/lmm}
}
๐ค Contributing
Contributions are welcome! Feel free to open issues or pull requests on GitHub.
๐ License
Licensed under the MIT License.
โญ Star Us
If you use or enjoy LMM, please leave us a star on GitHub! It helps others discover the project and keeps the momentum going โ.
Dependencies
~6โ24MB
~389K SLoC