Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Build AI Social Media Assistant: End-to-End ML Project
Rating: 4.8 out of 5(34 ratings)
222 students

Build AI Social Media Assistant: End-to-End ML Project

Fine-tune the Mistral 7B LLM with LoRA in Colab, upload it to Hugging Face and connect it to a React chat app with Flask
Last updated 11/2025
English
English [Auto],

What you'll learn

  • Build an end-to-end generative AI project, from a client brief to a working AI chat assistant
  • Fine-tune the Mistral 7B large language model with LoRA and four-bit quantization in Google Colab
  • Create a JSONL chat dataset and tokenize the conversations with Hugging Face transformers
  • Write a model card and upload a fine-tuned model to a Hugging Face repository
  • Serve the model through a Flask inference API in Colab and share it with an ngrok public URL
  • Load a fine-tuned model with several loading strategies and handle errors and model status in the API
  • Build a React chat interface and connect it to the model API so the assistant replies in the chat
  • Plan and track an ML project in Jira sprints, from backlog to done
  • Build a Streamlit web app that predicts diabetes with a support vector classifier model
  • Deploy a machine learning model as a public API with FastAPI and ngrok

Course content

3 sections • 35 lectures • 3h 37m total length
  • Intro to Social Media Assistant Project0:40

    Explore the fundamentals of building an AI social media assistant as an end-to-end ML project, outlining core components, workflow, and project setup.

  • Meeting with Client1:28

    Conceptualize pop zone, a social media platform with an embedded AI assistant that generates context-aware greetings, enables fast content search, and automates routine interactions as a modular, end-to-end ML prototype.

  • Jira Part 15:06

    Plan and manage the first Jira sprint for the Pop Zone project, covering workspace and model selection, getting Angie Rock token and hugging face token, Colab setup, and backlog-driven progression.

  • Project Overview3:09

    Outline a no-cloud ML project to build a social media assistant. Use Mistral 7B on Colab with T4 GPU, ngrok-backed backend, and a local React frontend for chat context.

  • Setup Colab3:43

    Set up a Google Colab notebook with GPU, connect the runtime, and install libraries. Develop a model, upload to hugging face, and host a flask API via Ngrok on Colab.

  • Setup HF Token4:36

    Learn how to obtain a Hugging Face access token by creating a new token in your profile, choosing fine-grained access, and applying read and inference permissions for your project.

  • Setup NGRock Token3:21

    Learn to obtain and store an ngrok authentication token, sign up with GitHub, and paste the token into your code to enable a Flask API backend for your AI assistant.

  • Setup Dataset7:39

    Build a jsonl dataset for fine-tuning a mistral generative model, using one record per line with user and assistant roles and content prompts.

  • Jira setup part 22:21

    Complete sprint one and plan sprint two by creating the new sprint, adding a backlog, building the dataset, fine-tuning the nostril model, and uploading it to Hugging Face.

  • Model Development Setup part 11:59

    Set up a Colab-based model development and inference API, install transformers, datasets, accelerate, and four-bit quantization tools, and prepare for end-to-end AI model development.

  • Model Development Setup part 210:18

    Import libraries and set up the environment for model development, including transformers, logging, and huggingface login, then configure model name, output directory, and repo settings in notebook.

  • Dataset Preparation part 18:51

    Build a chat dataset class by loading data from a json file, formatting conversations between user and assistant, and configuring a tokenizer with max length.

  • Dataset Preparation part 26:39

    Prepare dataset by tokenizing conversations, truncating to max length 1024, avoiding padding, extracting labels, and building a chat data set with input IDs, attention masks, and labels for model training.

  • Model Training and Upload part 17:44

    Set up and train your model by defining setup and training functions, initializing the tokenizer from a pretrained model, applying four-bit quantization, and configuring LoRA for end-to-end fine-tuning.

  • Model Training and Upload part 210:01

    Train and fine-tune a model with a tokenizer and prepared training data, then save and upload the model and tokenizer to a Hugging Face repository with a model card.

  • Model Training and Upload part 36:44

    Create a model card, initialize a hugging face repository, and upload a fine-tuned model using the hugging face api with a clear commit message and repo id.

  • Jira setup part 31:33

    Complete sprint two by moving tasks to done and noting missing reviews and in-progress bars. Begin sprint three by setting up the front end for the project and starting sprint.

  • Frontend part 14:36

    Explore the front end of the ai social media assistant project, detailing a chat context, active chat, and user state, with axios managing message sending to the ai endpoint.

  • Frontend part 25:26

    Learn to build a front-end chat interface that updates messages with useState, shows a typing indicator, uses axios to post JSON to an API, and handles responses and errors.

  • Frontend part 33:29

    Builds a WhatsApp/Instagram-like frontend for an AI assistant chat, demonstrates a development server setup, a searchable contact list, and plans error handling and Flask API integration for AI responses.

  • Frontend part 41:31

    Complete the frontend setup and finalize the sprint, then begin API development by constructing and configuring a Flask API in a single file over one week.

  • API Development part 17:41

    Learn to build an end-to-end inference API in Google Colab with ngrok and Flask, connecting a front end to a Hugging Face model for live AI social media assistance.

  • API Development part 28:47

    Load a fine-tuned model with its tokenizer, using three loading strategies and error handling, then expose a Flask API with a health check and a chat endpoint for post requests.

  • API Development part 35:09

    Learn to monitor model status, handle loading and errors, and return a 200 success response with AI-generated outputs through a Flask API, including ngrok tunneling and production-ready routing.

  • API Development part 41:47

    Proceed through the final sprint by configuring energy rock, starting the front end with its URL, and making inferences via the front end after completing the Flask app.

  • Connect and Test the Project part 19:21

    Connects and tests the project by wiring the api, front end, and model, runs inference, and configures the hugging face token, transformers setup, and public api access.

  • Connect and Test the Project part 24:27

    Connect and test the project by booting the dev server, using the ngrok public URL and API endpoint, and validating the frontend-backend chat flow with prompts.

  • Jira setup part 60:47

    Configure and test all items, move tasks to in progress, then to done, and close the sprint to complete the project.

  • End Greetings0:56

    As this course concludes, Atharva from analytics thanks you for completing a practical, small-scale AI social media assistant project suited for small businesses, and demonstrates hosting apps in Google Colab.

  • Download the project files0:01

Requirements

  • Working knowledge of Python and machine learning concepts such as training data and models
  • Basic understanding of REST APIs and how a frontend sends requests to a backend
  • A Google account for Google Colab, plus Hugging Face and ngrok accounts for the access tokens you create in the course

Description

In this end-to-end generative AI project, you build an AI social media assistant from the dataset to the working app. A client, Pop Zone, wants a social media platform with an embedded AI assistant that generates context-aware replies. You fine-tune the Mistral 7B large language model (LLM) in Google Colab on a T4 GPU, upload it to Hugging Face, serve it through a Flask API exposed with ngrok, and connect it to a React chat interface. The work is planned and tracked in Jira sprints, so you also see how an ML project moves from backlog to done.

Set up the project

  • A client meeting that defines the assistant, and a first Jira sprint for the workspace and model choice

  • A Google Colab notebook with a GPU runtime, plus a Hugging Face access token and an ngrok authentication token

Prepare the data and fine-tune the model

  • A JSONL chat dataset with one user and assistant exchange per line

  • A dataset class that formats the conversations and tokenizes them to a maximum length of 1024 tokens

  • Model setup with transformers, datasets, accelerate and four-bit quantization for Mistral 7B on the Colab T4 GPU

  • LoRA fine-tuning, then a model card and an upload of the fine-tuned model to a Hugging Face repository

Build the app around the model

  • A React chat interface in the style of a messaging app, with message state handled by useState and a typing indicator

  • A Flask inference API in Colab, made public with ngrok, that loads the fine-tuned model with three loading strategies and error handling

  • Model status checks and a success response that returns the AI reply to the chat

  • An end-to-end test that wires the API, the frontend and the model together through the ngrok public URL

Deploy machine learning models with Streamlit and FastAPI

  • A Streamlit web app for a diabetes prediction model built with a support vector classifier

  • A FastAPI service for a diabetes prediction model, shared as a public API through ngrok

Each section closes with its project files, which you can use to build the assistant and the deployment apps yourself.

Who this course is for:

  • Aspiring data scientists and AI learners who want a generative AI project for their portfolio
  • Developers who want to deploy a fine-tuned language model behind an API and a web interface
  • Machine learning students who want hands-on practice with LoRA fine-tuning and Hugging Face
  • Developers who want to connect a fine-tuned LLM to a React chat app through a Flask API and ngrok