A small LLM with the personality of a corgi dog named Sernik
Find a file
2026-04-28 19:39:57 +02:00
serniklm refactor: Fix type hinting 2026-04-28 19:28:13 +02:00
.gitignore feat: Add NN model, training loop and inference 2026-04-28 18:42:37 +02:00
.python-version feat: Add synthetic training data generation script 2026-04-25 19:56:29 +02:00
LICENSE feat: Tokenize the dataset with BPE 2026-04-26 14:22:55 +02:00
pyproject.toml feat: Tokenize the dataset with BPE 2026-04-26 14:22:55 +02:00
README.md fix: Small fix for the Marimo notebook and improve running docs 2026-04-28 19:39:57 +02:00
train_serniklm.py fix: Small fix for the Marimo notebook and improve running docs 2026-04-28 19:39:57 +02:00
uv.lock feat: Tokenize the dataset with BPE 2026-04-26 14:22:55 +02:00

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.