Section 00 Intro Demo Scripts¶
View code on GitHub Get the Video Course
One script makes the Section 00 intro demo ready: it trains the baseline model and the tuned model, starts both FastAPI apps, and opens them side by side in your browser.
| File | What it is |
|---|---|
run_intro_demo.sh | The one script to run (six stages, below) |
side-by-side.html | The page that shows both APIs next to each other |
ccfd-project/ | An unchanged copy of the Section 08 project (the script only runs it) |
Before you run it (quick setup, one time)¶
These are quick reference steps. The full, step-by-step setup is in Section 02: Setup Python Environment.
1. Is Miniconda already installed? Check its folder first. conda --version can fail even when Miniconda is installed (step 2 fixes that), so look for the folder:
If a folder is listed, Miniconda is installed: do not install it again, go to step 2. Only if nothing is listed, install it: download it from https://docs.anaconda.com/miniconda/, or on macOS with Homebrew:
Full steps: Section 02, Step-01: Install Miniconda. Two Minicondas on one machine (each with its own mlops-env1) cause confusing errors, so keep only one.
2. Seeing zsh: command not found: conda or Run 'conda init' before 'conda activate'? Miniconda is installed, but your zsh terminal is not set up for it yet. Run conda init zsh once with the full path of the Miniconda from step 1 (the one whose envs/ folder has your mlops-env1):
# Miniconda installed with the installer from the website
~/miniconda3/bin/conda init zsh
# Miniconda installed with Homebrew (Apple Silicon Mac; on an Intel Mac use /usr/local/Caskroom/...)
/opt/homebrew/Caskroom/miniconda/base/bin/conda init zsh
Then load the new setting in the terminal you have open (or close it and open a new one):
Check it worked:
Two things that do not work: plain conda init (without zsh) only sets up the bash shell, and a terminal that was already open keeps the old setting until you run source ~/.zshrc. Use bash instead of zsh (and ~/.bash_profile) if echo $SHELL shows /bin/bash. On Windows, use the Anaconda Prompt that Miniconda installs. More help: Section 02, Troubleshooting.
3. Create the course environment (skip if conda env list already shows mlops-env1). On a fresh Miniconda install, accept the Terms of Service first, once:
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
Then create the environment and install the course libraries (from this folder):
conda create -n mlops-env1 python=3.14 -c conda-forge -y
conda activate mlops-env1
pip install -r ccfd-project/requirements.txt
Full steps: Section 02, Step-02: Create Conda Environment and Step-03: Install Dependencies.
Run it¶
If conda activate does not work yet, the script still runs: it looks for the course environment mlops-env1 in the usual Miniconda places and uses it.
It takes about 2 minutes on a laptop. On Windows, run it in Git Bash.
| Stage | What happens | Where to look |
|---|---|---|
| 1 | Create the baseline model (p1_01, p3_01) | ccfd-project/models/p3_01_baseline/ |
| 2 | Start the FastAPI app for the baseline model (p3_02) | http://localhost:8000/ui and http://localhost:8000/docs |
| 3 | Create the tuned model (p4_01, p5_02, p5_03) | ccfd-project/models/p5_03_production/ |
| 4 | Start the FastAPI app for the tuned model (p5_04) | http://localhost:8001/ui and http://localhost:8001/docs |
| 5 | Open both APIs side by side | http://localhost:8300/side-by-side.html |
| 6 | Send the final test data to both models | The difference is printed in the terminal |
See the difference on the page: type test row 7382 (a real fraud from our test data) on both sides, then click CHECK FRAUD on each side. The script prints the values to type.
Press Ctrl+C to stop both APIs and the page server. Each step's output is kept in logs/.
Ports 8000, 8001 and 8300 must be free. If an API from Section 04 B or 08 is still running, stop it first.
Prefer to learn by watching?
The video course builds this whole project with you on screen, step by step.