When to Use the Python API
The API gives you full programmatic control for building custom applications.Best For
- Custom applications - Build your own tools
- Complex workflows - Multi-step pipelines
- Dynamic configuration - Adjust on the fly
- Integration - Connect with existing code
- Production systems - Deploy as services
What It Looks Like
Write Python code:Workflow Example
Advantages
- Full control - Access everything
- Custom logic - Your preprocessing
- Integration - Works with any Python library
- Dynamic - Adjust based on conditions
- Testable - Unit test your training
Limitations
- More code - You write the orchestration
- Complexity - Handle errors yourself
- Python only - Not language agnostic
- Dependencies - Manage packages
When to Switch
Use CLI when you:- Need simple automation
- Want language agnostic solution
- Prefer configuration over code
- Work with non-Python tools
- Need visual feedback
- Teaching others
- Quick experiments
- Data exploration
Common Use Cases
Web Service
Data Pipeline
A/B Testing
Custom Callbacks
Tips for API Users
- Handle exceptions - Training can fail
- Add logging - Track what happens
- Use type hints - Catch errors early
- Write tests - Ensure reliability
- Document code - Others will use it
API-Exclusive Features
Things only the API can do:- Custom callbacks during training
- Dynamic model selection
- Complex data pipelines
- Embedded in applications
- Programmatic hyperparameter tuning