Get started with ML Service Framework in 5 minutes!
pip install ml-service-frameworkNote: The GitHub repo is MLOps-Boilerplate, but install via ml-service-framework.
# Create a new project
ml-create-project my-first-ml-project
# Navigate to project
cd my-first-ml-project
# Set up environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Copy environment template
cp .env.example .env
# Edit configuration
nano .env # or use your favorite editorPlace your CSV data in data/raw/train.csv with a target column.
Edit config/training_config.json:
{
"data_source": {
"type": "file",
"path": "data/raw/train.csv"
},
"target_column": "your_target_column",
"model": {
"type": "random_forest",
"n_estimators": 100
}
}ml-train --config config/training_config.jsonml-inference --model-path models/model.joblib \
--input-path data/raw/test.csv \
--output-path predictions.csvml-serve --model-path models/model.joblib --port 8000Test the API:
curl -X POST http://localhost:8000/predict \
-H "Content-Type: application/json" \
-d '{"features": {"feature1": 1.0, "feature2": 2.0}}'- 📚 Read the full documentation
- 🔧 Explore configuration options
- 🧪 Check out examples
- 🐳 Try Docker deployment
- 📊 Set up MLflow tracking
# XGBoost
{
"model": {
"type": "xgboost",
"n_estimators": 200,
"learning_rate": 0.1
}
}{
"data_source": {
"type": "database",
"connector_type": "postgresql",
"connection_config": {
"host": "localhost",
"database": "mydb"
},
"query": "SELECT * FROM training_data"
}
}from ml_service.machine_learning.experiment_tracking import MLflowTracker
tracker = MLflowTracker()
tracker.log_training_run(config, metrics, model)