build.sh
The whole build, every step
61 lines. This is the file the build actually runs, copied verbatim at build time.
#!/bin/bash
# Full rebuild. Refuses to leave a broken site behind: if any check fails,
# it exits non-zero and you should not deploy.
set -euo pipefail
cd "$(dirname "$0")"
n=0
total=16
step() { n=$((n + 1)); echo; echo "== $n/$total $1 =="; }
step "build cl100k browser bundle from source"
python3 makebundle.py cl100k_base
step "verify every shipped bundle against the reference"
python3 verify.py
step "browser BPE trainer vs Python reference"
python3 checkbpe.py
step "browser sampler vs Python reference"
python3 checkngram.py
step "chat billing rule vs the tokenizer's chat encoder"
python3 chatcost.py
step "neural model: gradient checks and browser/Python agreement"
python3 checkmlp.py
step "precompute tokens figures"
python3 precompute.py
step "precompute vocabulary figures"
python3 precompute_merges.py
step "precompute sampling figures"
python3 precompute_predict.py
step "precompute cost figures"
python3 precompute_chat.py
step "precompute learning figures"
python3 precompute_learn.py
step "generate Open Graph cards"
python3 ogimage.py
step "render pages"
python3 render.py
step "validate HTML, feed and sitemap"
python3 checkhtml.py
step "syntax-check JavaScript"
python3 checkjs.py
step "permalink round trip"
python3 checkpermalink.py
echo
echo "Build OK."