Skip to content

Tune any program

You have a program. It takes settings, it produces a number you would like to be smaller (or larger), and it was written without a thought for hyperparameter search. This page tunes it from the shell, twice over: once with atune spawning the program, and once with your own script staying in charge and asking atune for the values.

Nothing here needs a Rust or Python integration, and the program's language does not matter. What it does need is the atune binary — cargo install atune_cli builds it, or see Install for working from a clone — and a program that follows two conventions: it takes its settings from its command line or its environment, and it prints its result on standard output.

Safety and data handling

atune run executes the objective/program directly; it is not a sandbox. Treat an untrusted objective as untrusted code and provide an OS/container sandbox with least privilege. atune does not enforce that isolation.

Local Journal (*.atj) and SQLite (*.db, *.sqlite, *.sqlite3) study and output data are plaintext. Require restrictive file permissions, an encrypted volume, and protected backups. atune export also writes plaintext Optuna journal or SQLite output, so apply the same protections. The best, trials, top, report, doctor, and importance commands read or expose study data; treat their output and any logs as sensitive.

Everything below is a transcript of commands that really ran, in the order shown. The two sections are files in examples/cli/ that the test suite executes, comparing each command's real output against what you are reading; the script being tuned is included from that same directory. If the CLI's output stopped matching this page, the build would fail rather than the page going quietly stale.

--8\<-- "examples/cli/tune_a_script.md"

--8\<-- "examples/cli/ask_tell_handshake.md"

Where to go next

To Read
Look up a flag, a default or an output format CLI reference — the binary itself exits 2 on a usage error, 3 when atune doctor has findings, and 1 on any other
Write a search space that is more than two float ranges Search spaces, and the DSL reference for the grammar
Add trials to yesterday's study, or spread them over machines Resume and scale
Stop a hopeless trial early instead of running it to the end Prune and schedule
Read the study once the run is over Inspect a study
Ask whether your ranges themselves cost you budget Read a doctor report
Understand exactly what "same seed, same answer" promises Determinism