TabbyAPI (EXL2 backend) requires flash-attention 2.5.7+ which is challenging to build on NVIDIA Blackwell GPUs. This guide provides two approaches.
- Working venv with flash-attn 2.8.3+ (pre-built recommended)
- exllamav2 0.3.2+
- Python 3.10-3.12
- NVIDIA GPU with 40GB+ VRAM for 70B models
If you have access to a working TabbyAPI installation with flash-attn already built:
# On working server - create tarball
cd /opt
tar -czf tabbyapi-venv.tar.gz TabbyAPI/venv/
# Transfer to new server
scp tabbyapi-venv.tar.gz user@newserver:/tmp/
# On new server - extract
cd /opt/TabbyAPI
tar -xzf /tmp/tabbyapi-venv.tar.gz
# CRITICAL: Make python executable
chmod +x venv/bin/python*
# Verify
venv/bin/python --version
venv/bin/python -c "import flash_attn; print(flash_attn.__version__)"cd ~
git clone https://github.com/theroyallab/tabbyAPI TabbyAPI
cd TabbyAPI
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtNote: Building flash-attn on Blackwell GPUs may fail. Try prebuilt wheel first:
# Try prebuilt wheel
pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu124torch2.5cxx11abiFALSE-cp312-cp312-linux_x86_64.whl
# OR build from source (use compute_89,90 workaround)
export TORCH_CUDA_ARCH_LIST="8.9;9.0"
MAX_JOBS=4 pip install flash-attn==2.8.3 --no-build-isolationIf build fails, you MUST use Method 1 (copy working venv).
cd /opt/TabbyAPI
cat > config.yml << 'YAML_EOF'
developer:
backend: exllamav2
unsafe_launch: false
logging:
log_generation_params: false
log_prompt: false
log_requests: false
model:
cache_mode: FP16
cache_size: 32768
chunk_size: 4096
gpu_split_auto: true
max_batch_size: 1
max_seq_len: 32768
model_dir: /opt/models
model_name: exl2/YourModelName
tensor_parallel: false
network:
api_servers:
- OAI
disable_auth: true
host: 0.0.0.0
port: 5000
YAML_EOFCRITICAL: Use model_dir (parent directory) + model_name (subdirectory) format!
# TabbyAPI will auto-generate keys on first start
# Just create empty file
echo "" > api_tokens.ymlAfter first start, TabbyAPI will populate with:
admin_key: <generated-key>
api_key: <generated-key>sudo tee /etc/systemd/system/tabbyapi.service > /dev/null << 'SERVICE_EOF'
[Unit]
Description=TabbyAPI Server - EXL2 Backend
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/TabbyAPI
ExecStart=/opt/TabbyAPI/venv/bin/python main.py
Restart=no
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
SERVICE_EOF
sudo systemctl daemon-reload# Start TabbyAPI
sudo systemctl start tabbyapi.service
# Wait 60-90 seconds for model to load
sleep 90
# Check GPU usage (should show ~40-50GB for 70B models)
nvidia-smi
# Test health endpoint
curl http://localhost:5000/health
# Check API keys in logs
sudo journalctl -u tabbyapi.service | grep "admin key"The router automatically:
- Reads
api_tokens.ymlfor health checks - Updates
model_namein config.yml when switching models - Restarts tabbyapi.service via systemd
No manual configuration needed!
# Check logs
sudo journalctl -u tabbyapi.service -n 100
# Common issues:
# - Wrong model path (must be model_dir + model_name)
# - Missing flash-attn
# - Insufficient GPU memory# Check CUDA version
nvcc --version # Need 12.4+
# Check if flash-attn installed
/opt/TabbyAPI/venv/bin/python -c "import flash_attn; print(flash_attn.__version__)"
# If missing, use Method 1 (copy working venv)# Ensure both keys exist in api_tokens.yml
cat /opt/TabbyAPI/api_tokens.yml
# Should have:
# admin_key: xxx
# api_key: xxx
# If missing, delete and restart to regenerate
rm /opt/TabbyAPI/api_tokens.yml
sudo systemctl restart tabbyapi.serviceTabbyAPI expects:
model_dir:/opt/modelsmodel_name:exl2/ModelName
Combined path: /opt/models/exl2/ModelName
The router config uses just the subdirectory path:
{
"model_path": "exl2/ModelName"
}Router automatically updates model_name field in config.yml when switching.
Version: 4.0.0
Status: Tested on Blackwell GPUs ✅