Data Augmentation

soup data augment expands a JSONL dataset with LLM-driven rewrites. Added in v0.25.0.

Usage

bash
# Rephrase each example 3x
soup data augment \
  --input data.jsonl \
  --output augmented.jsonl \
  --strategy rephrase \
  --count 3

# Translate to other languages
soup data augment --input data.jsonl --strategy translate --lang ru,zh,es

# Rewrite in multiple styles
soup data augment --input data.jsonl --strategy style --styles formal,casual,technical

Strategies

StrategyPurpose
rephrasePreserve meaning, diversify wording
translateAdd examples in other languages for multilingual fine-tuning
styleRewrite in formal / casual / technical / etc. tones

Providers

Augmentation uses the judge providers: ollama, anthropic, vllm. Select with --provider.

bash
soup data augment \
  --input data.jsonl \
  --strategy rephrase \
  --count 2 \
  --provider ollama \
  --dedup

Flags

FlagMeaning
--strategyrephrase / translate / style
--countAugmentation multiplier for rephrase (default 2, 1 to 10). translate and style ignore it and write one variant per language or style
--langTarget languages for translate, comma-separated: at most 10 entries of 32 characters each
--stylesStyle list for style, comma-separated: at most 10 entries of 32 characters each
--modelModel id to ask the provider for
--base-urlProvider endpoint for ollama or vllm. An Ollama server must be on localhost; a remote vLLM server must use HTTPS, and since v0.75.2 its host may not be a private, link-local or reserved IP address (name it by hostname). anthropic needs ANTHROPIC_API_KEY instead
--requests-per-minuteClient-side rate limit, 1 to 600 (default 60)
--dedupDeduplicate augmented + original data

Safety

  • Input/output paths are resolved and constrained to the current working directory.
  • Output format must match the input format, enforced after generation.
  • --count is capped at 10 to prevent accidental 1000× blow-ups.
  • Requests honor --requests-per-minute inherited from soup data generate.

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.