โถ๏ธ Qompass AI Quick Start
curl -fsSL https://raw.githubusercontent.com/qompassai/python/main/scripts/quickstart.sh | sh๐ We advise you read the script BEFORE running it ๐
#!/bin/sh # /qompassai/python/scripts/quickstart.sh # Qompass AI Python Quick Start # Copyright (C) 2025 Qompass AI, All rights reserved ######################################################### set -eu PREFIX="$HOME/.local" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" LOCAL_PREFIX="$HOME/.local" BIN_DIR="$LOCAL_PREFIX/bin" LIB_DIR="$LOCAL_PREFIX/lib" SHARE_DIR="$LOCAL_PREFIX/share" SRC_DIR="$LOCAL_PREFIX/src/python" mkdir -p "$PREFIX/bin" PY_VERSIONS=" 1|3.6.15 2|3.7.17 3|3.8.19 4|3.9.19 5|3.10.14 6|3.11.9 7|3.12.3 8|3.13.5 9|3.14.0a6 " printf 'โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ\n' printf 'โ Qompass AI ยท Python QuickโStart โ\n' printf 'โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ\n' printf ' ยฉ 2025 Qompass AI. All rights reserved \n\n' echo "Which Python version would you like to build?" echo "$PY_VERSIONS" | while IFS="|" read num version; do [ -z "$num" ] && continue echo " $num) Python $version" done echo " a) All" echo " q) Quit" printf "Choose [8]: " read -r choice [ -z "$choice" ] && choice=8 [ "$choice" = "q" ] && exit 0 PY_FINALS_LIST="3.6.15 3.7.17 3.8.19 3.9.19 3.10.14 3.11.9 3.12.3 3.13.5 3.14.0a6" if [ "$choice" = "a" ] || [ "$choice" = "A" ]; then VERSIONS_TO_BUILD="$PY_FINALS_LIST" elif printf '%s\n' $PY_FINALS_LIST | awk "NR==$choice" | grep -q .; then VERSIONS_TO_BUILD=$(printf '%s\n' $PY_FINALS_LIST | awk "NR==$choice") else echo "Invalid selection." >&2 exit 1 fi echo echo "You selected: $VERSIONS_TO_BUILD" echo "Which build configuration?" echo " 1) Classic CPython" echo " 2) Free-threaded (GIL-free, experimental)" echo " 3) Classic with FULL OPTIMIZATIONS (PGO, LTO, LTO_FLAGS)" echo " 4) Free-threaded + FULL OPTIMIZATIONS" echo " q) Quit" printf "Choose [1]: " read -r cbuild [ -z "$cbuild" ] && cbuild=1 [ "$cbuild" = "q" ] && exit 0 FREE_THREADED="no" DO_OPTIMIZE="no" case "$cbuild" in 2) FREE_THREADED="yes" ;; 3) DO_OPTIMIZE="yes" ;; 4) FREE_THREADED="yes" DO_OPTIMIZE="yes" ;; esac for PY_VERS in $VERSIONS_TO_BUILD; do PY_MAJ="$(echo "$PY_VERS" | cut -d. -f1-2)" cd "$SRC_DIR" if [ ! -d "cpython-$PY_VERS" ]; then echo "โ Cloning Python source (cpython $PY_VERS)..." git clone --branch "v$PY_VERS" https://github.com/python/cpython.git "cpython-$PY_VERS" fi cd "cpython-$PY_VERS" git fetch origin git checkout "v$PY_VERS" git clean -fdx echo "โ Configuring Python $PY_VERS build..." CONFIG_FLAGS="--prefix=$LOCAL_PREFIX" [ "$FREE_THREADED" = "yes" ] && CONFIG_FLAGS="$CONFIG_FLAGS --enable-free-threaded-interpreter" [ "$DO_OPTIMIZE" = "yes" ] && CONFIG_FLAGS="$CONFIG_FLAGS --enable-optimizations --with-lto" ./configure "$CONFIG_FLAGS" echo "โ Building Python $PY_VERS (this may take several minutes)..." export CFLAGS="-Wno-error=date-time" make -j"$(nproc)" echo "โ Installing Python $PY_VERS (no sudo needed)..." make install done case ":$PATH:" in *":$BIN_DIR:"*) ;; *) export PATH="$BIN_DIR:$PATH" ;; esac add_path_to_shell_rc() { rcfile=$1 line="export PATH=\"$BIN_DIR:\$PATH\"" if [ -f "$rcfile" ]; then if ! grep -Fxq "$line" "$rcfile"; then printf '\n# Added by Qompass AI Python quickstart script\n%s\n' "$line" >>"$rcfile" echo " โ Added PATH export to $rcfile" fi fi } add_path_to_shell_rc "$HOME/.bashrc" add_path_to_shell_rc "$HOME/.zshrc" add_path_to_shell_rc "$HOME/.profile" PY_MAJ="$(echo "$PY_VERS" | cut -d. -f1-2)" PIP_PATH="$BIN_DIR/pip$PY_MAJ" PYTHON_PATH="$BIN_DIR/python$PY_MAJ" echo "โ Upgrading pip and installing core wheels..." "$PYTHON_PATH" -m ensurepip --upgrade "$PYTHON_PATH" -m pip install --upgrade pip wheel setuptools echo printf "Do you want to install \033[1mpyenv\033[0m for managing multiple Pythons? [Y/n]: " read -r ans [ -z "$ans" ] && ans="Y" if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then if [ ! -d "$PYENV_ROOT" ]; then curl -fsSL https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash for rc in "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.profile"; do if [ -f "$rc" ]; then if ! grep -q "pyenv init" "$rc"; then printf "\n# Pyenv config\nexport PYENV_ROOT=\"%s\"\nexport PATH=\"\\\$PYENV_ROOT/bin:\\\$PATH\"\neval \"\\\$(pyenv init --path)\"\n" "$PYENV_ROOT" >>"$rc" echo " โ Added pyenv setup to $rc" fi fi done else echo "โ pyenv already present." fi fi echo printf "Do you want to install \033[1mruff\033[0m (fast Python linter)? [Y/n]: " read -r ans [ -z "$ans" ] && ans="Y" if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then "$PIP_PATH" install --user ruff echo "โ ruff installed via pip" fi echo printf "Do you want to install \033[1muv\033[0m (pip replacement and package manager)? [Y/n]: " read -r ans [ -z "$ans" ] && ans="Y" if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then if command -v pipx >/dev/null 2>&1; then pipx install uv || "$PIP_PATH" install --user uv else "$PIP_PATH" install --user uv fi echo "โ uv installed" fi echo echo "Would you like to install editor tooling for Python development?" echo " 1) python-lsp-server (LSP support, compatible with most editors)" echo " 2) pyright (Microsoft, static type checker/LSP, Node.js required)" echo " 3) basedpyright (Rust-based, fast drop-in Pyright alternative, LSP)" echo " 4) debugpy (VSCode-compatible debugger, works in editors/Jupyter)" echo " 5) ipython (enhanced interactive Python prompt)" echo " 6) pdbpp (better pdb, drop-in REPL/debugger)" echo " a) All of the above" echo " n) None (skip)" printf "Choose [a]: " read -r pytools_ans [ -z "$pytools_ans" ] && pytools_ans="a" INSTALL_LSP_TOOL() { tool="$1" pkg="$2" if [ "$tool" = "pyright" ]; then if command -v npm >/dev/null 2>&1; then echo "โ Installing pyright (npm)..." npm install -g pyright else echo "npm not found, falling back to pipx/pip." if command -v pipx >/dev/null 2>&1; then pipx install pyright else "$PIP_PATH" install --user pyright fi fi elif [ "$tool" = "basedpyright" ]; then if command -v pipx >/dev/null 2>&1; then echo "โ Installing basedpyright (pipx)..." pipx install basedpyright else "$PIP_PATH" install --user basedpyright fi else echo "โ Installing $tool..." "$PIP_PATH" install --user "$pkg" fi } case "$pytools_ans" in 1) INSTALL_LSP_TOOL "python-lsp-server" "python-lsp-server[all]" ;; 2) INSTALL_LSP_TOOL "pyright" "pyright" ;; 3) INSTALL_LSP_TOOL "basedpyright" "basedpyright" ;; 4) INSTALL_LSP_TOOL "debugpy" "debugpy" ;; 5) INSTALL_LSP_TOOL "ipython" "ipython" ;; 6) INSTALL_LSP_TOOL "pdbpp" "pdbpp" ;; a | A) INSTALL_LSP_TOOL "python-lsp-server" "python-lsp-server[all]" INSTALL_LSP_TOOL "pyright" "pyright" INSTALL_LSP_TOOL "basedpyright" "basedpyright" INSTALL_LSP_TOOL "debugpy" "debugpy" INSTALL_LSP_TOOL "ipython" "ipython" INSTALL_LSP_TOOL "pdbpp" "pdbpp" ;; n | N) echo "Skipping extra tooling." ;; *) echo "Unknown selection, skipping." ;; esac create_xdg_config() { tool="$1" default_content="$2" confdir="$XDG_CONFIG_HOME/$tool" confpath="$confdir/config.toml" mkdir -p "$confdir" if [ -f "$confpath" ]; then echo "โ $tool config already exists at $confpath" return fi printf "Do you want to write an example config for $tool to %s? [Y/n]: " "$confpath" read -r ans [ -z "$ans" ] && ans="Y" if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then echo "โ Creating example $tool config at $confpath" printf "%s\n" "$default_content" >"$confpath" fi } RUFF_CFG='[lint]\nselect = ["E", "F", "W"] # Example: style, errors, warnings' UV_CFG='[uv]\npypi_mirror = "https://pypi.org/simple"\ncache_dir = "~/.cache/uv"\n' PYTHON_CFG='[startup]\n# Put any sitecustomize or startup hooks here\n' create_xdg_config "ruff" "$RUFF_CFG" create_xdg_config "uv" "$UV_CFG" create_xdg_config "python" "$PYTHON_CFG" echo echo "โ Python $VERSIONS_TO_BUILD has been built and installed in $BIN_DIR" if [ "$FREE_THREADED" = "yes" ]; then echo " (Free-threaded interpreter enabled!)" fi echo "โ Test it with: $PYTHON_PATH --version" echo "โ Your pip is: $PIP_PATH" echo "โ pyenv (if installed) is in \$HOME/.pyenv; add to your PATH if desired." echo "โ ruff and uv are installed in ~/.local/bin (and can be configured in $XDG_CONFIG_HOME/)" echo "โ All binaries/libs/configs are under ~/.local/, ~/.pyenv/, ~/.config/" echo "โ Add '$BIN_DIR' to your shell \$PATH if not already present." echo "โ For custom packages, use: $PIP_PATH install --user ..." echo "โ To uninstall, just rm -rf $LOCAL_PREFIX/{bin/lib/share} $SRC_DIR/cpython-* ~/.pyenv ~/.cache/ruff ~/.cache/uv $XDG_CONFIG_HOME/ruff $XDG_CONFIG_HOME/uv" echo "โ Ready, Set, Python! โ" exit 0
๐งญ 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
[](https://github.com/sponsors/phaedrusflow) [](https://patreon.com/qompassai) [](https://liberapay.com/qompassai) [](https://opencollective.com/qompassai) [](https://www.buymeacoffee.com/phaedrusflow)
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:
$$ \text{Attention}(Q, K, V) = \text{softmax}\left( \frac{QK^T}{\sqrt{d_k}} \right) 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.
