mirror of
https://github.com/hasso5703/alzeo.git
synced 2026-12-06 12:54:19 +01:00
Ornith AI's Ornith 1.5 122B (MIT), a mixture of experts of the Qwen3.5 family with vision, in its authors' NVFP4 build pinned at its revision of 2026-10-21, served by vLLM with b12x in the Flash FP4-Local lane's image: its MTP head drafting 2 tokens, 8 requests at a time, prefix caching with the Mamba states aligned, the checkpoint's chat template and sampling as published, served as ornith-1.5-122b. Its window is 1,048,576 tokens: YaRN at factor 4, written whole into text_config.rope_parameters, the one form this vLLM reads (the model card's rope_scaling changed no probability on the reference box), and a KV cache fixed at 17 GiB, 1,301,680 tokens. Installed on demand like the other lanes: install-ornith-122b.sh with its pins (--units-only, --prepare, --stage, --uninstall), the --no-ornith-122b and --with-ornith-122b flags, a switch-model.sh and prepare-lane.sh target, its sudoers lines, every other unit's Conflicts= and After=, the keepalive's hold, the uninstall's lists. The image is shared: each lane's uninstall leaves the io_uring filter and the image to the other while it is installed, and pin_untag says which tag still keeps it. The cockpit shows it in the b12x family, opencode and pi get a provider whose variants are its template's (enable_thinking on, or none), and the proxy (v6.45) turns a request's reasoning effort into enable_thinking for it: none and minimal off, the rest on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
178 lines
8.9 KiB
Python
178 lines
8.9 KiB
Python
#!/usr/bin/env python3
|
|
"""The documents say what the code does, where a check can tell.
|
|
|
|
Three drifts found in review (2026-09-24), each of which a reader could not see
|
|
from the page itself:
|
|
- a code block of README.md was never closed, so on GitHub the paragraph after
|
|
it, the heading of the cockpit section and its introduction rendered as code;
|
|
- install.sh's closing summary sent people to a cockpit tab named Benchmarks,
|
|
which never existed, and the README's tab table promised a bench, a canary
|
|
battery and a key regeneration no tab has;
|
|
- the README's disk requirements were not the preflight's (84 GB announced for
|
|
a 27B target where the preflight asks 45 on one disk and 40 on another, 225
|
|
for a flash target where it asks 230 and 35), so a box sized from the README
|
|
was refused.
|
|
"""
|
|
import math
|
|
import pathlib
|
|
import re
|
|
import subprocess
|
|
import unittest
|
|
|
|
REPO = pathlib.Path(__file__).resolve().parents[1]
|
|
SKIP_DIRS = {".git", ".claude", ".venv", ".venv-test", ".hypothesis", "node_modules", "__pycache__"}
|
|
|
|
|
|
def tracked(*patterns):
|
|
"""The tracked files matching the patterns, or, outside a git checkout, the same
|
|
walk with the working directories of tools left out."""
|
|
r = subprocess.run(["git", "-C", str(REPO), "ls-files", "-z", "--", *patterns],
|
|
capture_output=True, text=True)
|
|
if r.returncode == 0 and r.stdout:
|
|
return [REPO / p for p in r.stdout.split("\0") if p]
|
|
found = set()
|
|
for pat in patterns:
|
|
for p in REPO.rglob(pat):
|
|
if not SKIP_DIRS & set(p.relative_to(REPO).parts):
|
|
found.add(p)
|
|
return sorted(found)
|
|
|
|
|
|
FENCE = re.compile(r"^\s*(`{3,}|~{3,})(.*)$")
|
|
|
|
|
|
def fence_problems(text):
|
|
"""CommonMark's rule, as far as this repo's pages need it: a block opens on a
|
|
fence of three or more backticks or tildes, and only a fence of the same
|
|
character, at least as long and with nothing after it, closes it. So a fence
|
|
with an info string inside an open block cannot close it, and is the mark of a
|
|
block left open above (README.md's Operations block ran into the next
|
|
```bash that way)."""
|
|
problems, open_at = [], None
|
|
for n, line in enumerate(text.splitlines(), 1):
|
|
m = FENCE.match(line)
|
|
if not m:
|
|
continue
|
|
fence, rest = m.group(1), m.group(2).strip()
|
|
if open_at is None:
|
|
open_at = (n, fence)
|
|
elif fence[0] == open_at[1][0] and len(fence) >= len(open_at[1]) and not rest:
|
|
open_at = None
|
|
elif rest:
|
|
problems.append(f"line {n}: a fence with an info string inside the block opened at line {open_at[0]}")
|
|
if open_at is not None:
|
|
problems.append(f"line {open_at[0]}: a code block that never closes")
|
|
return problems
|
|
|
|
|
|
class TheCodeBlocksClose(unittest.TestCase):
|
|
def test_every_tracked_page(self):
|
|
pages = tracked("*.md")
|
|
self.assertGreater(len(pages), 20, "the page list came back nearly empty")
|
|
bad = {str(p.relative_to(REPO)): fence_problems(p.read_text(encoding="utf-8")) for p in pages}
|
|
bad = {k: v for k, v in bad.items() if v}
|
|
self.assertEqual(bad, {})
|
|
|
|
def test_the_rule_sees_the_block_that_swallowed_a_heading(self):
|
|
# the shape README.md had: a block that runs into the next opening fence
|
|
text = "## Operations\n\n```bash\nls\n\nprose\n\n## The cockpit\n\n```bash\nx\n```\n"
|
|
self.assertEqual(len(fence_problems(text)), 1)
|
|
self.assertEqual(fence_problems("```\na\n```\n\n~~~~\n```\n~~~~\n"), [])
|
|
self.assertEqual(fence_problems("```python\nx\n"), ["line 1: a code block that never closes"])
|
|
|
|
|
|
def nav_labels():
|
|
html = (REPO / "dashboard/static/index.html").read_text()
|
|
labels = re.findall(r'<button class="nav" data-view="[a-z]+"[^>]*>.*?<span class="lab">([^<]+)</span>', html)
|
|
return set(labels)
|
|
|
|
|
|
# "<Name> tab" in prose and messages; a leading word that only introduces the name
|
|
# ("The Agent tab", "Every tab") is not part of it
|
|
TAB_REF = re.compile(r"\b([A-Z][a-z]+(?: [A-Z][a-z]+)?) tab\b")
|
|
NOT_A_NAME = {"The", "Every", "One", "Each", "This", "That", "A", "An", "Its", "Any", "Which"}
|
|
|
|
|
|
class TheTabsTheDocsNameExist(unittest.TestCase):
|
|
def test_the_page_has_its_tabs(self):
|
|
self.assertGreaterEqual(len(nav_labels()), 10, "the nav markup moved: fix the pattern")
|
|
|
|
def test_every_tab_named_anywhere_is_one_of_the_page(self):
|
|
labels = nav_labels()
|
|
unknown = []
|
|
# the changelog is history: a tab it names may have been renamed since
|
|
files = [p for p in tracked("*.md", "*.sh", "*.py", "*.js", "*.html") if p.name != "CHANGELOG.md"]
|
|
for p in files:
|
|
for n, line in enumerate(p.read_text(encoding="utf-8", errors="replace").splitlines(), 1):
|
|
for m in TAB_REF.finditer(line):
|
|
words = m.group(1).split()
|
|
while words and words[0] in NOT_A_NAME:
|
|
words.pop(0)
|
|
if words and " ".join(words) not in labels:
|
|
unknown.append(f"{p.relative_to(REPO)}:{n}: {m.group(0)}")
|
|
self.assertEqual(unknown, [], f"tabs the page does not have (it has {sorted(labels)})")
|
|
|
|
def test_the_readme_table_lists_the_tabs_of_the_page(self):
|
|
readme = (REPO / "README.md").read_text()
|
|
section = readme[readme.index("## The cockpit"):]
|
|
section = section[:section.index("\n## ", 1)]
|
|
rows = re.findall(r"^\| \*\*([^*]+)\*\* \|", section, re.M)
|
|
self.assertEqual(sorted(rows), sorted(nav_labels()))
|
|
|
|
|
|
def gb(gib):
|
|
"""A size of the preflight's in the README's unit. install.sh counts GiB, as df -BG gives
|
|
them; the README says GB of 10^9 bytes, as disks are sold, rounded up, and a sum of the
|
|
parts it names (its 93 GiB were 93 GB there, 99.9 GB of disk; found in review, 2026-10-16)."""
|
|
return math.ceil(int(gib) * 2 ** 30 / 10 ** 9)
|
|
|
|
|
|
class TheDiskNeedsAreThePreflights(unittest.TestCase):
|
|
def test_the_readme_states_what_the_installer_checks(self):
|
|
sh = (REPO / "install.sh").read_text()
|
|
pairs = [(gb(h), gb(d)) for h, d in re.findall(r"NEED_GB=(\d+); DOCKER_NEED_GB=(\d+); IMG_LABEL=", sh)]
|
|
self.assertEqual(len(pairs), 2, "the preflight's two needs moved: fix the pattern")
|
|
(b_hf, b_docker), (f_hf, f_docker) = pairs
|
|
ple = re.findall(r"NEED_GB=\$\(\(NEED_GB \+ (\d+)\)\)", sh)
|
|
self.assertEqual(len(ple), 1, "the PLE table's share moved: fix the pattern")
|
|
f_hf += gb(ple[0])
|
|
labels = [gb(n) for n in re.findall(r'IMG_LABEL="(\d+) GB Docker image"', sh)]
|
|
readme = (REPO / "README.md").read_text()
|
|
req = next(line for line in readme.splitlines() if line.startswith("Requirements:"))
|
|
for n in (b_hf, b_docker, f_hf, f_docker, b_hf + b_docker, f_hf + f_docker):
|
|
self.assertIn(f"**{n} GB**", req, f"install.sh checks {n} GB somewhere the README does not say")
|
|
for n in labels:
|
|
self.assertIn(f"its {n} GB image", req, f"install.sh names a {n} GB image the README does not")
|
|
|
|
def test_the_help_gives_each_lane_one_size(self):
|
|
# install.sh's help gave the Nemotron lane 60 GB in its overview, and 51 at its
|
|
# --no-nemotron line, in the README and in the CHANGELOG (found in review, 2026-10-16)
|
|
sh = (REPO / "install.sh").read_text()
|
|
overview = sh[sh.index("A plain run installs the box"):sh.index(" --no-start ")]
|
|
# a lane's size is the last number in its parenthesis, before what a ";" adds (the Flash
|
|
# FP4-Local lane's copy of its table, on a cache on another disk)
|
|
said = {re.sub(r"\s+", "-", name.lower()).replace("flash-fp4-local", "flash-local"):
|
|
re.findall(r"\d+", inside.split(";")[0])[-1] for name, inside in
|
|
re.findall(r"the (image|video|Kolibri|Nemotron Super|Nemotron|Flash\s+FP4-Local|Ornith\s+122B) lane \(([^)]*)\)",
|
|
overview)}
|
|
flags = dict(re.findall(r"--no-(image|video|kolibri|nemotron-super|nemotron|flash-local|ornith-122b)\s+leave the .*?\((?:vLLM, )?(\d+) GB\)", sh))
|
|
self.assertEqual(set(said), {"image", "video", "kolibri", "nemotron", "nemotron-super", "flash-local", "ornith-122b"},
|
|
overview)
|
|
self.assertEqual(said, flags)
|
|
|
|
|
|
|
|
class TheGsm8kCountIsTheOneRunEvalAsks(unittest.TestCase):
|
|
def test_our_scores_name_the_questions_they_were_asked(self):
|
|
"""run_eval's GSM8K asks the test set's 1,319 questions less the five it shows as examples in
|
|
every prompt: 1,314. The README and BENCHMARKS.md gave scores "over all 1,319" that only
|
|
1,314 can give: 97.41% is 1,280 of 1,314, and no count out of 1,319 rounds to it (found
|
|
2026-10-21)."""
|
|
self.assertEqual(round(100 * 1280 / 1314, 2), 97.41)
|
|
self.assertFalse([k for k in range(1300) if round(100 * k / 1319, 2) == 97.41])
|
|
for name in ("README.md", "BENCHMARKS.md"):
|
|
self.assertNotRegex((REPO / name).read_text(), r"(?i)gsm8k[^|\n]*all 1,319", name)
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main(verbosity=2)
|