Bring AI Models to Real World
Model Deployment is the process of making a trained machine learning model available for real-world use via apps, APIs, or websites.
1. Train model 2. Save model 3. Build API 4. Connect frontend 5. Deploy online
import joblib joblib.dump(model, "model.pkl")
model = joblib.load("model.pkl")
from flask import Flask, request, jsonify
import joblib
app = Flask(__name__)
model = joblib.load("model.pkl")
@app.route("/predict", methods=["POST"])
def predict():
data = request.json["input"]
result = model.predict([data])
return jsonify({"prediction": result.tolist()})
app.run()
fetch("http://localhost:5000/predict", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ input: [5] })
})
- Vercel (frontend) - Render / Railway (backend) - AWS / GCP (advanced)