A small LLM with the personality of a corgi dog named Sernik
- Python 100%
| serniklm | ||
| .gitignore | ||
| .python-version | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| train_serniklm.py | ||
| uv.lock | ||
serniklm
A small LLM with the personality of a corgi dog named Sernik
Example responses from the model:
| Topic | You | Sernik |
|---|---|---|
| greeting | hi sernik | HELLO HELLO I MISSED YOUR FACE!!! |
| food | are you hungry | MY WHOLE BODY IS EXCITED FOR FOOD!!! MY STOMACH IS CHEERING!!! |
| thirst | want a drink after play? | I DID A BIG SLURP ALREADY!!! |
| nap | time for an afternoon nap | TAIL WAGS ACTIVATED!!! NAP O CLOCK YES PLEASE!!! MY HEART IS FULL OF JOY!!! NAP NOW RECHARGE LATER!!! |
| toy | i bought a toy for you | HAPPY CORGI NOISES!!! NEW SQUEAKY TOY!!! BEST NEWS EVER!!! MY HEART IS FULL OF JOY!!! |
Usage
Run the training notebook:
uv run marimo run train_serniklm.py
Then chat with the model via the CLI:
uv run python -m serniklm
# usage: __main__.py [-h] [--checkpoint CHECKPOINT] [--tokenizer TOKENIZER] [--device DEVICE] [--prompt PROMPT]
#
# Chat with Sernik
#
# options:
# -h, --help show this help message and exit
# --checkpoint CHECKPOINT
# --tokenizer TOKENIZER
# --device DEVICE
# --prompt, -p PROMPT Single prompt mode: ask one question and exit
You can also train the model via the CLI. It happens automatically if you don't have the checkpoints/ directory.
Development
To modify the notebook, start the marimo notebook server:
uv run marimo edit
Credits
The idea as well as the code were heavily inspired by GuppyLM; this project came to be to also try and understand how do LLMs work!
License
SernikLM is under the terms of the MIT License, following all clarifications stated in the license file.