Machine Learning - ML Deployment
Packaging & environments
- Freeze dependencies (pip-tools/poetry); record Python and CUDA versions.
- Bundle models with versioned artifacts (e.g., model.joblib, .pt, .onnx).
Containerization
# Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
Serving
# FastAPI example (see Production Overview for full handler)
# uvicorn app:app --host 0.0.0.0 --port 8080 --workers 2