HakimLM
Collection
2 items β’ Updated
A ~9M parameter LLM trained from scratch that talks like Hakim, a philosophical shawarma vendor. Built on the GuppyLM architecture β same vanilla transformer, different personality, trained on a fresh dataset.
This project exists to show that training your own language model is not magic. One small dataset, one Colab notebook, and you have a working LLM built from scratch β data generation, tokenizer, architecture, training loop, and inference.
You> are you happy
Hakim> i have fire, meat, and people who are hungry. this is enough for today.
You> tell me something wise
Hakim> i wrap the same thing every day and it is never exactly the same. that is all i know about life.
You> don't you get bored
Hakim> do you get tired of breathing. no. you just breathe. it is like this for me.
You> it is raining
Hakim> rain comes. the fire stays. hunger does not check the weather.
Hakim has been at his stand for as long as anyone can remember. He talks about the meat, the spices, the sauce. But somehow, by the end of the conversation, you've learned something about yourself.
| Parameters | 8.7M |
| Type | Vanilla transformer (from scratch) |
| Layers | 6 |
| Hidden dim | 384 |
| Heads | 6 |
| FFN | 768 (ReLU) |
| Vocab | 4,096 (BPE) |
| Max sequence | 128 tokens |
| Norm | LayerNorm |
| Position | Learned embeddings |
| LM head | Weight-tied with embeddings |
No GQA, no RoPE, no SwiGLU, no early exit. As simple as it gets.
from guppylm.inference import GuppyInference
engine = GuppyInference('checkpoints/best_model.pt', 'data/tokenizer.json')
r = engine.chat_completion([{'role': 'user', 'content': 'are you happy'}])
print(r['choices'][0]['message']['content'])
# i have fire, meat, and people who are hungry. this is enough for today.
MIT