Optuna
$ optuna Official Low RiskOptuna (optuna) is an automatic hyperparameter optimization framework whose CLI supports creating and deleting studies (optuna create-study), querying studies and trials with --format json (optuna studies, optuna trials), and driving external shell/agent tuning loops via optuna ask and optuna tell.
pip install optuna optuna ask and optuna tell plus --format json let coding agents run stateless hyperparameter optimization directly from shell scripts.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format json (and yaml/csv/value), -c/--column field selection, --noindent, and scriptable ask/tell JSON subcommands.
--format jsonand-c/--columnsupported onstudiesandtrialsoptuna askandoptuna tellenable language-agnostic CLI optimization loops
Clean storage isolation via --storage SQLite/RDB URLs and read-only inspection queries, though delete-study has no --dry-run.
- Read-only
studies,trials, andbest-trialsinspection - Isolated local SQLite or scoped
--storageURL
Lightweight pure-Python PyPI package (pip install optuna) with minimal required dependencies.
- Fast
pip install optunaacross macOS, Linux, and Windows
Covers study lifecycle, structured inspection, and full ask/tell optimization directly from bash or agent loops.
- Supports
create-study,studies,trials,ask,tell, andbest-trial
Official Preferred Networks project (optuna/optuna) under MIT license with exemplary stability and release hygiene.
- Official
optuna/optunarepository under MIT license
Thorough CLI reference at optuna.readthedocs.io documenting every subcommand, format option, and exit behavior.
- Dedicated CLI reference on ReadTheDocs
Security, Auth & Guardrails
Connects to SQLite/RDB/Journal storage via --storage <url> or OPTUNA_STORAGE env var (carrying DB credentials if using Postgres/MySQL).
MIT open-source CLI and framework; zero licensing cost (external RDB hosting costs depend on chosen backend).
# Optuna CLI (optuna) Agent Rules - Always pass `--format json` on `optuna studies`, `optuna trials`, and `optuna best-trials`. - Specify `--storage <url>` (or `OPTUNA_STORAGE`) explicitly so studies do not land in unexpected default paths. - Confirm with the user before calling `optuna delete-study`.
Agent-Ready Command Recipes
Safe Read-Only Queries
optuna --storage sqlite:///example.db studies --format json
Emits study names, directions, and trial counts in clean JSON.
optuna --storage sqlite:///example.db trials --study-name tune-v1 --format json
Returns trial parameters, values, and states as structured JSON.
Controlled Writes & Previews
optuna --storage sqlite:///example.db ask --study-name tune-v1 --search-space '{"lr": {"name": "FloatDistribution", "attributes": {"low": 1e-4, "high": 1e-1, "log": true}}}' Creates one trial and returns suggested JSON parameters for an external script or agent to evaluate.
Strengths for Agents
- + First-class
--format jsonand-c/--columnfiltering acrossstudies,trials, andbest-trials. - +
optuna askandoptuna tellallow agents to optimize any shell command or non-Python script.
Caveats & Pitfalls
- ! Omitting
--storagefails on commands requiring a backend unlessOPTUNA_STORAGEis exported. - !
optuna delete-studypermanently removes trial history without a--dry-runflag.