Quick Start

In this guide, we’ll run an application that trains an image classification model with the MNIST Dataset, and uses Gradio to serve it.


Step 1 - Installation

First, you’ll need to install Lightning. You can find the complete guide here.

Then, you’ll need to install the Lightning Quick Start package.

lightning install app lightning/quick-start

And download the training script used by the App:


Step 2 - Run the app

To run your app, copy the following command to your local terminal:

lightning run app app.py

And that’s it!

The app will open your browser and show an interactive demo:

Quick Start UI - Model Training Tab
Quick Start UI - Interactive Demo Tab

This app behind the scenes

This application has one flow component which coordinates two works executing their own python script. Once the training is finished, the trained model weights are passed to the serve component.

Here is how the components of a Lightning app are structured:

Quick Start Application

Here is the application timeline:

Quick Start Timeline Application

Steps 3 - Build your app in the cloud

Simply add --cloud to run this application in the cloud 🤯

lightning run app app.py --cloud

Congratulations! You’ve now run your first application with Lightning.


Next Steps

To learn how to build and modify apps, go to the Basics.

To learn how to create UIs for your apps, read UI and Frontends.