Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Optuna

$ optuna Official Low Risk
Preferred Networks · AI & Media · MIT · macos / linux / windows

Optuna (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.

FCRS-1.0 Score
86 /100
Good
Medium Confidence
Zero-Friction Install
pip install optuna
CLI vs MCP Decision CLI Preferred vs MCP

optuna ask and optuna tell plus --format json let coding agents run stateless hyperparameter optimization directly from shell scripts.

Agent-Readiness Checklist

✓ JSON Output
✓ Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports --format json (and yaml/csv/value), -c/--column field selection, --noindent, and scriptable ask/tell JSON subcommands.

  • --format json and -c/--column supported on studies and trials
  • optuna ask and optuna tell enable language-agnostic CLI optimization loops
Trust & Safety 20 / 25

Clean storage isolation via --storage SQLite/RDB URLs and read-only inspection queries, though delete-study has no --dry-run.

  • Read-only studies, trials, and best-trials inspection
  • Isolated local SQLite or scoped --storage URL
Setup & Portability 12 / 15

Lightweight pure-Python PyPI package (pip install optuna) with minimal required dependencies.

  • Fast pip install optuna across macOS, Linux, and Windows
Utility & Efficiency 13 / 15

Covers study lifecycle, structured inspection, and full ask/tell optimization directly from bash or agent loops.

  • Supports create-study, studies, trials, ask, tell, and best-trial
Maintenance & Lineage 10 / 10

Official Preferred Networks project (optuna/optuna) under MIT license with exemplary stability and release hygiene.

  • Official optuna/optuna repository under MIT license
Docs & Verifiability 9 / 10

Thorough CLI reference at optuna.readthedocs.io documenting every subcommand, format option, and exit behavior.

  • Dedicated CLI reference on ReadTheDocs

Security, Auth & Guardrails

Auth Modes
Env API Key Config File No Auth
Credential Storage

Connects to SQLite/RDB/Journal storage via --storage <url> or OPTUNA_STORAGE env var (carrying DB credentials if using Postgres/MySQL).

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

MIT open-source CLI and framework; zero licensing cost (external RDB hosting costs depend on chosen backend).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

List optimization studies as JSON
optuna --storage sqlite:///example.db studies --format json

Emits study names, directions, and trial counts in clean JSON.

Export trial metrics for a study in 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

Sample next hyperparameter candidate via ask-and-tell
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 json and -c/--column filtering across studies, trials, and best-trials.
  • + optuna ask and optuna tell allow agents to optimize any shell command or non-Python script.

Caveats & Pitfalls

  • ! Omitting --storage fails on commands requiring a backend unless OPTUNA_STORAGE is exported.
  • ! optuna delete-study permanently removes trial history without a --dry-run flag.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI