https://github.com/qompassai/python
Qompass AI On Python
https://github.com/qompassai/python
ai conda education equator python pytorch
Last synced: 29 days ago
JSON representation
Qompass AI On Python
- Host: GitHub
- URL: https://github.com/qompassai/python
- Owner: qompassai
- License: agpl-3.0
- Created: 2025-04-23T20:18:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-05-10T06:54:16.000Z (about 1 month ago)
- Last Synced: 2026-05-10T08:36:36.127Z (about 1 month ago)
- Topics: ai, conda, education, equator, python, pytorch
- Language: Jupyter Notebook
- Homepage:
- Size: 398 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE-AGPL
- Citation: CITATION.cff
- Zenodo: .zenodo.json
Awesome Lists containing this project
README
Python: The OG of AI
Qompass AI on Python


Python Solutions
* [Qompass Radar](https://github.com/qompassai/radar)
* [Qompass Qonfig](https://github.com/qompassai/qonfig)
Educational Videos
[](https://www.youtube.com/watch?v=T-XGHgaJIPU&t=511s)
โถ๏ธ Qompass AI Quick Start
```sh
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
Or, View
the quickstart script.
๐งญ About Qompass AI
Matthew A. Porter
Former Intelligence Officer
Educator & Learner
DeepTech Founder & CEO
Publications
Developer Programs
[](https://developer.nvidia.com/)
[](https://developers.facebook.com/)
[](https://hackerone.com/phaedrusflow)
[](https://huggingface.co/qompass)
[](https://dev.epicgames.com/)
Professional Profiles
Social Media
๐ฅ 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
๐ค How To Support Our Mission
[](https://github.com/sponsors/phaedrusflow)
[](https://patreon.com/qompassai)
[](https://liberapay.com/qompassai)
[](https://opencollective.com/qompassai)
[](https://www.buymeacoffee.com/phaedrusflow)
๐ Cryptocurrency Donations
**Monero (XMR):**
42HGspSFJQ4MjM5ZusAiKZj9JZWhfNgVraKb1eGCsHoC6QJqpo2ERCBZDhhKfByVjECernQ6KeZwFcnq8hVwTTnD8v4PzyH
๐ Copy Address
Funding helps us continue our research at the intersection of AI, healthcare, and education
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](https://www.aamc.org/about-us/mission-areas/medical-education/principles-ai-use)
### 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
* [Attention High level overview video](https://www.youtube.com/watch?v=fjJOgb-E41w)
* [Attention Is All You Need Arxiv Paper](https://arxiv.org/abs/1706.03762)
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](https://learn.microsoft.com/en-us/windows/wsl/install)
* Mac users can use [Homebrew](https://brew.sh/)
* 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.
* [Huggingface](https://docs.google.com/presentation/d/1IkzESdOwdmwvPxIELYJi8--K3EZ98_cL6c5ZcLKSyVg/edit#slide=id.p)
### 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.
What a Dual-License Means
### Protection for Vulnerable Populations
The dual licensing aims to address the cybersecurity gap that disproportionately affects underserved populations. As
highlighted by recent attacks\[1], low-income residents, seniors, and foreign language
speakers face higher-than-average risks of being victims of cyberattacks. By offering both open-source and
commercial licensing options, we encourage the development of cybersecurity solutions that can reach these
vulnerable groups while also enabling sustainable development and support.
### Preventing Malicious Use
The AGPL-3.0 license ensures that any modifications to the software remain open source, preventing bad actors from
creating closed-source variants that could be used for exploitation. This is especially crucial given the rising
threats to vulnerable communities, including children in educational settings. The attack on Minneapolis Public
Schools, which resulted in the leak of 300,000 files and a $1 million ransom demand, highlights the importance of
transparency and security\[8].
### Addressing Cybersecurity in Critical Sectors
The commercial license option allows for tailored solutions in critical sectors such as healthcare, which has seen
significant impacts from cyberattacks. For example, the recent Change Healthcare attack\[4] affected millions of Americans and caused widespread disruption for hospitals and
other providers. In January 2025, CISA\[2] and FDA\[3]
jointly warned of critical backdoor vulnerabilities in Contec CMS8000 patient monitors, revealing how medical
devices could be compromised for unauthorized remote access and patient data manipulation.
### Supporting Cybersecurity Awareness
The dual licensing model supports initiatives like the Cybersecurity and Infrastructure Security Agency (CISA)
efforts to improve cybersecurity awareness\[7] in "target rich" sectors, including
K-12 education\[5]. By allowing both open-source and commercial use, we aim to
facilitate the development of tools that support these critical awareness and protection efforts.
### Bridging the Digital Divide
The unfortunate reality is that too many individuals and organizations have gone into a frenzy in every facet of our
daily lives\[6]. These unfortunate folks identify themselves with their talk of "10X"
returns and building towards Artificial General Intelligence aka "AGI" while offering GPT wrappers. Our dual
licensing approach aims to acknowledge this deeply concerning predatory paradigm with clear eyes while still
operating to bring the best parts of the open-source community with our services and solutions.
### Recent Cybersecurity Attacks
Recent attacks underscore the importance of robust cybersecurity measures:
* The Change Healthcare cyberattack in February 2024 affected millions of Americans and caused significant
disruption to healthcare providers.
* The White House and Congress jointly designated October 2024 as Cybersecurity Awareness Month. This designation
comes with over 100 actions that align the Federal government and public/private sector partners are taking to help
every man, woman, and child to safely navigate the age of AI.
By offering both open source and commercial licensing options, we strive to create a balance that promotes
innovation and accessibility. We address the complex cybersecurity challenges faced by vulnerable populations and
critical infrastructure sectors as the foundation of our solutions, not an afterthought.
### References
[1] International
Counter Ransomware Initiative 2024 Joint Statement
[2] Contec
CMS8000 Contains a Backdoor
[3] CISA,
FDA warn of vulnerabilities in Contec patient monitors
[4] The
Top 10 Health Data Breaches of the First Half of 2024
[5] CISA's K-12 Cybersecurity
Initiatives
[7] A
Proclamation on Cybersecurity Awareness Month, 2024
[8] Minneapolis school
district says data breach affected more than 100,000 people