Building the Killer App of Generative AI

July 28, 2024

preview of the tutorial content

I’m excited to launch what will be my most detailed and far-reaching tutorial on using Flask to develop AI applications.

As I’ve recently argued, large language models are becoming a commodity. Companies like OpenAI are focusing on producing more affordable models, as evidenced by the recent release of GPT-4o and GPT-4o-mini. This trend is likely to continue, which fundamentally implies more use cases at the application layer, especially when combined with the increased availability of low-latency serving (consider Grok, for instance).

The killer app of the current generative AI wave has yet to be created, and you might be the one to build it if you work hard and smart. I believe that this app will be developed using Python in the backend for obvious reasons: the generative AI landscape is predominantly built around the Python ecosystem, most packages are in Python, and if you want to leverage data science features or even web scraping, Python is the language to use.

For web apps, I am convinced that Flask will be the framework of choice for the killer generative AI app because it allows you to ship fast without imposing too much structure upfront. Why Flask and not Django? Opinionated frameworks like Django are less suitable when you are working on the edge of something new. Django does help you move fast initially, but its many built-in features can make it less flexible. For maximum flexibility and to also master the core abstractions of web development, Flask is the best choice.

This is why I am launching this comprehensive Flask for AI tutorial. You will learn both basic and advanced features of Flask, understand what you need to build an AI SaaS, and build three AI SaaS products. Currently, six chapters are available, totaling 100 minutes of high-quality content and many more lines of code. As always, you will have access to the source code on GitHub Gist for reference. I do not provide all the code upfront because my experience with online learning has shown that it might be tempting to just copy and paste; however, you won’t really learn anything by doing so. At Lycee AI, you learn the hard way, but that just makes you stronger, smarter, and ready to build the killer app of the generative AI cycle.

Here is a complete overview of the course content. Join us now and start a journey that may lead you to building the next unicorn:

Flask Basics (Available on Lycee AI already)

- Minimal application, debug mode, and HTML escaping

- Routing basics

- Variable rules (name, int:user_id, float, path, uuid)

- Unique URLs and redirect behavior (/documents/, document/)

- URL building with url_for()

- HTTP methods: request, GET, POST

- Static files and rendering templates

- Accessing request data: request.path, request.method, request.form, request.args.get

- Handling files, cookies

- Redirects, error handling, responses (including streaming examples)

- Sessions, message flashing, logging

Advanced Web Dev Features (In progress)

- SQLAlchemy: Engine, connections, sessions, metadata, handling data, full ORM

- Alembic

- Celery

- Tailwind CSS

SaaS Cores: Authentication, payments, basic analytics, scraping

- Building an authentication system

- Handling payments with Stripe (simple button to webhooks)

- Basic analytics (visitors, pageviews per day, pages, referrer, country, OS, and browser)

- Scraping, data pipelines, and cron jobs + Airflow

- Graphs on the browser (financial data viz, Airflow-like DAGs)

First App: A ChatGPT clone (build, ship in prod using VPS)

- Design/Key features

- Planning the code

- Coding (adding TailwindCSS for CSS and using vanilla JavaScript for animations)

Second App: Image generation and optimization (like the Streamlit app I built) (build, ship in prod using VPS)

Third App: Let’s decide together?

Ready to dive in? Visit Lycee AI to access the full tutorial.

You can also learn to build LLM-based applications using Instructor:

You can learn how to build a RAG app from scratch without using any framework. It is the best way to master the inner workings of retrieval-augmented generation systems.

Building a Retrieval Augmented Generation System Using FastAPI

Twelve chapters are already available on Lycee AI, including two free chapters.

The course is divided into several tasks. For each task, you will receive instructions to attempt implementation by yourself. Then, a chapter will explain the solution. This task-based approach will help you develop a deeper understanding of the concepts and techniques involved. By working through the tasks independently before reviewing the solutions, you can identify and address any gaps in your knowledge, ultimately leading to a more robust grasp of retrieval-augmented generation systems.

Ready to take on the challenge?

Other courses available on Lycee AI

  • Learn to build a financial analyst copilot to help you decide whether to buy or sell a stock. We personally built one and used it to make a gain of over 2,000 euros on a 3,000-euro experimental portfolio created to test it.

You can also continue to learn the fundamental and advanced aspects of DSPy:

Develop a RAG app using DSPy, Weaviate, and FastAPI

DSPy: Learn how to program (not prompt) language models (Full Course)

Advanced DSPy Tutorials

Recommended reading

Why the Challenge of AI Is Reliability: https://www.lycee.ai/blog/ai-reliability-challenge

On Apple Intelligence: https://www.lycee.ai/blog/on-apple-intelligence-ai-openai

The Promise of AI Agents: https://www.lycee.ai/blog/ai-agents-automation-eng

Several people have contacted us to ask if we also offer freelance consulting, and the answer is yes. We offer freelance consulting on machine learning, generative AI, data, and the web development of AI apps. Reach out via email if you want to collaborate with us.

Do you have a specific topic you want us to cover? Let us know by email as well.

Happy learning, happy coding!