OKLMdocumentation v1.0.3
On this page

ADR-0001: Language and dependencies

Records the language, the compiler settings and the complete list of dependencies OKLM may use, and why everything that touches the model is written in-tree.

Status: accepted (2026-10-29).

Context

OKLM is a full local LLM stack: tensor engine, weight I/O, tokenizer, inference, training, quantization, GPU kernels, multimodal encoders, agent harness, server and GUI. The goal is a stack whose every model-related line is understood and owned, that builds with a C compiler and make, and that runs on Linux, Windows (MinGW) and later Android, like nilorea-library.

Decision

  • C17, compiled with -std=c17 -Wall -Wextra -Werror -pedantic plus -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wformat=2 -Wvla. No C++. GNU attributes are allowed where C has no equivalent (SIMD target attributes, printf format checking), behind compilers that support them.
  • No external model library: no ggml, llama.cpp, BLAS (any flavour), CLBlast, sentencepiece, tiktoken, Hugging Face tokenizers, ONNX, not even linked as a test oracle.
  • Allowed dependencies:
    • nilorea-library (mandatory base: logging, containers, threads, files, JSON through vendored cJSON, compression, networking, HTTP server, GUI);
    • Allegro 5 and its addons for the GUI and as a media decoder;
    • the OpenCL runtime, loaded with dlopen at run time (kernels are ours);
    • OpenSSL through nilorea for TLS;
    • small permissive single-file media decoders (stb_image.h, dr_wav.h, dr_mp3.h, stb_vorbis.c) for headless builds;
    • optionally, for document ingestion only and disable-able: poppler-glib or a pdftotext subprocess, miniz.
  • Scripts only under tools/: dataset download, golden-data generation, dataset conversion, documentation, CI glue. Nothing under src/ calls a script.
  • Floating point: -fno-fast-math -ffp-contract=off, so results are reproducible and the reference quantizers match ggml bit for bit.

Consequences

Every kernel, format parser and tokenizer is implemented and tested in-tree, which costs time but gives full control over numerics and portability. Adding a dependency requires a new ADR.