Skip to content

CLI reference

The quoptuna command is a Typer application. Invoking quoptuna with no subcommand is equivalent to quoptuna run.

Copy application metadata from the legacy SQLite quoptuna_app.db into the configured SQLModel database. The source file is not deleted.

Terminal window
quoptuna migrate-supabase \
--source-db db/quoptuna_app.db \
--database-url "$DATABASE_URL" \
--dry-run
quoptuna migrate-supabase \
--source-db db/quoptuna_app.db \
--database-url "$DATABASE_URL"

--dry-run reports the records that would be copied. The command is safe to repeat and uses stable IDs when writing the destination.

Copy all Optuna studies from one local SQLite database into the PostgreSQL database configured by OPTUNA_DATABASE_URL:

Terminal window
quoptuna migrate-optuna db/results-trial-june15.db

Copy only one study:

Terminal window
quoptuna migrate-optuna \
db/results-trial-june15.db \
--study-name heart-june16-trial3

Override the configured destination:

Terminal window
quoptuna migrate-optuna \
db/results-trial-june15.db \
--target-url "$OPTUNA_DATABASE_URL"

The command copies study metadata and trials, does not delete the source file, and reports each migrated study. Existing studies with the same name can cause Optuna to reject a repeat; verify the destination before rerunning a partially completed migration.

Launch the QuOptuna application. Serves the Web UI, the JSON API, and interactive docs on a single port. API docs are available at /api/docs.

OptionDefaultDescription
--streamlitoffLaunch the legacy Streamlit dashboard instead of the full stack
--host <h>access hostAccess host used in generated URLs and links
--port <n>8000Port for the QuOptuna server (auto-increments if busy)
--no-browseroffDo not auto-open the browser

Run a single optimization headless through the exact UI pipeline and print a JSON summary to stdout.

OptionDefaultDescription
--uci-id <n>UCI dataset id (e.g. 53 for Iris). Mutually exclusive with --csv
--csv <path>Path to a local CSV dataset. Provide exactly one of --uci-id / --csv
--target <col>dataset target / last columnTarget column
--features a,b,call non-targetComma-separated feature columns
--trials <n>3Number of Optuna trials (min 1)
--models <list>SVCComma-separated model types, e.g. SVC,IQPKernelClassifier
--label-neg <v>Binary targets: label mapped to -1
--label-pos <v>Binary targets: label mapped to +1
--favorable-class <v>Multiclass: favorable outcome for fairness auditing (only with fairness)
--sensitive-feature <col>Protected-attribute column for fairness auditing
--fairness-mode <m>offoff | constrained | multi_objective
--fairness-metric <m>equal_opportunity_differenceDisparity metric
--fairness-threshold <f>Constrained-mode disparity threshold
--sampler <s>randomtpe | random | grid
--seed <n>0Sampler seed for reproducible runs
--pruner <p>nonenone | asha | hyperband
--max-steps <n>20Training-step cap for iterative quantum models
--convergence-interval <n>5Flat-loss convergence window
--max-vmap <n>Circuit vectorization width
--categorical-encoding <e>ordinalordinal | onehot
--study-name <s>Optuna study name
--db-name <s>cli_runsOptuna storage database name
--subset-size <n>30Analysis subset size
--no-analyzeoffSkip the post-run analysis summary
Terminal window
quoptuna optimize --uci-id 53 --trials 2 --models SVC,IQPKernelClassifier
Terminal window
quoptuna optimize --csv data.csv --target label --trials 3