LLMcompoz
Compose a language model from scratch — and learn how it works.
LLMcompoz is a PySide6 desktop app (with a matching Qt-free CLI) that walks you
through building a GPT-style language model from nothing: a tokenizer you watch
split text into chips, a transformer you assemble with four sliders while the
parameter count moves, a training loop that draws its own loss curve, and a
generation panel where you scrub temperature and top-k and watch tokens
appear one at a time.
It also runs models you did not train. Point it at a .gguf file or a
transformers folder and it reads the architecture straight out of the header —
layer count, head count, grouped-query attention, quantization scheme and the
KV-cache cost — without loading a single weight. That inspection is the part
a model runner normally hides.
Nothing is behind a framework Trainer. Every core file is meant to be read top
to bottom: the attention maths, the training step, the sampling loop.
The screens
| 01 Veri | the text to learn from | character, word and vocabulary counts as you type |
| 02 Tokenizer | text → numbers | char vs from-scratch BPE, with the live split shown as coloured chips and ids |
| 03 Model | the shape of the network | four sliders, live parameter count, and the full per-layer breakdown |
| 04 Eğitim | training, watched | live loss curve on a worker thread, step rate, working Stop, checkpoints |
| 05 Üretim | the model writes | streaming tokens, temperature and top-k explained as you move them |
| Hazır modeller | models you downloaded | GGUF and transformers library, architecture read from the file header |
| Öğren | the ideas behind each control | eight notes, grouped by the stage they explain |
Layout
src/llmcompoz/
├── core/ # the actual ML — readable, framework-free
│ ├── tokenizer.py # CharTokenizer + BPE with word-boundary pre-tokenisation
│ ├── attention.py # multi-head causal self-attention
│ ├── model.py # GPT: embeddings → blocks → head
│ ├── trainer.py # explicit training loop with callbacks and stop()
│ ├── sampler.py # streaming generation
│ ├── config.py # ModelConfig / TrainConfig
│ ├── gguf_meta.py # pure-Python GGUF header reader
│ └── runtime/ # one interface, two engines (llama.cpp, transformers)
├── gui/
│ ├── theme.py # one palette, one type scale, one stylesheet
│ ├── widgets.py # cards, stat tiles, the loss chart
│ ├── state.py # what the panels share
│ └── panels/ # one file per screen
├── learn/content.py # the teaching notes, shared by the window and the CLI
└── cli.py # Qt-free llmcompoz command
Quick start
Linux
cd ~/Github/LLMcompoz
python3.13 -m venv .venv && source .venv/bin/activate
pip install -e .
llmcompoz-gui
Windows (PowerShell)
cd C:\Github\LLMcompoz
py -3.13 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
llmcompoz-gui
PyTorch has no wheels for Python 3.14 yet — use 3.13 or earlier.
The command line
Everything the window does, without a display:
llmcompoz info # version, torch, device
llmcompoz tokenize data/tiny.txt --bpe 512 # vocabulary and the first ids
llmcompoz train data/tiny.txt --steps 2000 # train and write a checkpoint
llmcompoz generate "To be" --ckpt checkpoints/model_latest.pt --data data/tiny.txt
llmcompoz models # the local model library
llmcompoz models --inspect model.gguf # architecture, without loading it
llmcompoz learn attention # the teaching notes
Optional engines
The from-scratch half needs only torch. Running downloaded models is opt-in,
because llama-cpp-python compiles:
pip install llmcompoz[gguf] # run .gguf models through llama.cpp
pip install llmcompoz[hf] # run transformers models, inspect their layers
pip install llmcompoz[all]
Browsing and inspecting models needs neither — the header reader is pure Python.
Status
v0.1.1 — the seven screens are real and wired to the core; the from-scratch
pipeline runs end to end; GGUF/transformers models are listed and inspected.
Loading and chatting with a downloaded model, and the OpenAI-compatible server,
are next.
License
MIT
Metadata
Release files for llmcompoz 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llmcompoz-0.1.1.tar.gz | 48.7 kB | With provenance | Details for llmcompoz-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llmcompoz-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for llmcompoz-0.1.1-py3-none-any.whl |
Total release size: 104.0 kB
Release files / llmcompoz-0.1.1.tar.gz
| Download URL | llmcompoz-0.1.1.tar.gz |
|---|---|
| Size | 48.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ceea50d6466bdea795d3355a499213de460db4012b366f54219b9e71e513143
|
|
BLAKE2b-256 checksum How to use checksums |
1a627718ebbffbd7e89566c9d233ab1e52c6c29aeefd19235191e631003129f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logRelease files / llmcompoz-0.1.1-py3-none-any.whl
| Download URL | llmcompoz-0.1.1-py3-none-any.whl |
|---|---|
| Size | 55.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f463ba7d3d4cb9ecedc50e3c8ec7d3adda0b3e200e1ffac16457172c369973cb
|
|
BLAKE2b-256 checksum How to use checksums |
d156e2853bedab2ec6400f5ae519a507a141cba10b07d3a999aba290a79f9470
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logSecurity for llmcompoz 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for llmcompoz-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.