Build

One Python program, ops/build.py, builds the whole gligabao package from source: the admin UI, the Go binaries and the Rust sargo router. It runs on Linux, macOS and Windows, so each platform builds its own package.

What it builds

All build logic lives in ops/build.py (Python standard library only, no bash needed). The run_build*.sh scripts in the repository root are thin wrappers for Linux and macOS that call it.

Admin UI

TypeScript and SCSS in admin_ui/, built with npm into admin_ui/dist and embedded into the server binary. Needs Node.js.

Go binaries

gligabao (server and CLI), gligabao_agent, gligabao_worker, and always gligabao_agent_linux_amd64 for the Modal containers. Pure Go (no CGO), so they cross-compile from any host to any platform.

sargo

The Rust model router, built with cargo as a static binary and, with --sargo, embedded into the server. Rust does not cross-compile like Go: build it on its own OS.

key commands
$ python3 ops/build.py all                 # everything for this machine (Windows: py ops/build.py all)
$ python3 ops/build.py all --sargo        # ... with sargo built and embedded
$ python3 ops/build.py go --os linux --arch arm64   # cross-compile the Go binaries

Commands and flags

The commands, and the flags each one takes, in one place. --os and --arch default to the environment variables GOOS and GOARCH, then to this machine.

python3 ops/build.py <command> [flags]
all        # the full pipeline of the target platform: admin UI, sargo (optional), Go binaries
  --os linux|darwin|windows   # the target operating system.
  --arch amd64|arm64         # the target CPU architecture.
  --sargo                   # builds sargo statically and embeds it into the server (or BUILD_SARGO=true).
  --no-admin-ui             # builds without the admin UI and removes stale files of it (or BUILD_ADMIN_UI=false).
  --admin-ui                # builds and embeds the admin UI (the default).

admin-ui   # only admin_ui/dist
  --admin-ui / --no-admin-ui   # build it, or remove it, as above.

sargo      # only sargo
  --os, --arch             # the target, as above (the OS must be the one you are building on).
  --static                  # builds for the target triple, statically linked (Linux: musl).
  --embed                   # implies --static, then copies the binary to rust/sargo/bin/sargo for the Go build.

esbuild    # only generates the esbuild and typescript-go parsers that the Go build tag tsjs_css needs (TypeScript/JavaScript/CSS code extraction); every Go build here does it first

go         # only the Go binaries
  --os, --arch             # the target, as above.

server     # one stripped release server binary (used to build the PyPI wheels)
  --os, --arch             # the target, as above.
  --out FILE                # where to write the binary (required).

Without any flag, sargo does a plain dynamic cargo build --release for this machine. The shell wrappers take the same flags: ./run_build.sh [--no-admin-ui] [--sargo] is all, and ./run_build_rust.sh [--static] [--embed] is sargo.

Output artifacts

Everything the build produces goes under the repository root, mostly in build/. A .exe suffix is added on Windows.

PathWhat it is
build/gligabaoThe server and CLI, with the admin UI embedded (and sargo, with --sargo).
build/gligabao_agentThe deep-research agent with the knowledge base in process, without server or API.
build/gligabao_workerRuns one remember or query pipeline in process and exits.
build/gligabao_agent_linux_amd64The agent for Linux on x86-64 whatever the host is; the ML sidecar bakes it into the Modal app. No suffix on any OS.
admin_ui/dist/The built admin UI web files, embedded by the Go build.
rust/sargo/target/release/sargoThe plain (dynamic) sargo build.
rust/sargo/target/<triple>/release/sargoThe static sargo build, e.g. x86_64-unknown-linux-musl.
rust/sargo/bin/sargoThe static sargo copied here by --embed, where embed.go embeds it into the server. Always named sargo, on every OS.

Also in build/ but not produced by the build: gligabao.toml (the default config), evals_training/, ontology/ and agent_defs/ are tracked files, and build/pypi/ holds the staging directories of the PyPI wheels. The rest of build/ is ignored by git.

Linux

Build on Linux to get a fully static server.

Needs

Go and Node.js with npm (unless --no-admin-ui). For --sargo: cargo (rustup), build-essential and musl-tools (sudo apt install -y musl-tools on Ubuntu).

sargo

A static musl binary (x86_64-unknown-linux-musl or aarch64-unknown-linux-musl) that runs on any Linux, glibc or musl, of the same CPU architecture. The build adds the rustup target for you.

Architecture

sargo is built for the host architecture only (a cross musl compiler would be needed). To get arm64, build on an arm64 machine. The Go binaries cross-compile freely.

macOS

Build on a Mac for the darwin binaries.

Needs

Go and Node.js with npm. For --sargo: cargo (rustup) and the Xcode command line tools (xcode-select --install, which provide the linker).

sargo

Target aarch64-apple-darwin (Apple silicon, arm64) or x86_64-apple-darwin (Intel, amd64). Both build on either kind of Mac. macOS binaries cannot be fully static, but sargo links only system libraries.

Embedding

The embedded sargo must match the server: build both with the same --arch. The binaries are not code-signed or notarized by the build; do that separately before distributing them.

Windows

Build on Windows from a normal terminal, with no bash, make or MSYS: py ops/build.py all --sargo.

Needs

Go and Node.js with npm. For --sargo: cargo (rustup-init.exe from rustup.rs) and the Visual Studio C++ Build Tools, which provide the MSVC linker.

sargo

Target x86_64-pc-windows-msvc or aarch64-pc-windows-msvc, built with a statically linked C runtime so the .exe needs no Visual C++ redistributable. For arm64, install the ARM64 build tools component of Visual Studio.

Executables

Every output gets .exe, except gligabao_agent_linux_amd64, which is a Linux file. The embedded sargo is stored as bin/sargo and extracted as sargo.exe at run time, because Windows only runs .exe files.

Docker images

The images do not use the binaries in build/. The Dockerfile compiles its own binary from source in a build stage, so the host platform does not matter. Build it with ./run_build_container.sh or docker compose up --build.

ImageBuilt in the imageCopied from the repository
gligabao (Dockerfile)The admin UI (npm, in a node stage), gligabao (go build, CGO_ENABLED=0, in a Go stage) and gligabao_agent_linux_amd64, baked into the Modal app by the ML sidecar.build/gligabao.toml, build/evals_training/, build/ontology/, build/agent_defs/ and the ml_sidecar/ Python files with a venv (the server starts the ML sidecar from them). sargo is not included yet.