Installation Guide

Prerequisites

  • Python 3.8 or higher
  • pip or conda

Installation Options

Option 1: CPU-Only (Minimal)

For development or CPU-only inference:

1
pip install slm-builder

This installs the base dependencies without heavy ML libraries.

For training and GPU support:

1
pip install slm-builder[full]

This includes:

  • PyTorch
  • Transformers
  • PEFT (for LoRA)
  • Accelerate
  • ONNX Runtime
  • All training dependencies

Option 3: Development Installation

For contributing to the project:

1
2
3
git clone https://github.com/isathish/slm.git
cd slm
pip install -e ".[full,dev]"

This installs in editable mode with development tools (pytest, black, flake8, etc.)

Verifying Installation

1
python -c "import slm_builder; print(slm_builder.__version__)"

Or test the CLI:

1
slm --version

Optional Dependencies

For GPU Training

If you have NVIDIA GPU:

1
2
3
4
5
# Install PyTorch with CUDA support first
pip install torch --index-url https://download.pytorch.org/whl/cu118

# Then install SLM Builder
pip install slm-builder[full]

For HTML Scraping

1
pip install beautifulsoup4

For Database Connectors

1
2
3
4
5
# PostgreSQL
pip install psycopg2-binary

# MongoDB
pip install pymongo

Troubleshooting

Issue: transformers not found

Solution: Install full version:

1
pip install slm-builder[full]

Issue: CUDA out of memory

Solution: Use CPU or reduce batch size:

1
slm build --source data.csv --device cpu

Or in config:

1
2
training:
  batch_size: 4  # Reduce from default 8

Issue: peft not available

Solution: Install full version with PEFT:

1
pip install slm-builder[full]

Platform-Specific Notes

macOS

1
2
# For M1/M2 Macs, use MPS acceleration
pip install slm-builder[full]

SLM Builder will automatically detect and use MPS when available.

Windows

1
pip install slm-builder[full]

For best performance on Windows, use WSL2 with Ubuntu.

Linux

1
2
# Standard installation works well
pip install slm-builder[full]

Docker Installation

1
2
3
4
5
# CPU version
docker pull slmbuilder/slm-builder:latest

# GPU version (requires nvidia-docker)
docker pull slmbuilder/slm-builder:gpu

Next Steps

After installation, check out:


Back to top

Copyright © 2025 SLM Builder. Distributed under the MIT License.