Skip to content

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:

bash
# 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: the main branch, which runs ahead of the latest release and carries changes that are not in any tag
pip install git+https://github.com/MakazhanAlpamys/Soup.git

Soup needs Python 3.11 to 3.13; Requirements has the rest. Upgrading a working setup? Start at Upgrading an existing install.

On Debian 12, Ubuntu 23.04 or anything newer, plain pip install fails outside a virtualenv with error: externally-managed-environment, and it is not a Soup problem.

Those distributions ship an EXTERNALLY-MANAGED marker in the system Python, so pip refuses to write into a site-packages that apt also 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 soup console script, which makes it an application rather than a library, so upstream's README now leads with pipx:

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. Every pip line on this page stays correct inside a virtualenv, a Colab notebook or a Docker image, and python3 -m venv .venv then plain pip works just as well. Use pip rather than pipx if you also want to import soup_cli from your own code, because pipx isolation is the wrong shape for that.

Quick Start

1. Create a config

bash
# Interactive wizard
soup init

# Or use a template
soup init --template chat

2. Train

bash
soup train --config soup.yaml

Soup automatically detects your GPU, sets optimal batch size, configures LoRA, and begins training. It asks Start training? first; in a script or CI job pass --yes, because since v0.77.0 it exits 3 when standard input is a pipe or a redirected file and --yes is not given.

3. Chat with your model

bash
soup chat --model ./output

4. Push to HuggingFace

bash
soup push --model ./output --repo your-username/my-model

5. Export and serve

bash
# 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 8000

Health Check

Check your environment for compatibility issues:

bash
soup doctor
soup doctor --config soup.yaml     # also load a config under the current rules; exit 2 if it cannot load

Shows Python version, GPU availability, all dependency versions, and fix suggestions. Since v0.76.0 it also prints, for each NVIDIA GPU, its compute capability and architecture (for example sm_89 (Ada)), says in red when the installed PyTorch build contains no code for that architecture and prints a reinstall hint matched to your driver, and adds a "Precision features" block for BF16, FP8 and NVFP4 (whether the hardware and the software path support each). On Apple Silicon it prints an MLX panel with the MLX version, chip and unified memory, or not installed with the [mlx] install line, and since v0.77.0 its MPS panel shows HF_DEACTIVATE_ASYNC_LOAD, which soup train sets to 1 on MPS (for the transformers backend; see Environment variables). When the header of nvidia-smi cannot be read it gives no PyTorch index URL at all, rather than guessing one. A transformers, peft or trl at its next major version (6, 1 and 1) makes soup doctor exit 1, as does a missing core dependency. A core dependency below its floor is listed as outdated with the command that upgrades it and does not change the exit code; since v0.76.1 that includes a Typer below 0.15.4, wherever soup doctor can start (below Typer 0.12.4 no command can, and 0.12.4 to 0.15.3 start only next to Click 8.1 or older).

With --config, since v0.77.0 a config that cannot be loaded stops the command before All checks passed! is printed, so that line no longer appears above a refusal; the system, GPU and dependency tables still print first.

Upgrading from v0.76 or earlier? soup doctor --config soup.yaml is the step to run first; see Upgrading from v0.76 or earlier below.

Quick Demo

Run a complete demo in one command:

bash
soup quickstart          # Writes quickstart_data.jsonl (20 examples) + quickstart_soup.yaml (TinyLlama, sft, output ./quickstart_output), then trains
soup quickstart --dry-run # Just create files without training

Requirements

Default: resident QLoRA

  • Python 3.11, 3.12 or 3.13 since v0.77.0 (requires-python = ">=3.11,<3.14"; v0.73.0 to v0.76.x declared >=3.10,<3.13, and the floor was raised from 3.9 in v0.71.0). Python 3.13 is supported; upstream's CI runs it in its nightly and release runs, not on pull requests. Python 3.10 reached end of life on 2026-10-01, and on it pip and pipx keep installing v0.76.x without an error, so check soup --version. For Python 3.10 pin pip install "soup-cli[train]<0.77"; see Upgrading from v0.76 or earlier
  • The [train] stack, as of v0.77.2 (unchanged since v0.76.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, and since v0.76.0 requests>=2.32.2. A fresh install resolves all of that for you; an environment you are upgrading may not (see the two traps under Upgrading an existing install). The core install declares typer>=0.15.4,<0.28 (the floor since v0.76.1, when it replaced >=0.9.0, which was below the working floor; the ceiling moved from <0.21.0 in v0.77.0) and click>=8.0.0,<8.5. One consequence worth knowing: pip install "soup-cli[train,mlx]" resolves for the first time in v0.74.0, because the two extras previously declared transformers ranges 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.0 while trl>=0.29 could 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, since trl declares 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.

Two install-time failures that v0.76.0 repairs, if you are on v0.75.2 or earlier. Fresh environments created after 5 October 2026 could not run task: grpo or task: online_dpo: datasets 5.1.0 stopped installing requests, which trl imports unconditionally for those two trainers. GRPO failed with RuntimeError: Failed to import trl.trainer.grpo_trainer and online DPO with installed trl 0.29.1 does not provide 'OnlineDPOConfig', each ending in No module named 'requests'. The [train] extra now declares requests>=2.32.2; on an earlier release pip install "requests>=2.32.2" fixes both, and the other trainers were not affected (#1637). Separately, on transformers 5.19.0, which the [train] range admits, every task: ppo run stopped at its first checkpoint with AttributeError: 'PPOTrainer' object has no attribute 'is_distributed_loading_by_transformers'; v0.76.0 fixes it and no other task was affected (#1682).

If the model does not fit: layer streaming (opt-in, BETA)

  • Set training.stream_layers: true in soup.yaml and the frozen base never loads into VRAM: Llama-3.1-8B fine-tunes in 3.32 GB on a 4 GB card (measured on v0.72.2; the layer streaming page has the later row and its caveats). 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.

Docker (v0.77.2)

bash
docker pull ghcr.io/makazhanalpamys/soup:0.77.2
docker run --rm --gpus all -v "$(pwd)":/workspace ghcr.io/makazhanalpamys/soup:0.77.2 \
  train --config soup.yaml --yes

Upstream's release workflow publishes an image for each release, and the release notes name it (v0.77.0 was the first to; the tag latest follows the newest release; pin the version tag so a later release does not change your image). It is Ubuntu 24.04 with Python 3.12 on NVIDIA's CUDA 12.8 runtime, and it installs exactly soup-cli[train,serve,data,eval]==0.77.2, so the [fast], [serve-fast], [sglang] and [mlx] extras are not in it. The host needs a driver that supports CUDA 12.8 (upstream says 570 or newer on GeForce). The image's entrypoint is soup and its working directory /workspace, so the words after the image name are a Soup command and the mounted directory is where soup.yaml, the data and the output live. Keep --yes: docker run without -it gives soup train a standard input that is not a terminal, and since v0.77.0 it exits 3 rather than wait at a confirmation nobody can answer. The image was not pulled for this page.

Optional Extras

bash
pip install "soup-cli[train]"      # Training stack: torch, transformers, peft, trl, …
pip install "soup-cli[fast]"       # optional Unsloth backend (its own 2-5x claim, not measured here)
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 (sglang>=0.5.1 since v0.77.0)
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 + torchaudio
pip install "soup-cli[qat]"        # torchao>=0.18.0: FP8 / NVFP4 training and soup export --format torchao
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[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-flash-attn (training.use_ring_attention is checked but not applied in v0.77.2)
pip install "soup-cli[remote]"     # Remote datasets (s3 / gs / az; oci needs ocifs, installed separately)
pip install "soup-cli[sign]"       # ed25519 adapter / attestation signing
pip install "soup-cli[sigstore]"   # Sigstore keyless signing (v0.76.0; sigstore>=4.4.0,<5.0.0; not part of [all])
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[documents]"  # pypdf + python-docx, the PDF and DOCX readers for soup data ingest (v0.77.0)
pip install "soup-cli[dev]"        # the test and lint stack, for contributing
pip install "soup-cli[all]"        # shorthand for train + serve + ui + data + mcp

That is 36 extras. [all] is only train + serve + ui + data + mcp: it does not pull [sigstore], [documents] or [wandb].

The [awq] and [gptq] extras no longer exist, and AWQ and GPTQ export were removed in v0.77.0. soup export --format awq or gptq exits 1 and names the formats that remain (gguf, onnx, tensorrt, bitnet, tq1_0, torchao, gguf-ud); --bits, --group-size and --calibration-samples are gone (exit 2, No such option); soup quantize --to awq or gptq exits 2. AWQ and GPTQ export need v0.76.x and its [awq] or [gptq] extra, for example pip install "soup-cli[awq]<0.77"; upstream notes that both projects are archived and incompatible with [train]. Model export has the detail. Training LoRA on top of an already AWQ- or GPTQ-quantized base (training.quantization: awq or gptq) is a different feature and is unchanged.

Use 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 specifier

If 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.

Upgrading an existing install

Upgrading from ≤ v0.70? pip install soup-cli no longer pulls PyTorch. If you train, reinstall with pip install "soup-cli[train]" — a missing heavy dependency now surfaces a friendly Training needs the [train] extra message instead of an ImportError.

Upgrading from v0.77.1

bash
pip install -U soup-cli            # or: pipx upgrade soup-cli
pip install -U "soup-cli[train]"   # the training stack
soup --version                     # soup v0.77.2
soup doctor --config soup.yaml     # before the first run of an existing config

v0.77.2 changes no dependency bound and no Python range (3.11 to 3.13). In upstream's upgrade notes a soup.yaml that loads on v0.77.1 loads on v0.77.2, unless it is a task: sft config with one of four settings on a path that never applied it. v0.77.2: the token rule and explicit refusals has the details; what can stop something that worked:

  • soup serve --tool-auth-token (or SOUP_TOOL_AUTH_TOKEN) must be 16 to 128 characters from A-Z, a-z, 0-9, _ and -. v0.77.1 took any non-empty value; v0.77.2 exits 2 before the model loads, on every bind, loopback included. Generate one with python -c "import secrets; print(secrets.token_urlsafe(32))".
  • task: sft refuses reasoning_effort, train_on_eot, use_flash_attn and use_liger on the paths that never applied them (vision and audio, MLX, Unsloth, RAFT, a pre-tokenized cache; which keys on which path is in the table). Leave the key out: the three booleans also load as false, and reasoning_effort loads as null. soup doctor --config soup.yaml finds it.
  • More commands refuse an output that names one of their inputs, before anything is written (exit 1): soup data ingest, persona-mix, generate, canary check, mix --optimize, forge and recipe --execute, and soup adapters arithmetic and merge. Write to a new path.
  • Exit codes moved for ten cases, among them soup plan and soup apply on malformed YAML (1 to 2), soup eval quant-check on an unparseable --tasks file (1 to 3) and soup ship --progress jsonl on Ctrl+C (1 to 130); the table is on Exit codes. A script that tests for a specific code needs a look.
  • Shell completion: run soup completions bash|zsh|fish again and replace the installed script.

On Apple Silicon, two MLX refusals are lifted (task: preference with dpo, orpo or simpo, and task: grpo on a 4-bit mlx-community base); see Settings Soup refuses at load. The Docker image for this release is ghcr.io/makazhanalpamys/soup:0.77.2.

Upgrading from v0.77.0

bash
pip install -U soup-cli            # or: pipx upgrade soup-cli
pip install -U "soup-cli[train]"   # the training stack
soup --version                     # soup v0.77.1

v0.77.1 changes no dependency bound and no Python range. Three behaviours can stop a script that worked on v0.77.0, and v0.77.1: data commands keep their input has the details:

  • A soup data command whose --output (the default name included) is the same file as one of its inputs now refuses and exits non-zero, where v0.77.0 replaced the input and exited 0. For an in-place edit, write to a new file and rename it.
  • soup plan and soup apply exit 1 on a config that soup train refuses, where v0.77.0 wrote a plan.
  • The external programs Soup starts (the upstream release notes list git, docker, ollama, nvidia-smi and the llama.cpp binaries among them) run by the absolute path found in an absolute PATH directory; the current directory and empty or relative PATH entries are not searched, and on Windows soup leaves the current directory out of the program search for itself and the programs it starts. A tool found only in the current directory needs its directory on PATH as an absolute path, or its own path. A soup adapters bisect --eval-command whose program is named in the template and is not on PATH now exits 2 before any probe.

Upgrading from v0.76 or earlier

bash
pip install -U soup-cli            # or: pipx upgrade soup-cli
pip install -U "soup-cli[train]"   # the training stack
soup --version                     # soup v0.77.2
soup doctor --config soup.yaml     # before the first run of an existing config
Warning:

A soup.yaml that loaded on v0.76 can stop loading on v0.77.0. The settings v0.76 warned about are refused now: the 31 staged fields that nothing reads, when set away from their default, data.remove_unused_columns: true, and training.quantization: 4bit or 8bit (or load_in_8bit: true) on a task that never quantizes, plus fourteen of the fifteen settings that, in upstream's list, v0.76 accepted without a word and never applied (the fifteenth, a KTO row with a malformed label, is dropped at data load with a reason). Each refusal is one line that names the setting and what to delete or change, for example training.early_stop_patience is accepted but read by nothing; refused as of v0.77. Delete the line. soup doctor --config exits 2 on it and soup train exits 1; since v0.77.1 soup plan and soup apply exit 1 on it too and write no plan. soup ab --beta is refused too (exit 2). What changed in v0.77.0 has the list and the re-run table, and Settings refused at load groups the refusals by what they touch, with the start of each message and what to change.

Warning:

On Python 3.10, pip install -U soup-cli stays on v0.76.x and says nothing. v0.77.0 needs Python 3.11 to 3.13, so check soup --version after you upgrade. If pipx built Soup's environment with Python 3.10, reinstall it on a newer interpreter: pipx install --force --python python3.12 "soup-cli[train]". To stay on the v0.76 line on purpose for Python 3.10, pin it: pip install "soup-cli[train]<0.77". AWQ and GPTQ export (removed in v0.77.0) need v0.76.x and its [awq] or [gptq] extra, for example pip install "soup-cli[awq]<0.77"; upstream notes that both projects are archived and incompatible with [train]. v0.76.x receives security fixes only, until 0.78.0 is released.

In scripts and CI jobs, pass --yes to soup train: since v0.77.0 it exits 3 when standard input is a pipe or a redirected file and --yes is not given, instead of waiting at Start training?.

Upgrading from v0.75 or earlier

bash
pip install -U soup-cli            # a fresh install with pipx: pipx install soup-cli
pip install -U "soup-cli[train]"   # the training stack
soup doctor --config soup.yaml     # before you train
Warning:

A soup.yaml that loaded on v0.75 can stop loading on v0.76.0. v0.76.0 refuses settings that were accepted and never applied (for three of them, use_longlora, ebft_variant and quantization_aware: true, applied wrongly). Run soup doctor --config soup.yaml after you upgrade and before you train.

soup doctor --config loads your config with the current rules. If something is refused it prints the error, which names the field and what to change, then Config could not be loaded (see above)., and exits 2; a missing file also exits 2 (Config not found: <path>). Unknown keys are reported together, but it stops at the first cross-field refusal, so fix that setting and run it again until it prints no error. On v0.76 a setting that nothing reads only warned, for example Warning: training.early_stop_patience is accepted but read by nothing; v0.77 will refuse it, and the load continued with exit 0. (Since closed in v0.77.0: those fields are refused at load, see the section above.) Settings refused at load groups the refusals by what they touch, with the start of each message and what to change, and lists the 31 staged fields.

A clean Config check line is not an all-clear. After the load the command prints a Config check that lists settings the backend never reads, but its table covers nine combinations of task, backend and modality at v0.77.2 (the same nine as at v0.77.1): sft, dpo, orpo, simpo, kto and (since v0.77.1) grpo on mlx, sft on unsloth (which has no entries left, because its unread settings are refused at load now), and sft on transformers with vision or with audio. It lists only settings you wrote and set away from their default. For anything else, plain sft on transformers included, it prints None of the 0 setting(s) known to be unread on task=sft backend=transformers is switched on in this config., which means the combination was not reviewed rather than that nothing is wrong. The refusal at load is what protects you; the table only adds to it.

A config that must load on both v0.75 and v0.76.0 needs the refused key removed, not renamed. What changed in v0.76.0 has the full list, the re-run table and the exit-code move: 0 pass, 2 gate failure and 3 usage or input error on eleven gate and verdict commands, so a CI step that tests for exit 1 as "the gate failed" now lets a failing gate through.

v0.76.1 puts read limits in front of the load. Since v0.76.1 every YAML file Soup reads goes through one loader. Nesting is limited to 100 levels, and the document's top-level mapping counts as the first, so 99 levels of brackets under a top-level key is the deepest structure that loads; expansion through anchors, aliases and merge keys is limited to one node per source byte plus 10,000; and a soup.yaml may be at most 1 MiB. A soup.yaml that is over a limit, cannot be read or is not valid YAML stops the load with one line naming the file and the problem (for example Config file soup.yaml is larger than 1048576 bytes; refusing): soup train exits 1 and soup doctor --config exits 2. These are new refusals, so a config that loaded on v0.76.0 can stop loading, and soup doctor --config soup.yaml is the first check here too. Configuration has the size caps of the other readers.

Two dependency traps the upgrade can hit. Both concern a package that was already in your environment, and since v0.76.1 the install itself deals with the second.

  • click is now declared as click>=8.0.0,<8.5. click 8.5.0 drops the description of every positional argument from every soup <command> --help page, so a fresh install that resolved the newest click showed ADAPTER TEXT [required] with nothing after it. If another package in the same environment needs click 8.5 or newer, install Soup in its own environment (pipx does this).
  • typer: Soup declares typer>=0.15.4 since v0.76.1 (#1802, #1858). Below Typer 0.12.4 no command can start, soup --help included (Type not yet supported: int | None), and Typer 0.12.4 to 0.15.3 start the CLI only next to Click 8.1 or older. Upgrading Soup now upgrades such a Typer, or names the conflict, at install time, and soup doctor, wherever it can start, reports it as outdated (need >=0.15.4); that report is advisory and does not change soup doctor's exit code. Through v0.76.0 Soup declared typer>=0.9.0, so pip install -U soup-cli left an older typer in place; on v0.76.0 or earlier the fix is pip install -U "typer>=0.15.4,<0.21" (the ceiling v0.76.x declares; v0.77.0 declares typer>=0.15.4,<0.28, so on v0.77.0 the fix is pip install -U "typer>=0.15.4,<0.28"). A fresh install was never affected.

Soup 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.