AISBFAI Service Broker Framework — AI Should Be Free
A complete installation tutorial for AISBF: service user, Python environment, MySQL, Redis, systemd, nginx, TLS edge, and first verification calls.
This install puts AISBF behind a TLS edge and keeps AISBF itself on localhost or a private network. AISBF becomes the one API your apps call; provider keys, rotations, autoselect rules, dashboard users, and cluster state live behind it.
sudo apt update
sudo apt install -y python3 python3-venv python3-pip git redis-server mysql-server nginx
sudo useradd --system --home /opt/aisbf --shell /usr/sbin/nologin aisbf || true
sudo mkdir -p /opt/aisbf /etc/aisbf /var/lib/aisbf
sudo chown -R aisbf:aisbf /opt/aisbf /etc/aisbf /var/lib/aisbf
sudo -u aisbf git clone https://git.nexlab.net/nexlab/aisbf /opt/aisbf/app
sudo -u aisbf python3 -m venv /opt/aisbf/venv
sudo -u aisbf /opt/aisbf/venv/bin/pip install -U pip
sudo -u aisbf /opt/aisbf/venv/bin/pip install -e /opt/aisbf/app
sudo cp /opt/aisbf/app/config/*.json /etc/aisbf/
sudo chown -R aisbf:aisbf /etc/aisbfsudo mysql <<'SQL'
CREATE DATABASE IF NOT EXISTS aisbf CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS 'aisbf'@'localhost' IDENTIFIED BY 'change-this-password';
GRANT ALL PRIVILEGES ON aisbf.* TO 'aisbf'@'localhost';
FLUSH PRIVILEGES;
SQL{"database":{"type":"mysql","mysql_host":"localhost","mysql_port":3306,"mysql_user":"aisbf","mysql_password":"change-this-password","mysql_database":"aisbf"},"cache":{"type":"redis","redis_host":"localhost","redis_port":6379,"redis_db":0,"redis_key_prefix":"aisbf:prod:"},"auth":{"enabled":true,"tokens":["global-admin-token-only-for-admin-scripts"]}}[Unit]
Description=AISBF API Gateway
After=network-online.target mysql.service redis-server.service
Wants=network-online.target
[Service]
User=aisbf
Group=aisbf
WorkingDirectory=/opt/aisbf/app
Environment=AISBF_CONFIG_DIR=/etc/aisbf
ExecStart=/opt/aisbf/venv/bin/uvicorn main:app --host 127.0.0.1 --port 17765
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.targetlocation / {
proxy_pass http://127.0.0.1:17765;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
}curl -fsS https://aisbf.example.com/health
curl -fsS https://aisbf.example.com/api/v1/models -H "Authorization: Bearer $AISBF_API_TOKEN"AISBF is open source and also available as a hosted service. During the current testing period, hosted Pro is temporarily available as unlimited access for €2/month.