build.sh
The whole build, every step
76 lines. This is the file the build actually runs, copied verbatim at build time.
- 1
#!/bin/bash - 2
# Full rebuild. Refuses to leave a broken site behind: if any check fails, - 3
# it exits non-zero and you should not deploy. - 4
set -euo pipefail - 5
cd "$(dirname "$0")" - 6
- 7
n=0 - 8
total=21 - 9
step() { n=$((n + 1)); echo; echo "== $n/$total $1 =="; } - 10
- 11
step "build cl100k browser bundle from source" - 12
python3 makebundle.py cl100k_base - 13
- 14
step "verify every shipped bundle against the reference" - 15
python3 verify.py - 16
- 17
step "browser BPE trainer vs Python reference" - 18
python3 checkbpe.py - 19
- 20
step "browser sampler vs Python reference" - 21
python3 checkngram.py - 22
- 23
step "chat billing rule vs the tokenizer's chat encoder" - 24
python3 chatcost.py - 25
- 26
step "neural model: gradient checks and browser/Python agreement" - 27
python3 checkmlp.py - 28
- 29
step "attention head: gradient checks and browser/Python agreement" - 30
python3 checkattn.py - 31
- 32
step "precompute tokens figures" - 33
python3 precompute.py - 34
- 35
step "precompute vocabulary figures" - 36
python3 precompute_merges.py - 37
- 38
step "precompute sampling figures" - 39
python3 precompute_predict.py - 40
- 41
step "precompute cost figures" - 42
python3 precompute_chat.py - 43
- 44
step "precompute learning figures" - 45
python3 precompute_learn.py - 46
- 47
step "precompute attention figures (cached)" - 48
python3 precompute_attn.py - 49
- 50
step "precompute verification figures" - 51
python3 precompute_checking.py - 52
- 53
step "generate Open Graph cards" - 54
python3 ogimage.py - 55
- 56
step "render pages" - 57
python3 render.py - 58
- 59
step "colour contrast, both themes" - 60
python3 checka11y.py - 61
- 62
step "headings, labels and landmarks" - 63
python3 checkstructure.py - 64
- 65
step "validate HTML, feed and sitemap" - 66
python3 checkhtml.py - 67
- 68
step "syntax-check JavaScript" - 69
python3 checkjs.py - 70
- 71
step "permalink round trip" - 72
python3 checkpermalink.py - 73
- 74
echo - 75
echo "Build OK."