OUTR Students: Deploying a Simple ML Model as a Web App During an Internship

OUTR Students: Deploying a Simple ML Model as a Web App During an Internship

Facebook
Twitter
LinkedIn
WhatsApp
Email

You can deploy a simple ML model as a web app in two weeks if you keep the scope small: one saved model, one prediction endpoint, one input form, and a tested public link. Use a lightweight framework such as Flask or Streamlit, freeze your dependencies, and run the testing checklist below before any demo. This guide covers only the deployment stage and assumes you already have a trained model.

What “deployment” means for a 14-day internship project

In a short internship, deployment does not mean production infrastructure. It means that someone who is not you can open a link, enter values, and get a correct prediction without touching your laptop. That is a realistic, demonstrable outcome, and it shows more than a notebook does.

This guide stays inside that boundary. Data collection, feature engineering and model tuning are assumed to be done. If you are still choosing between algorithms, finish that first, because changing the model late forces you to redo packaging and testing.

If you are looking for a structured place to do this work, CareerSwami’s free two-week online internship offers 26 tracks, a free offer letter and a free completion certificate after successful completion. The roadmap below works for any project, whether it is part of that programme or your own.

Choosing a lightweight framework: Flask, Streamlit or FastAPI

Pick the framework you can finish with, not the one that sounds most impressive. The table compares the three common options for a first deployment.

Framework Best when Learning curve Trade-off
Streamlit You want a working interface fast and the audience is a mentor or evaluator Lowest; the UI is written in Python only Less control over layout and no separate API for other apps to call
Flask You want a classic form page plus a JSON endpoint and to understand how web apps work Moderate; needs a little HTML You write the form and the error handling yourself
FastAPI You want an API with automatic documentation and input validation Moderate; benefits from knowing type hints Needs a separate front end if you want a polished interface

For most 14-day projects, Streamlit is the fastest route to a demo and Flask is the better route if you want to explain how requests reach the model. The steps below use Flask for the code illustrations, but the order of work is the same for each.

Free 2-Week CareerSwami Internship

Online, 14 days, with a free offer letter and a free completion certificate once you finish the work. Check with your college that it fits your requirement before you enrol.

Apply for the free internship

Day-by-day deployment roadmap for 14 days

This plan assumes the model already exists in a notebook on Day 1. Adjust the days if your model needs more cleanup.

Days Goal Output you should have
1-2 Freeze the model and define the input contract A saved model file, a list of input fields with types and valid ranges
3-4 Build a standalone prediction function A Python module that loads the model and returns a prediction from raw inputs
5-6 Wrap the function in a web app A local app with a form or endpoint that works on your machine
7-8 Add validation and error handling Clear messages for bad or missing input; no crashes
9-10 Pin dependencies and test in a clean environment A requirements file and a fresh virtual environment that runs the app
11-12 Deploy to a free hosting option A public URL and a note of how it was deployed
13 Run the full testing checklist A completed checklist with fixes applied
14 Rehearse the demo and write the README A two-minute demo script and a short project README

Step 1: Freeze the model and write the input contract

Save the trained model together with every preprocessing step it needs. With scikit-learn, the safest approach is a single Pipeline object that includes scaling and encoding, saved with joblib. If preprocessing lives only in your notebook, the web app will receive raw input the model has never seen.

Then write the input contract: each field name, its type, its allowed range, and what happens if it is missing. This short document becomes the basis for your form, your validation and your tests.

Step 2: Build a prediction function that works without the web app

Create one function that takes a dictionary of raw inputs and returns a prediction. Test it from a plain Python script first. If it fails there, no web framework will fix it, and debugging will be much harder once the app is wrapped around it.

Step 3: Wrap it in a minimal app

Keep the app small. One route for the page, one route for prediction. The following is an illustrative sketch, not tested code, so adapt the field names and paths to your own project.

from flask import Flask, request, jsonify
import joblib
import pandas as pd

app = Flask(__name__)
model = joblib.load("model.joblib")  # load once at startup

FIELDS = ["age", "income", "tenure_months"]

@app.route("/predict", methods=["POST"])
def predict():
    data = request.get_json(silent=True) or {}
    missing = [f for f in FIELDS if f not in data]
    if missing:
        return jsonify({"error": "Missing fields", "fields": missing}), 400
    row = pd.DataFrame([data], columns=FIELDS)
    result = model.predict(row)[0]
    return jsonify({"prediction": str(result)})

Loading the model once at startup, rather than on every request, keeps responses fast and is a small habit worth building early.

Step 4: Validate input and handle errors

Assume users will type something unexpected. Check types, ranges and missing values before the data reaches the model, and return a plain message that tells the user what to fix. Never show a raw stack trace in a demo.

Step 5: Pin dependencies and rebuild from scratch

Generate a requirements file with exact versions, then create a brand-new virtual environment and install only from that file. A model saved with one scikit-learn version can behave differently, or fail to load, under another. Doing this on Day 9 gives you time to fix it.

Step 6: Deploy to a free host

Free hosting options change their limits and terms often, so check the current free-tier rules on the provider’s own page before you commit. Typical constraints to look for are memory limits, sleep-after-inactivity behaviour and file size caps. If your model file is large, consider a smaller model or a compressed version rather than discovering the limit on demo day.

Keep secrets such as API keys out of your code repository. Use the host’s environment variable settings instead.

Pre-demo testing checklist for an ML web app

Run this on Day 13, from a different device or browser than the one you built on. Tick each item and note the fix for any failure.

Area Check Pass condition
Clean install Fresh environment from requirements file App starts with no missing-package errors
Model loading Start the app from a different working directory Model path still resolves
Known cases Run 5 to 10 inputs with known expected outputs from your test split App output matches the notebook output exactly
Boundary values Minimum and maximum allowed values for each field Returns a prediction, no crash
Bad input Text in numeric fields, negative numbers, empty form Friendly error message, no stack trace
Missing fields Send a request with one field removed Clear message naming the missing field
Category handling An unseen category value, if you use categorical inputs Handled gracefully or rejected with a message
Response time Time a single prediction on the hosted version Fast enough to demo without awkward waiting
Cold start Open the link after it has been idle You know how long the first load takes and can warn the audience
Browser and phone Open the public link on a phone and a second browser Form is usable and results display
Secrets Search the repository for keys and passwords None present
Fallback Record a short screen capture of a working run Available if the internet or host fails

Worked illustration: churn predictor, from notebook to checked app

This example is illustrative. The numbers and fields are invented to show the process, and nothing here was run.

Suppose a student has a customer-churn classifier with three inputs: age, monthly spend and tenure in months. The notebook uses a StandardScaler followed by logistic regression.

  1. Freeze: The student combines the scaler and classifier into one Pipeline and saves it as a single file. The input contract says age is 18 to 100, monthly spend is zero or more, and tenure is 0 to 120.
  2. Function check: A short script feeds in ten rows from the test split and compares predictions to the notebook. Nine match; one differs because the app script forgot to keep the column order. The student fixes the order by passing the column list explicitly.
  3. App: A Flask route accepts JSON and a simple HTML form posts to it.
  4. Validation: Entering “abc” for age now returns “Age must be a number between 18 and 100” instead of a server error.
  5. Clean environment: A fresh install reveals that pandas was missing from the requirements file. It is added.
  6. Deploy and test: After hosting, the student runs the checklist from a phone and finds the form is too narrow. A small layout fix solves it.
  7. Demo: The student shows one likely-churn case, one unlikely case and one invalid input, and explains in one sentence what the model cannot do.

The column-order bug and the missing package are typical of what the checklist is designed to catch.

OUTR students: fitting a deployment project into your university’s internship rules

Odisha University of Technology and Research was created by the state government by upgrading the College of Engineering & Technology, Bhubaneswar, under the OUTR Act, 2021, according to the university’s About page. Rules therefore come from the university, not from individual departments alone.

For B.Tech, B.Arch and B.Plan students admitted from 2023-24, the UG Academic Regulations 2023 list Internship alongside seminar, project and labs as a course item. The credit table in that document leaves the internship row blank, so it does not state a duration or credit value, and it does not discuss online internships. Treat any claim about credit for a short online internship as unconfirmed until your department says otherwise. The same regulations describe an Autumn semester from July to December and a Spring semester from January to June.

MBA students have a clearer reference point. The MBA syllabus effective from 2023-24 includes a 3-credit Summer Internship Evaluation course (MS7681) in the third semester, assessed out of 100 marks as a practical assessment. It also lists an Advanced Computing Laboratory and a Business Analytics Laboratory, which suggests a deployed analytics app could be relevant material for discussion, though that is for your faculty to judge.

Break dates matter for a 14-day plan. The Academic Calendar page links a 2026-27 calendar, so read the current version before you schedule your two weeks. Newer UG regulations for 2025-26 are also listed on the official site, so check which version applies to your batch.

Verification steps for OUTR students planning a deployment internship

  1. Identify your batch and open the matching regulations from the university’s Regulation menu; note what they say about internships.
  2. Email your department coordinator asking in writing whether a 14-day online internship can be recorded in your programme, and whether it carries any credit.
  3. Ask which document the department expects, such as an offer letter, completion certificate or project report, and in what format.
  4. Download the Academic Calendar 2026-27 and mark exams and breaks before fixing your Day 1.
  5. Ask whether a hosted demo link is acceptable or whether a recorded demo or report is required for evaluation.
  6. Keep the reply emails in one folder so you can show them if questions arise later.

Preparing the demo: script, README and fallback

A good demo is short and predictable. Plan two minutes:

  • Problem (15 seconds): what the model predicts and for whom.
  • Live use (60 seconds): two normal inputs and one deliberately bad input.
  • Limits (30 seconds): training data size, known weak cases, and what the model should not be used for.
  • How it is built (15 seconds): framework, hosting and where the code lives.

Your README should contain a one-paragraph description, the input fields with valid ranges, setup commands, the live link, and a note about cold-start delay. Add your model’s evaluation metric from the notebook, labelled with the dataset it was measured on, so a reader can judge it fairly.

Frequently Asked Questions

Which framework should I pick if I have never built a web app?

Streamlit is usually the quickest because you write the interface in Python. Choose Flask if you want to learn how requests, routes and JSON work, since that understanding transfers to most other backends.

Do I need Docker to deploy a simple ML model in two weeks?

No. Docker is useful but adds a learning load. A pinned requirements file and a free host that builds directly from your repository are enough for a 14-day project. Add Docker only if you finish early.

My model works in the notebook but gives different answers in the app. Why?

The usual causes are missing preprocessing, wrong column order, or different library versions. Save a full Pipeline, pass columns explicitly, and compare app outputs against notebook outputs on a handful of known rows.

How large can my model file be for free hosting?

Limits differ by provider and change over time, so read the host’s current free-tier documentation before choosing. If your file is too big, try a simpler model, fewer features or compression.

Should I deploy a deep learning model or a classical one for this timeline?

A classical model such as logistic regression, random forest or gradient boosting is easier to package and host. A deep learning model can work, but heavy libraries slow installs and can exceed free-tier memory.

What should I do if the hosted app is down during my demo?

Switch to your fallback: a short screen recording of a successful run, or the app running locally. Mention calmly that free hosting can sleep, then continue with the script.

Will my deployed project count for credit at OUTR?

The UG regulations available to check leave the internship credit row blank, so do not assume credit. Ask your department in writing, as described in the verification steps above.

Is a deployment project suitable for the CareerSwami internship?

A small deployed model is a reasonable deliverable for a two-week internship if you have scoped it tightly. Confirm the expectations for your chosen track and show your mentor the input contract early.

Related Artificial Intelligence guides

Ready to put this into practice?

Join the free two-week CareerSwami online internship in Artificial Intelligence. The internship, the offer letter and the completion certificate are free.

Start your free 2-week internship

Web Stories

Scroll to Top