Skip to content

CLI Reference

Complete reference for every llmsoup subcommand, flag, and environment variable.

Generate a starter configuration file with ready-to-use defaults.

Terminal window
llmsoup prepare
  • Writes a config.yaml file to the current directory (or the path set by LLMSOUP_PREPARE_OUTPUT)
  • Uses a built-in template with ready-to-use model definitions, signal configurations, and routing rules
  • Fails if the target file already exists — delete or rename the existing file first
VariableDescriptionDefault
LLMSOUP_PREPARE_OUTPUTOverride the output file pathconfig.yaml
Terminal window
# Generate config in the current directory
llmsoup prepare
# Generate config at a custom path
LLMSOUP_PREPARE_OUTPUT=./configs/my-config.yaml llmsoup prepare

Start the HTTP routing server. The server exposes OpenAI-compatible endpoints at /v1/chat/completions and a Prometheus metrics endpoint at /metrics.

Terminal window
llmsoup serve [OPTIONS]
FlagShortDescriptionDefault
--config <path>Path to configuration fileconfig.yaml
--host <address>Host address to bind to127.0.0.1
--port <number>Port number to listen on8080
--quietSuppress the ASCII logo and startup banneroff
--no-bannerAlias for --quietoff
--statsDisplay a live TUI dashboard with metricsoff

Each flag can also be set via an environment variable. Resolution order: CLI flag → environment variable → default.

FlagEnvironment variable
--configLLMSOUP_CONFIG
--hostLLMSOUP_HOST
--portLLMSOUP_PORT

Pass --stats to replace the normal log output with an interactive terminal dashboard that displays real-time routing metrics. The HTTP server runs normally in the background — requests are accepted and routed while the dashboard is displayed.

Metrics update every 500 ms. The dashboard displays the following panels:

PanelContents
Headerllmsoup version, uptime since start/reset, server endpoint URL, keyboard hints
Cost & SavingsTotal cost, total saved, savings rate percentage
RequestsTotal requests, active connections, error count
Per-ModelGauge bars per model showing cost, input/output tokens, and latency; toggle sort between cost and tokens with m
Triggered RoutesGauge bars per route showing match counts and proportional share (sorted by matches)
Top ErrorsError types with counts (sorted by error count)
LogsLive log stream with level filtering and scrollable history
KeyAction
qQuit the dashboard and stop the server
rReset all counters and timers
mToggle Per-Model sort between cost and tokens
lToggle log target selector
fFocus selected log target
PgUp / PgDnScroll log history
+ / -Adjust log level filter
Ctrl+CQuit (alternative)
Terminal window
# Start with defaults (127.0.0.1:8080, config.yaml)
llmsoup serve
# Bind to all interfaces on port 3000
llmsoup serve --host 0.0.0.0 --port 3000
# Use a specific config, suppress banner
llmsoup serve --config production.yaml --quiet
# Launch with live stats dashboard
llmsoup serve --stats
# Override via environment variables
LLMSOUP_CONFIG=prod.yaml LLMSOUP_HOST=0.0.0.0 LLMSOUP_PORT=9000 llmsoup serve

Validate a configuration file for syntax errors, schema violations, and logical inconsistencies.

Terminal window
llmsoup validate [OPTIONS]
FlagShortDescriptionDefault
--config <path>Path to configuration file to validateconfig.yaml

Resolution order: CLI flag → environment variable → default.

FlagEnvironment variable
--configLLMSOUP_CONFIG
Terminal window
# Validate the default config.yaml
llmsoup validate
# Validate a specific file
llmsoup validate --config staging.yaml

On success, prints:

Configuration 'staging.yaml' is valid

On failure, prints an error with file path and location information (see Error format below).


Run routing benchmarks to measure accuracy, cost savings, latency, and memory footprint.

Terminal window
llmsoup benchmark --test-set <path> [OPTIONS]
FlagShortDescriptionDefault
--test-set <path>Path to labeled test set file (required)
--workload <path>Path to benchmark workload configurationuses test set
--config <path>Path to llmsoup configuration fileconfig.yaml
--output <format>Output format: text, json, markdown, mdtext (or markdown when --export is used)
--export <path>Export results to a file
--use-modelsDownload and use embedding/domain models for benchmarkingoff (models skipped)
--download-modelsDeprecated alias for --use-models
FormatDescription
textHuman-readable table output to stdout
jsonMachine-readable JSON output
markdown / mdMarkdown-formatted report (md is shorthand for markdown)

When --export is used without --output, the format automatically defaults to markdown.

Terminal window
# Run benchmark with text output
llmsoup benchmark --test-set tests/fixtures/benchmark_test_set.yaml
# Export results as markdown
llmsoup benchmark --test-set test-set.yaml --export results.md
# JSON output with models enabled
llmsoup benchmark --test-set test-set.yaml --output json --use-models
# Custom config and workload
llmsoup benchmark --test-set test-set.yaml --workload workload.yaml --config prod.yaml

FlagDescription
--versionPrint the llmsoup version and exit
--helpPrint help information and exit

These flags are available on the root command (llmsoup --version, llmsoup --help) and on each subcommand (llmsoup serve --help).

CodeMeaning
0Success
1Runtime error (command execution failure)
2Usage error (invalid arguments, missing required flags — handled by Clap)

Errors are printed to stderr with the following format:

Error (code: 1): path/to/file:line:column: Human-readable error message

When file location information is not available, the format simplifies to:

Error (code: 1): Human-readable error message

This file:line:column format is consistent across all subcommands and makes errors easy to parse by editors and CI tools.

VariableDescriptionApplies toDefault
LLMSOUP_LOGLog level filter (e.g., debug, info, warn, error)Allinfo
LLMSOUP_SKIP_MODEL_DOWNLOADSkip embedding and domain model downloads (useful for testing and CI)Allunset
LLMSOUP_CONFIGDefault configuration file pathserve, validateconfig.yaml
LLMSOUP_PREPARE_OUTPUTOverride the output file path for prepareprepareconfig.yaml
LLMSOUP_HOSTHost address for the serverserve127.0.0.1
LLMSOUP_PORTPort number for the serverserve8080