Skip to content

qompassai/svg

Repository files navigation

Qompass AI on Scalable Vector Graphics (SVG)

An XML-based markup language for 2D Graphics

Repository Views GitHub all releases SVG Standard
SVG Documentation SVG Tutorials
License: AGPL v3 License: Q-CDA

SVG logo SVG Solutions
SVG Asset Preview Download
Qompass Monero QR-Code Download
Attention Mechanism Download
▶️ Qompass AI Quick Start
curl -L https://raw.githubusercontent.com/qompassai/svg/main/scripts/quickstart.sh
📄 We advise you read the script BEFORE running it 😉
#!/bin/sh
# /qompassai/svg/scripts/quickstart.sh
# Qompass AI · SVG Quickstart
# Copyright (C) 2025 Qompass AI
######################################
set -eu
IFS=' 	
'
LOCAL_PREFIX="$HOME/.local"
BIN_DIR="$LOCAL_PREFIX/bin"
CONFIG_DIR="$HOME/.config/svg"
DATA_DIR="$HOME/.local/share/svg"
mkdir -p "$BIN_DIR" "$CONFIG_DIR" "$DATA_DIR"
export PATH="$BIN_DIR:$PATH"
detect_platform() {
        OS="unknown"
        ARCH="unknown"
        uname_s=$(uname -s)
        uname_m=$(uname -m)
        case "$uname_s" in
        Linux*) OS="linux" ;;
        Darwin*) OS="macos" ;;
        CYGWIN* | MINGW* | MSYS*) OS="windows" ;;
        esac
        case "$uname_m" in
        x86_64 | amd64) ARCH="x86_64" ;;
        aarch64 | arm64) ARCH="aarch64" ;;
        *) ARCH="$uname_m" ;;
        esac
}
add_path_to_shell_rc() {
        rcfile=$1
        path_line="export PATH=\"$BIN_DIR:\$PATH\""
        if [ -f "$rcfile" ] && ! grep -Fq "$path_line" "$rcfile"; then
                printf '\n# Added by Qompass AI SVG quickstart\n%s\n' "$path_line" >>"$rcfile"
                echo " → Added PATH to $rcfile"
        fi
}
userspace_install() {
        tool="$1"
        recommend="$2"
        fallback="$3"
        prompt_msg="$tool is missing and userspace install will be attempted."
        printf "\n⚠ $prompt_msg\nMethod: %s\nProceed? [Y/n]: " "$recommend"
        read -r resp
        resp=${resp:-Y}
        case "$resp" in
        Y | y)
                echo "[info] Installing $tool..."
                eval "$recommend" || {
                        echo "[warn] Failed userspace install. $fallback"
                }
                ;;
        *)
                echo "[info] Skipped $tool."
                ;;
        esac
}
check_tools() {
        detect_platform
        echo "Checking SVG utilities for $OS ($ARCH)"
        NPM_GLOBAL="$LOCAL_PREFIX/npm-global"
        mkdir -p "$NPM_GLOBAL/bin"
        ensure_tool() {
                tool="$1"
                npm_package="$2"
                download_msg="$3"
                if ! command -v "$tool" >/dev/null 2>&1; then
                        if command -v npm >/dev/null 2>&1; then
                                userspace_install "$tool" "npm install -g $npm_package --prefix=\"$NPM_GLOBAL\"" "$download_msg"
                                export PATH="$NPM_GLOBAL/bin:$PATH"
                                if [ -x "$NPM_GLOBAL/bin/$tool" ]; then
                                        ln -sf "$NPM_GLOBAL/bin/$tool" "$BIN_DIR/$tool"
                                fi
                        else
                                echo "❗ $tool missing and npm is not in your PATH."
                                echo "   $download_msg"
                        fi
                fi
        }
        ensure_tool "svgo" "@svgo/cli" "See https://github.com/svg/svgo or install via npm globally after you have npm."
        ensure_tool "mjcli" "mathjax-node-cli" "See https://github.com/mathjax/mathjax-node-cli or install with npm when available."
        if ! command -v inkscape >/dev/null 2>&1; then
                case "$OS" in
                linux)
                        printf "\nInkscape missing. Download AppImage from https://inkscape.org/release/ or install via flatpak:\n  flatpak install org.inkscape.Inkscape\nProceed to download manually and re-run? [Y/n]: "
                        read -r resp
                        :
                        ;;
                macos)
                        printf "\nInkscape missing. Download from https://inkscape.org/release/mac-os-x/ or install via brew:\n  brew install --cask inkscape\nProceed to download manually and re-run? [Y/n]: "
                        read -r resp
                        :
                        ;;
                windows)
                        echo "Inkscape missing. Get the Windows installer from https://inkscape.org/ and add it to your PATH."
                        ;;
                esac
        fi
        if ! command -v potrace >/dev/null 2>&1; then
                printf "\nPotrace missing. To install userspace binary, see https://potrace.sourceforge.net/download.html (or use system package manager if comfortable).\n"
        fi
        # rsvg-convert: SVG rasterizer
        if ! command -v rsvg-convert >/dev/null 2>&1; then
                printf "\nLibRSVG/rsvg-convert missing (for SVG to PNG or ASCII previews).\n"
                case "$OS" in
                linux) echo "Try: flatpak install org.gnome.Librsvg or install via package manager." ;;
                macos) echo "Try: brew install librsvg" ;;
                windows) echo "Not easily available on Windows as CLI. View SVG in browser instead." ;;
                esac
        fi
        if ! command -v img2txt >/dev/null 2>&1; then
                printf "\nimg2txt (ASCII preview) missing. For Linux/macOS, install libcaca/caca-utils if desired. Not required.\n"
        fi
        echo "✅ SVG user toolchain checks finished."
}
main_menu() {
        printf '\n'
        printf '╭────────────────────────────────────────────╮\n'
        printf '│        Qompass AI · SVG Quick‑Start        │\n'
        printf '╰────────────────────────────────────────────╯\n'
        printf '\nSelect an option:\n'
        printf ' 1) Install/check SVG tools for your system (all userspace)\n'
        printf ' 2) Convert LaTeX to SVG (LaTeX → SVG math with mjcli)\n'
        printf ' 3) Preview an SVG in terminal as ASCII (if tools installed)\n'
        printf ' a) Run all setup steps & suggest PATH updates\n'
        printf ' q) Quit\n\n'
        printf 'Your choice [1]: '
        read -r choice
        choice=${choice:-1}
        case "$choice" in
        1)
                check_tools
                ;;
        2)
                if ! command -v mjcli >/dev/null 2>&1; then
                        userspace_install "mjcli" "npm install -g mathjax-node-cli --prefix=\"$LOCAL_PREFIX/npm-global\"" "See https://github.com/mathjax/mathjax-node-cli"
                        export PATH="$LOCAL_PREFIX/npm-global/bin:$PATH"
                        [ -x "$LOCAL_PREFIX/npm-global/bin/mjcli" ] && ln -sf "$LOCAL_PREFIX/npm-global/bin/mjcli" "$BIN_DIR/mjcli"
                fi
                printf "\nEnter a LaTeX math expression (one line): "
                read -r eqn
                echo "$eqn" | mjcli --svg --math "$(cat)" >"$DATA_DIR/formula.svg"
                echo "→ Saved SVG to $DATA_DIR/formula.svg"
                ;;
        3)
                printf "Enter SVG file path to preview: "
                read -r svgfile
                if [ -f "$svgfile" ] && command -v rsvg-convert >/dev/null 2>&1 && command -v img2txt >/dev/null 2>&1; then
                        rsvg-convert -h 20 "$svgfile" | img2txt -
                else
                        echo "Required tools (rsvg-convert and/or img2txt) not installed or file missing."
                fi
                ;;
        a | A)
                check_tools
                add_path_to_shell_rc "$HOME/.bashrc"
                add_path_to_shell_rc "$HOME/.zshrc"
                add_path_to_shell_rc "$HOME/.profile"
                echo "→ Userspace PATHs suggested. Open a new shell or source your rc file."
                ;;
        q | Q)
                echo "Goodbye!"
                exit 0
                ;;
        *)
                echo "❌ Invalid option."
                main_menu
                ;;
        esac
}
main() {
        main_menu
}
main "$@"
exit 0

Or, View the quickstart script.

🧭 About Qompass AI

Matthew A. Porter
Former Intelligence Officer
Educator & Learner
DeepTech Founder & CEO

Publications

ORCID ResearchGate Zenodo

Developer Programs

NVIDIA Developer Meta Developer HackerOne HuggingFace Epic Games Developer

Professional Profiles

Personal LinkedIn Startup LinkedIn

Social Media

X/Twitter Instagram Qompass AI YouTube

🔥 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

GitHub Sponsors Patreon Liberapay Open Collective Buy Me A Coffee

🔐 Cryptocurrency Donations

Monero (XMR):

Monero QR Code
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

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.

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