Optuna
✓ Editorially verifiedOpen-source Python framework for automated hyperparameter optimization across any ML stack.
Pick Optuna if you want a reproducible, code-first way to tune hyperparameters for any ML or LLM fine-tuning pipeline without locking into a vendor.
Skip it if you want a one-click hosted AutoML product or a no-code interface for non-engineers.
Optuna is an open-source hyperparameter optimization framework built in Python and maintained by Preferred Networks. It uses define-by-run search spaces (so you can express conditionals and loops in standard Python), pairs that with modern samplers like TPE, CMA-ES and Gaussian-process Bayesian optimization, and prunes unpromising trials early to save compute. A study object tracks all trials, and results can be inspected through the bundled Optuna Dashboard with Jupyter Lab and VS Code extensions.
It's framework-agnostic: PyTorch, TensorFlow/Keras, scikit-learn, XGBoost, LightGBM and basically anything you can wrap in an objective function. Parallel and distributed search works without code changes, and OptunaHub lets the community publish custom samplers and pruners. Pricing is simple, it's free and MIT-licensed. The audience is ML engineers and researchers who want a serious tuner without committing to a closed AutoML platform.
Fine-tuning teams typically reach for Optuna when they need to sweep learning rates, LoRA ranks, batch sizes or architecture choices and want reproducible studies backed by a SQL or in-memory storage. It is a library, not a hosted service, so you bring your own compute and orchestration.
Optuna is the default we'd reach for when a fine-tuning run needs real hyperparameter search rather than a hand-tuned guess. The define-by-run API and pruning support make it noticeably more pleasant than older grid-search tooling, and the dashboard finally makes long studies readable.
— The AI Tool Bible editorial team
Pros
- ✅ Define-by-run search spaces feel natural in Python
- ✅ Strong sampler/pruner library including TPE, CMA-ES, GP-BO
- ✅ Framework-agnostic across PyTorch, TF, sklearn, XGBoost
- ✅ Parallel and distributed search with minimal code changes
- ✅ Free, MIT-licensed, with active maintainers
Cons
- ⚠️ Library only, no managed service or hosted dashboard
- ⚠️ You handle orchestration, storage and compute yourself
- ⚠️ Learning curve for advanced multi-objective and conditional studies
Use cases
Explore related
Compare with similar tools
All in Fine-tuning →Together AI
FeaturedFine-tune & serve open-weight models (Llama, Mistral, DeepSeek).
Modal
Serverless GPUs and infra for training & serving ML.
Replicate
One-API platform for running and fine-tuning open-source models.
OpenAI Fine-tuning
Fine-tune GPT-4o-mini and friends on your own data.
Anyscale
Ray-powered platform for training, serving, and scaling LLMs.
Lamini
Memory-tuning platform for grounding LLMs in your facts.