The Problem

Fine-tuning large language models typically demands significant engineering overhead: managing GPU memory, writing training loops, and configuring hyperparameters across disparate tools. For teams constrained by hardware, running an 8B parameter model is often infeasible without cloud infrastructure.

What This Does

Soup abstracts the training pipeline into a single YAML-driven workflow. Its distinguishing feature is layer streaming, which decouples the frozen base model from VRAM, streaming decoder layers to the GPU incrementally. As documented in docs/performance-and-quantization.md, this approach measured Llama-3.1-8B-Instruct at 119.6 tok/s with a 3.32 GB peak on an RTX 3050 Laptop 4 GB, matching resident performance. The configuration flag stream_layers: true opt-in enables this, though it remains marked BETA in the codebase. The benchmarks/ directory contains the measurement harness and gate files (e.g., gate-v0.72.2-nf4.md) that validate these claims across hardware.

How It Is Wired

Execution originates at the CLI entry point src/soup_cli/cli.py. The command soup train triggers config loading, likely from pyproject.toml or an inline YAML specification. The training orchestration resides within the src/soup_cli/commands/ directory. The layer streaming mechanism interfaces with the Transformers framework (indicated by the Transformers dependency) to manage the layer-by-layer GPU transfer, keeping the base model weights resident on disk or system RAM until needed. The repository uses Docker (Dockerfile, docker-compose.yml) for environment consistency and GitHub Actions (/.github/workflows/) for CI/CD, including dependency drift checks.

How To Use It

# Install with training extras
pip install "soup-cli[train]"

# Initialize a chat template config
soup init --template chat

# Start training
soup train

Configuration is driven by YAML files located in examples/configs/ (e.g., sft_basic.yaml). The pyproject.toml at the root declares project dependencies; no lockfile is present, which the heuristic analysis flags as a reproducibility risk.

Real-World Use

A practical scenario involves fine-tuning a code-assistant model on a developer's laptop. Using the sft_basic.yaml config from examples/configs/, a user can initiate soup train to perform SFT without provisioning a cloud GPU. The layer streaming feature allows the 8B model to train within the 4 GB VRAM limit, making it viable for local iterative development.

Code Health & Issues

The heuristic analysis identified one measured finding: [Low/Risk] Dependencies declared without a lockfile - non-reproducible builds - pyproject.toml. Beyond this, the structure supports a mature SDLC: 428 test files in tests/, 81 doc files, and active CI pipelines (/.github/workflows/ci.yml, /.github/workflows/dependency-drift.yml). The Apache-2.0 license is present in LICENSE.

The Bottom Line

Soup is a practical tool for resource-constrained LLM fine-tuning, with layer streaming as its technical differentiator enabling 8B model training on 4 GB GPUs. The primary risk is the absence of a lockfile, which introduces reproducibility concerns for dependency versions. It is well-suited for researchers or engineers needing to fine-tune on local hardware without cloud dependencies.

Clone: https://github.com/moses-y/Soup