Getting Started
Installation
As of v0.71.0 the install is split. pip install soup-cli is a light, PyTorch-free CLI + data-tools install — soup init, soup data …, and the inspection commands all work on it. To fine-tune, add the [train] extra:
# Light core: CLI + config + data tools, no PyTorch
pip install soup-cli
# Add the training stack (torch, transformers, peft, trl, datasets, …)
pip install "soup-cli[train]"
# Everything (train + serve + ui + data + mcp) in one shot
pip install "soup-cli[all]"
# Or from GitHub (latest dev)
pip install git+https://github.com/MakazhanAlpamys/Soup.gitUpgrading from ≤ v0.70?
pip install soup-clino longer pulls PyTorch. If you train, reinstall withpip install "soup-cli[train]"— a missing heavy dependency now surfaces a friendly *"Training needs the [train] extra"* message instead of anImportError.
Requirements
Default: resident QLoRA
On Debian 12, Ubuntu 23.04 or anything newer, plain
pip installfails outside a virtualenv, and it is not a Soup problem:
>
```text
error: externally-managed-environment
```
>
Those distributions ship an
EXTERNALLY-MANAGEDmarker in the system Python, so pip refuses to write into asite-packagesthataptalso manages (PEP 668). It is the default on current Debian and Ubuntu, so it is the ordinary first-run experience there rather than an edge case, and nothing in Soup can rescue it: the package is not installed yet when the command runs.
>
Soup declares a
soupconsole script, which makes it an application rather than a library, so upstream's README now leads withpipx:
>
```bash
pipx install soup-cli # or: uv tool install soup-cli
pipx install "soup-cli[train]" # extras spelled exactly as below
```
>
Both give Soup its own virtualenv and put the command on
PATH, which is outside PEP 668's scope entirely. Everypipline on this page stays correct inside a virtualenv, a Colab notebook or a Docker image, andpython3 -m venv .venvthen plainpipworks just as well. Usepiprather thanpipxif you also want toimport soup_clifrom your own code, because pipx isolation is the wrong shape for that.
- Python 3.10 to 3.12 (the floor was raised from 3.9 in v0.71.0; v0.73.0 added the upper bound, because on 3.13 and above pip resolved untested PyTorch wheels that crash inside the native extension before Soup runs)
- The
[train]stack, as of v0.75.0:torch>=2.6.0,transformers>=5.16.1,<6.0.0,trl>=0.29.0,<1.0.0,peft>=0.20.0,<1.0.0,accelerate>=0.27.0. A fresh install resolves all of that for you. One consequence worth knowing:pip install "soup-cli[train,mlx]"resolves for the first time in v0.74.0, because the two extras previously declaredtransformersranges that could not be satisfied together at all - CUDA-compatible GPU (recommended); Apple Silicon (MPS) or CPU (experimental) also work
- 8 GB+ VRAM for 7B models with QLoRA
The torch floor moved to 2.6.0 in v0.75.0, and that closed a real trap. v0.74.0 declared
torch>=2.5.0whiletrl>=0.29could not import at 2.5.1 at all, because it needs the public FSDP2 API that arrives in 2.6.0, so a pinned 2.5.x environment silently lost DPO, KTO, GRPO and BCO. pip could not catch it, sincetrldeclares no torch dependency. v0.74.0 published the hole rather than guessing at a fix, because 2.5.1 was measured to fail and 2.6 had not been measured to work; v0.75.0 raised the floor and proved it in CI. If you pin torch yourself, pin 2.6.0 or newer.
If the model does not fit: layer streaming (opt-in, BETA)
- Set
training.stream_layers: trueinsoup.yamland the frozen base never loads into VRAM: Llama-3.1-8B fine-tunes in 3.32 GB on a 4 GB card. Slower than resident training, so leave it off for a model that already fits. See Layer Streaming.
Streaming bounds the decoder stack to one layer at a time. Embeddings and the logits tensor stay resident, so peak VRAM still depends on the model, just much less.
Optional Extras
pip install "soup-cli[train]" # Training stack: torch, transformers, peft, trl, …
pip install "soup-cli[fast]" # Unsloth 2-5x training speedup
pip install "soup-cli[mlx]" # Apple Silicon backend (M1–M4)
pip install "soup-cli[serve]" # FastAPI inference server
pip install "soup-cli[serve-fast]" # vLLM backend
pip install "soup-cli[sglang]" # SGLang backend
pip install "soup-cli[eval]" # lm-evaluation-harness
pip install "soup-cli[data]" # MinHash dedup + semantic split (scikit-learn)
pip install "soup-cli[data-pro]" # langdetect + Presidio PII
pip install "soup-cli[vision]" # Pillow for vision fine-tuning
pip install "soup-cli[audio]" # librosa + soundfile
pip install "soup-cli[qat]" # Quantization-aware training
pip install "soup-cli[liger]" # Liger Kernel fused ops
pip install "soup-cli[onnx]" # ONNX export
pip install "soup-cli[tensorrt]" # TensorRT-LLM export
pip install "soup-cli[awq]" # AWQ quantized export
pip install "soup-cli[gptq]" # GPTQ quantized export (a separate extra)
pip install "soup-cli[ui]" # Web UI dashboard
pip install "soup-cli[tui]" # Full-screen Textual dashboard
pip install "soup-cli[trackers]" # MLflow / SwanLab / Trackio logging
pip install "soup-cli[wandb]" # Weights & Biases, for soup train --wandb
pip install "soup-cli[generate]" # httpx, for soup data generate provider calls
pip install "soup-cli[deepspeed]" # ZeRO distributed training
pip install "soup-cli[ring-attn]" # Ring FlashAttention
pip install "soup-cli[remote]" # Remote datasets (s3 / gs / az / oci)
pip install "soup-cli[sign]" # ed25519 adapter / attestation signing
pip install "soup-cli[compile]" # DSPy / GEPA / TextGrad prompt compiler
pip install "soup-cli[carbon]" # codecarbon energy / CO2 tracking
pip install "soup-cli[modal]" # Serverless cloud GPU (soup train --cloud modal; --cloud lambda needs no extra)
pip install "soup-cli[aider]" # Aider CLI, for soup eval aider (v0.74.0)
pip install "soup-cli[mcp]" # MCP server (soup mcp serve) for coding agents
pip install "soup-cli[cce]" # Cut Cross-Entropy (training.use_cut_ce)
pip install "soup-cli[mix]" # scikit-optimize, for soup data mix --optimize
pip install "soup-cli[pdf]" # reportlab, for the EU AI Act Annex XI/XII PDFs
pip install "soup-cli[dev]" # the test and lint stack, for contributing
pip install "soup-cli[all]" # shorthand for train + serve + ui + data + mcpUse double quotes, and here is why
pip install "soup-cli[train]" is the only spelling that works in every shell: cmd.exe, PowerShell, bash and zsh. Every command above uses it.
Older tutorials and videos, including some of ours, show the single-quoted pip install 'soup-cli[train]'. That is bash, zsh and PowerShell syntax. Windows cmd.exe has no single-quote quoting, so it hands the quotes straight to pip:
ERROR: Invalid requirement: "'soup-cli[train]'": Expected package name at the start of dependency specifierIf you hit that, swap the ' for ". Nothing is wrong with the package: pip is rejecting a literal quote character. Dropping the quotes entirely also works on Windows, but then zsh reads [train] as a glob and fails instead.
Quick Start
1. Create a config
# Interactive wizard
soup init
# Or use a template
soup init --template chat2. Train
soup train --config soup.yamlSoup automatically detects your GPU, sets optimal batch size, configures LoRA, and begins training.
3. Chat with your model
soup chat --model ./output4. Push to HuggingFace
soup push --model ./output --repo your-username/my-model5. Export and serve
# Export to GGUF for Ollama / llama.cpp
soup export --model ./output --format gguf --quant q4_k_m
# Start OpenAI-compatible server
soup serve --model ./output --port 8000Health Check
Check your environment for compatibility issues:
soup doctorShows Python version, GPU availability, all dependency versions, and fix suggestions.
Quick Demo
Run a complete demo in one command:
soup quickstart # Creates sample data + config + trains TinyLlama
soup quickstart --dry-run # Just create files without trainingSoup is free and Apache-2.0. If it saved you a training run, starring the repo costs nothing and helps most. You can also fund the GPU time behind the work a 4 GB laptop cannot reach.