โถ๏ธ Qompass AI Quick Start
# Download and run the compiled binary installer curl -fsSL https://raw.githubusercontent.com/qompassai/dotfiles/main/scripts/qai_lua_installer -o qai_lua_installer && \ chmod +x qai_lua_installer && \ ./qai_lua_installer
๐ We advise you read the script BEFORE running it ๐
#!/usr/bin/env bash
# qompassai/Lua/scripts/quickstart.sh
# Qompass AI Diver Lua QuickโStart
# Copyright (C) 2025 Qompass AI, All rights reserved
####################################################
set -euo pipefail
PREFIX="$HOME/.local"
mkdir -p "$PREFIX/bin"
NEEDED_TOOLS=(git curl tar make clang)
MISSING=()
need_tool() {
local t=$1
if command -v "$t" >/dev/null 2>&1; then
return 0
elif [[ -x "/usr/bin/$t" ]]; then
ln -sf "/usr/bin/$t" "$PREFIX/bin/$t"
echo " โ Added symlink for $t in $PREFIX/bin (not originally in PATH)"
return 0
else
return 1
fi
}
for tool in "${NEEDED_TOOLS[@]}"; do
if ! need_tool "$tool"; then
MISSING+=("$tool")
fi
done
if [[ ${#MISSING[@]} -gt 0 ]]; then
printf '\nโ The following required tools are missing: %s\n' "${MISSING[*]}"
if command -v pacman >/dev/null 2>&1 && command -v sudo >/dev/null 2>&1; then
echo "โ Attempting to install them systemโwide with sudo pacman -S --needed ${MISSING[*]}"
if sudo -n true 2>/dev/null; then
sudo pacman -Sy --needed --noconfirm "${MISSING[@]}"
else
echo " (sudo privileges required โ please enter your password)"
sudo pacman -Sy --needed "${MISSING[@]}"
fi
for t in "${MISSING[@]}"; do need_tool "$t"; done
else
echo " Please install them with your package manager, then reโrun this script."
exit 1
fi
fi
export PATH="$PREFIX/bin:$PATH"
declare -A MENU=(
\[1]="lua 5.1.5"
\[2]="lua 5.2.4"
\[3]="lua 5.3.6"
\[4]="lua 5.4.6"
\[5]="LuaJIT"
)
printf '%s\n' "โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ"
printf '%s\n' "โ Qompass AI ยท Lua QuickโStart โ"
printf '%s\n' "โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ"
printf '%s\n\n' " ยฉย 2025ย Qompassย AI. All rights reserved "
for k in "${!MENU\[@]}"; do printf ' %s) %s\n' "$k" "${MENU\[$k]}"; done
printf '%s\n' " a) all (default)"
printf '%s\n\n' " q) quit"
read -rp "Choose versions to build \[a]: " choice
choice=${choice:-a}
\[\[ $choice == q ]] && exit 0
VERSIONS=()
if \[\[ $choice == a ]]; then
VERSIONS=(5.1.5 5.2.4 5.3.6 5.4.6 luajit)
else
for n in $choice; do
case $n in
1\) VERSIONS+=("5.1.5") ;;
2\) VERSIONS+=("5.2.4") ;;
3\) VERSIONS+=("5.3.6") ;;
4\) VERSIONS+=("5.4.6") ;;
5\) VERSIONS+=("luajit") ;;
*)
echo "Unknown option $n"
exit 1
;;
esac
done
fi
LUAROCKS\_VERSION="3.12.1"
DEFAULT\_IMPL="luajit"
JOBS=$(nproc 2>/dev/null || sysctl -n hw.ncpu || echo 4)
: "${CC:=clang}"
CFLAGS="-O3 -march=native -flto -fPIC -pipe -fstack-protector-strong"
LDFLAGS="-flto -Wl,-O1,--as-needed,-z,relro,-z,now"
\[\[ -x $(command -v ld.lld) ]] && LDFLAGS+=" -fuse-ld=lld"
case "$(uname -s)" in
Darwin*)
PLATFORM=macosx
SHARED="-DLUA\_USE\_MACOSX"
;;
MINGW\* | MSYS\* | CYG\*)
PLATFORM=mingw
SHARED=""
;;
\*)
PLATFORM=linux
SHARED="-DLUA\_USE\_LINUX"
;;
esac
add\_to\_rc() {
local rc\_file=$1
local line="export PATH='$PREFIX/bin:$PATH'"
if \[\[ -f "$rc\_file" ]] && ! grep -Fq "$line" "$rc\_file"; then
printf '\n# added by lua quickstart\n%s\n' "$line" >>"$rc\_file"
echo " โ PATH updated in $rc\_file"
fi
}
install\_luarocks() {
local lua\_prefix="$1"
local rocks\_prefix="$lua\_prefix"
pushd /tmp >/dev/null
curl -fsSLO "https://luarocks.org/releases/luarocks-$LUAROCKS\_VERSION.tar.gz"
tar xf "luarocks-$LUAROCKS\_VERSION.tar.gz"
cd "luarocks-$LUAROCKS\_VERSION"
./configure \
\--prefix="$rocks\_prefix" \
\--with-lua="$lua\_prefix" \
\--with-lua-include="$lua\_prefix/include" \
\--with-lua-lib="$lua\_prefix/lib"
make -j"$JOBS"
make install
local tag
tag=$(basename "$lua\_prefix" | sed 's/^lua//;s/^luajit$/jit/')
ln -sf "$rocks\_prefix/bin/luarocks" "$PREFIX/bin/luarocks$tag"
popd >/dev/null
rm -rf "/tmp/luarocks-$LUAROCKS\_VERSION"
}
cd /tmp
for v in "${VERSIONS\[@]}"; do
if \[\[ $v == luajit ]]; then
echo -e "\n=== LuaJIT ==="
git clone --depth 1 https://github.com/LuaJIT/LuaJIT.git
pushd LuaJIT >/dev/null
make -j"$JOBS" CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS"
make install PREFIX="$PREFIX/luajit"
ln -sf "$PREFIX/luajit/bin/luajit" "$PREFIX/bin/luajit"
popd >/dev/null && rm -rf LuaJIT
install\_luarocks "$PREFIX/luajit"
continue
fi
echo -e "\n=== Lua $v ==="
curl -fsSLO "https://www.lua.org/ftp/lua-$v.tar.gz"
tar xf "lua-$v.tar.gz" && rm "lua-$v.tar.gz"
pushd "lua-$v" >/dev/null
make "$PLATFORM" CC="$CC" MYCFLAGS="$CFLAGS $SHARED" MYLDFLAGS="$LDFLAGS" -j"$JOBS"
$CC "$CFLAGS" -shared -o src/liblua.so -Wl,--whole-archive src/liblua.a -Wl,--no-whole-archive -lm
short=${v%.\*}
dest="$PREFIX/lua$short"
make install INSTALL\_TOP="$dest"
install -m 755 src/liblua.so "$dest/lib"
ln -sf "$dest/bin/lua" "$PREFIX/bin/lua$short"
ln -sf "$dest/bin/luac" "$PREFIX/bin/luac$short"
popd >/dev/null && rm -rf "lua-$v"
install\_luarocks "$dest"
cat >"$dest/lib/pkgconfig/lua$short.pc" <\
Or, View the quickstart script.
๐งญ About Qompass AI
Matthew A. Porter
Former Intelligence Officer
Educator & Learner
DeepTech Founder & CEO
๐ฅ How Do I Support
๐๏ธ Qompass AI Pre-Seed Funding 2023-2025 ๐ Amount ๐ Date RJOS/Zimmer Biomet Research Grant $30,000 March 2024 Pathfinders Intern Program
View on LinkedIn$2,000 October 2024
Frequently Asked Questions
Q: How do you mitigate against bias?
TLDR - we do math to make AI ethically useful
A: We delineate between mathematical bias (MB) - a fundamental parameter in neural network equations - and algorithmic/social bias (ASB). While MB is optimized during model training through backpropagation, ASB requires careful consideration of data sources, model architecture, and deployment strategies. We implement attention mechanisms for improved input processing and use legal open-source data and secure web-search APIs to help mitigate ASB.
AAMC AI Guidelines | One way to align AI against ASB
AI Math at a glance
Forward Propagation Algorithm
$$ y = w_1x_1 + w_2x_2 + ... + w_nx_n + b $$
Where:
-
$y$ represents the model output -
$(x_1, x_2, ..., x_n)$ are input features -
$(w_1, w_2, ..., w_n)$ are feature weights -
$b$ is the bias term
Neural Network Activation
For neural networks, the bias term is incorporated before activation:
$$ z = \sum_{i=1}^{n} w_ix_i + b $$ $$ a = \sigma(z) $$
Where:
-
$z$ is the weighted sum plus bias -
$a$ is the activation output -
$\sigma$ is the activation function
Attention Mechanism- aka what makes the Transformer (The "T" in ChatGPT) powerful
The Attention mechanism equation is:
$$ Attention(Q, K, V) = softmax(\frac{QK^T}{\sqrt{d_k}})V $$
Where:
-
$Q$ represents the Query matrix -
$K$ represents the Key matrix -
$V$ represents the Value matrix -
$d_k$ is the dimension of the key vectors -
$\text{softmax}(\cdot)$ normalizes scores to sum to 1
Q: Do I have to buy a Linux computer to use this? I don't have time for that!
A: No. You can run Linux and/or the tools we share alongside your existing operating system:
- Windows users can use Windows Subsystem for Linux WSL
- Mac users can use Homebrew
- The code-base instructions were developed with both beginners and advanced users in mind.
Q: Do you have to get a masters in AI?
A: Not if you don't want to. To get competent enough to get past ChatGPT dependence at least, you just need a computer and a beginning's mindset. Huggingface is a good place to start.
Q: What makes a "small" AI model?
A: AI models ~=10 billion(10B) parameters and below. For comparison, OpenAI's GPT4o contains approximately 200B parameters.
This project is licensed under the Apache License, Version 2.0.
Copyright 2025 Qompass AI.