A modular framework for training, evaluating, and deploying custom LLM agents using LoRA / QLoRA across CUDA, macOS (MPS), and CPU environments.
This project enables you to:
-
Fine-tune open-source LLMs (Gemma-based)
-
Run local inference with or without adapters
-
Support multiple environments:
- NVIDIA CUDA (recommended)
- Apple Silicon (MPS)
- CPU fallback
-
Export models to GGUF (llama.cpp / edge deployment)
ironsquishy.ai/
โโโ Makefile # Primary workflow commands
โโโ Dockerfile # Containerized environment
โโโ configs/ # Base + environment configs
โโโ scripts/ # Training, inference, evaluation
โโโ utils/ # Shared runtime + helpers
โโโ data/ # Raw + processed datasets
โโโ prompts/ # System prompts
โโโ adapters/ # LoRA adapters
โโโ requirements*.txt
python -m venv .venv
source .venv/bin/activate
pip install -U pippip install -r requirements.txt
pip install -r requirements-cuda.txt
make doctor
Use this before running anything.
make helpmake base-infer DEVICE=mps PROMPT="Explain caching"make prepare-data
make train DEVICE=cuda
make infer DEVICE=cuda PROMPT="How do I design a scalable API?"make eval DEVICE=cudamake merge
make exportConfigs use inheritance.
configs/base/training.yaml
configs/base/inference.yaml
configs/training/cuda.yaml
configs/training/mps.yaml
configs/training/cpu.yaml
configs/inference/cuda.yaml
configs/inference/mps.yaml
configs/inference/cpu.yaml
make base-infer DEVICE=cpu PROMPT="What is caching?"- Adapter mismatch โ retrain
- CUDA missing โ install toolkit
- Mac slow โ expected (no 4-bit)
- NaN outputs โ disable sampling
Docker provides a reproducible environment and avoids dependency issues.
DEVICE=cpu PROMPT=Explain caching in distributed systems BASE_MODEL=google/gemma-4-E2B-it TRANSFORMERS_CACHE=/app/.cache
docker build -t ironsquishy-ai .docker run --rm -it \
--env-file .env \
-v "$(pwd):/app" \
ironsquishy-ai \
make doctordocker run --rm -it \
--env-file .env \
-v "$(pwd):/app" \
ironsquishy-ai \
make inferdocker run --rm -it \
--env-file .env \
-v "$(pwd):/app" \
ironsquishy-ai \
make traindocker run --rm -it \ --env-file .env \ -e DEVICE=cuda \ -v "$(pwd):/app" \ ironsquishy-ai \ make infer PROMPT="Explain vector databases"
.envis passed via--env-file-v $(pwd):/appmounts your project (no rebuild needed)- Use CUDA Docker separately if needed (
--gpus all)
1. make doctor
2. make base-infer
3. make prepare-data
4. make train DEVICE=cuda
5. make infer DEVICE=cuda
6. make eval
7. make merge
8. make export
- Adapter must match base model
- Prompt format must match training
- CUDA required for real training
- Mac is for debugging only
- GGUF optimization
- OpenClaw integration
- Multi-model support
Allen Space Project: ironsquishy.ai