Instructions to use SMLBuilder/TinkyBrain-31M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use SMLBuilder/TinkyBrain-31M with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir TinkyBrain-31M SMLBuilder/TinkyBrain-31M
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
| license: apache-2.0 | |
| language: en | |
| tags: | |
| - aac | |
| - speech-prosthetic | |
| - small-language-model | |
| - mlx | |
| - from-scratch | |
| # TinkyBrain 31M β A Language Model Built From Scratch | |
| **31 million parameters. Trained from zero. On a Mac mini M4.** | |
| No fine-tuning. No pre-trained weights. No shortcuts. Every single weight in this model was learned from scratch on Apple Silicon using MLX. | |
| ## What Makes This Special | |
| Most "custom models" are LoRA adapters slapped on top of someone else's foundation model. TinkyBrain is different: | |
| - **Custom architecture** β MicroBrain transformer built from scratch in `model.py` | |
| - **Custom tokenizer** β grown organically during curriculum training, not borrowed from GPT/LLaMA | |
| - **Custom training pipeline** β DJ playlist-style curriculum learning (70 tracks, added one at a time like ingredients in a recipe) | |
| - **Trained entirely on Apple Silicon** β MLX on M4 Mac mini, no cloud GPU needed | |
| - **Purpose-built for AAC** β designed to power speech prosthetics for non-verbal users (stroke survivors, neurodivergent individuals) | |
| ## Training Approach | |
| The playlist trainer (`train_playlist.py`) treats training data like a DJ set: | |
| 1. Start with baby-level language (greetings, feelings, basic needs) | |
| 2. Add one "track" at a time β 100 epochs per track on the cumulative dataset | |
| 3. Each track builds on what came before β the model never forgets early lessons | |
| 4. 14 curriculum stages from babbling to full conversation | |
| 5. Smart early stopping with patience-based checkpointing | |
| **70 JSONL training files** covering: greetings, feelings, play, school, family, friends, animals, imagination, food, health, safety, identity, culture, and more. | |
| ## Files | |
| - `checkpoints/v3_best.safetensors` β Best v3 model (71MB) | |
| - `checkpoints/best.safetensors` β Best v1 model (80MB) | |
| - `checkpoints/full_best.safetensors` β Full curriculum model (36MB) | |
| - `checkpoints/curriculum_step_*.safetensors` β Every curriculum checkpoint | |
| - `model.py` β MicroBrain architecture | |
| - `tokenizer.py` β Custom tokenizer | |
| - `chat.py` β Inference + generation | |
| ## Usage | |
| ```python | |
| import mlx.core as mx | |
| from model import MicroBrain | |
| from chat import SimpleTokenizer, generate_greedy | |
| # Load model + tokenizer | |
| tokenizer = SimpleTokenizer.from_file("checkpoints/v3_tokenizer.json") | |
| model = MicroBrain(vocab_size=len(tokenizer), d_model=512, n_heads=8, n_layers=8) | |
| model.load_weights("checkpoints/v3_best.safetensors") | |
| # Generate | |
| response = generate_greedy(model, tokenizer, "How are you feeling?") | |
| print(response) | |
| ``` | |
| ## Built With | |
| - **MLX** β Apple's machine learning framework for Apple Silicon | |
| - **TinkyOven** β Custom macOS SwiftUI app for visual playlist-style training | |
| - **TinkyBrain** β Chrome extension for harvesting training data from the web | |
| ## Part of the Tinky Ecosystem | |
| TinkyBrain powers the AAC speech prosthetics in: | |
| - **TinkySpeak** β Android AAC device for non-verbal users | |
| - **TinkyAAC** β iOS/Android speech prosthetic for stroke survivors | |
| - **TinkyTown** β Accessibility kiosk for municipal buildings | |
| - **TinkyAsk** β Universal business ordering system | |
| Built by a dad who wanted nothing more then his non verbal son and his mom who who had a stroke able to speak. | |
| --- | |
| *No cloud GPUs were harmed in the making of this model.* | |