Skip to content

Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦

C

release: ship the web dashboard, so the Expert Atlas reaches users

ZacharyZcR259f3cbd6ae9
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 88ae7e39..8c424ef6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -55,6 +55,26 @@ jobs:
make colibri ${{ matrix.make_args }}
ls -lh colibri${{ matrix.ext }}
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '20'
+ cache: npm
+ cache-dependency-path: web/package-lock.json
+
+ # The dashboard is what README shows and what serves the Expert Atlas, but it
+ # was never packaged: a release user has no web/ to build from, so `coli web`
+ # pointed them at a directory the archive does not contain. Built here rather
+ # than committed, so dist/ stays a build artifact.
+ # shell: bash — on Windows the job default is msys2, but setup-node installs
+ # the native node/npm, which msys2's minimal PATH does not see.
+ - name: Build web dashboard
+ shell: bash
+ run: |
+ cd web
+ npm ci
+ npm run build
+ ls -lh dist/index.html dist/experts.json
+
- name: Package
run: |
TAG=${GITHUB_REF#refs/tags/}
@@ -71,6 +91,10 @@ jobs:
cp c/resource_plan.py dist/
cp c/doctor.py dist/
cp LICENSE dist/
+ # web/dist sits NEXT TO coli in the archive; both coli and openai_server.py
+ # probe that layout as well as the source checkout's one-level-up form.
+ mkdir -p dist/web
+ cp -r web/dist dist/web/dist
cd dist
if [ "${{ matrix.ext }}" = ".exe" ]; then
7z a colibri-${TAG}-${{ matrix.name }}.zip *
@@ -100,6 +124,12 @@ jobs:
# (The v1.1.0 tag build failed here when the banner still said "colibrì".)
echo "$out" | grep -q "colibri" || { echo "FAIL: coli did not run"; exit 1; }
echo "OK: coli locates the engine in the published archive"
+ # Same reasoning for the dashboard: assert the files are there AND that the
+ # server resolves them, since a right-looking archive with an unresolvable
+ # path is exactly the failure this whole step exists to catch.
+ test -f web/dist/index.html || { echo "FAIL: dashboard missing from archive"; exit 1; }
+ test -f web/dist/experts.json || { echo "FAIL: expert atlas missing from archive"; exit 1; }
+ python3 -c "import sys; sys.path.insert(0, '.'); from openai_server import APIHandler as A; d = A.WEB_DIST; assert (d / 'index.html').is_file(), 'server resolved WEB_DIST to %s, which has no index.html' % d; assert (d / 'experts.json').is_file(), 'no expert atlas under %s' % d; print('OK: the packaged server resolves the dashboard at', d)"
# Only the archives -- never the loose files. `dist/colibri-*.*` used to work by accident
# (the engine was versioned, so it did not match); now that the engine is plainly named,
diff --git a/c/Makefile b/c/Makefile
index f29e498c..a570b5a5 100644
--- a/c/Makefile
+++ b/c/Makefile
@@ -514,6 +514,15 @@ install: colibri$(EXE) olmoe$(EXE)
$(INSTALL) -m 755 olmoe$(EXE) $(DESTDIR)$(LIBEXECDIR)/olmoe$(EXE)
$(INSTALL) -m 644 resource_plan.py doctor.py openai_server.py version.py $(DESTDIR)$(LIBEXECDIR)/
$(INSTALL) -m 644 tools/*.py $(DESTDIR)$(LIBEXECDIR)/tools/
+ @# The dashboard is an optional build artifact (cd web && npm run build), so install
+ @# it only when it exists. It goes NEXT TO openai_server.py, which probes ./web/dist.
+ @if [ -f ../web/dist/index.html ]; then \
+ $(INSTALL) -d $(DESTDIR)$(LIBEXECDIR)/web/dist; \
+ cp -R ../web/dist/. $(DESTDIR)$(LIBEXECDIR)/web/dist/; \
+ echo "installed the web dashboard"; \
+ else \
+ echo "web/dist absent -- skipping the dashboard (build it with: cd web && npm run build)"; \
+ fi
uninstall:
rm -f $(DESTDIR)$(BINDIR)/coli
diff --git a/c/coli b/c/coli
index d9b13e6b..9f6cf667 100755
--- a/c/coli
+++ b/c/coli
@@ -897,7 +897,11 @@ def cmd_stop(a):
def cmd_web(a):
"""serve + open the dashboard in the browser once the API answers."""
need_model(a.model)
- dist = os.path.join(os.path.dirname(os.path.abspath(HERE)), "web", "dist")
+ # Same two layouts openai_server.py resolves: next to this script (release
+ # archive / installed tree) or one level up (source checkout, where this is c/coli).
+ cands = [os.path.join(HERE, "web", "dist"),
+ os.path.join(os.path.dirname(os.path.abspath(HERE)), "web", "dist")]
+ dist = next((d for d in cands if os.path.exists(os.path.join(d, "index.html"))), cands[-1])
if not os.path.exists(os.path.join(dist, "index.html")):
print(f"{C.yel}web UI not built:{C.r} run cd web && npm install && npm run build first;")
print("serving the API anyway (the dashboard will 404 until built).")
diff --git a/c/openai_server.py b/c/openai_server.py
index 5f78eed3..8b4dfaab 100644
--- a/c/openai_server.py
+++ b/c/openai_server.py
@@ -1534,7 +1534,16 @@ class APIHandler(BaseHTTPRequestHandler):
if model != self.server.model_id:
raise APIError(404, f"The model `{model}` does not exist.", "model", "model_not_found")
- WEB_DIST = Path(__file__).resolve().parent.parent / "web" / "dist"
+ # The dashboard ships in two layouts and the old single path only knew one:
+ # a source checkout puts this file in c/ (so web/dist is one level UP), while
+ # a release archive and an installed tree put it next to web/dist. Probing for
+ # index.html rather than the directory keeps an empty leftover web/dist from
+ # shadowing a real one.
+ WEB_DIST = next(
+ (c for c in (Path(__file__).resolve().parent / "web" / "dist",
+ Path(__file__).resolve().parent.parent / "web" / "dist")
+ if (c / "index.html").is_file()),
+ Path(__file__).resolve().parent.parent / "web" / "dist")
def serve_static(self, path):
"""Serve the built web UI (web/dist) so `coli web` is one process.