Overview
This quickstart guide will help you set up the Credit Score AI Engine, train your first deep learning model for credit risk prediction, and deploy it as a production-ready API. The Credit Score AI Engine is built with PyTorch and demonstrates MLOps best practices for the complete AI lifecycle: from data preprocessing to model deployment.What you’ll build: A credit risk prediction system that evaluates loan applicants and returns risk scores (good/bad) with confidence probabilities.
Prerequisites
Before you begin, ensure you have:- Python 3.10+ installed
- Git for version control
- UV package manager (recommended) or pip
- Docker (optional, for containerized deployment)
Installation
Install dependencies
Using UV (recommended for faster installation):Or using pip:Key dependencies installed:
The project uses modern Python packaging with
pyproject.toml and uv.lock for deterministic builds.torch==2.10.0- Deep learning frameworkfastapi==0.128.0- High-performance API frameworkscikit-learn==1.7.2- Data preprocessingpydantic==2.12.5- Data validationmlflow- Experiment tracking
Environment Setup
Project Structure
Understand the key directories:Configuration Files
Model configurations are defined in YAML for experiment flexibility:config/models-configs/model_config_001.yaml
Training Your First Model
Prepare the dataset
The German Credit Risk dataset is managed with DVC (Data Version Control):The dataset includes features like:
- Age, Sex, Job level
- Housing status
- Saving/Checking accounts
- Credit amount and duration
- Loan purpose
Run the training pipeline
Navigate back to the project and execute training:What happens during training:
Monitor training progress
Watch metrics in real-time via MLflow UI:
- Train Loss & Accuracy - Per epoch
- Test Metrics - ROC AUC, Precision, Recall, F1
- Visualizations - Confusion matrix, ROC curve, Precision-Recall curve
Running Inference
Start the API Server
Launch the FastAPI inference server:The API automatically loads the trained model using a singleton pattern for optimal performance.
API Documentation
Access interactive Swagger docs at:http://localhost:8000/docs
Make Predictions
API Response
prediction: Credit risk assessment ("good"or"bad")probability: Confidence score for “good” risk (0.0 to 1.0)
Web Interface Demo
Launch the interactive web client for testing:http://localhost:3000
The web interface provides:
- Form-based input for credit applications
- Real-time predictions
- Visual risk indicators
Docker Deployment (Production)
For production deployment with Docker:Docker images use multi-stage builds for optimized production sizes.
Model Architecture Overview
The PyTorch model implements a deep neural network:model/model.py (excerpt)
- Batch Normalization - Accelerates convergence
- Dropout Regularization - Reduces overfitting
- Configurable Activations - ReLU, GELU, LeakyReLU support
- He/Xavier Initialization - Optimal weight initialization per activation type
Next Steps
Model Configuration
Learn how to tune hyperparameters and experiment with different architectures
API Reference
Explore all available API endpoints and schemas
Production Deployment
Deploy to cloud platforms with best practices
MLOps Architecture
Understand the MLOps principles and architecture patterns
Troubleshooting
ModuleNotFoundError during training
ModuleNotFoundError during training
Ensure you’re in the correct directory and all dependencies are installed:
FileNotFoundError: Dataset not found
FileNotFoundError: Dataset not found
Pull the dataset using DVC:
CUDA/GPU not detected
CUDA/GPU not detected
The model runs on CPU by default. For GPU acceleration:Then modify
inference/inference.py:API returns 500 error
API returns 500 error
Check that model artifacts exist:If missing, run training first.
Support
Need help? Check out these resources:- Video Tutorial: Project Explanation & Demo
- Deployment Guide: Production Deployment Tutorial
- GitHub Issues: Report bugs or request features
- Community: Join our Discord for discussions
Congratulations! You’ve successfully set up, trained, and deployed a production-ready credit scoring AI system.

