Launch Your AI App in 48 Hours

Launch Your AI App in 48 Hours

Don't spend 6 months building your app just to find out nobody wants it. Do this instead.

In his book Million Dollar Weekend, author Noah Kagan emphasizes the importance of validating an idea before investing much time or money on it. A large part of the book is about how to go about validating an idea's potential through market research as well as through actual transactions where you seek out people who are willing to part ways with their money in exchange for what you're offering, not in the future, but NOW. Many of the examples he gave involved having either no existing fulfillment arrangement prepared, or having very basic, lower resolution options such as accepting personal PayPal payments. Kagan even pushed back at the idea of a Minimally Viable Product (MVP), suggesting that oftentimes people still put too much time and / or money into them with no feedback loop during that process.

There are cases where people start off their product as just a Google Sheets spreadsheet, or maybe a mass email newsletter from their personal email, or so on. With the advent of much more approachable machine learning and artificial intelligence platforms, such as OpenAI's ChatGPT, Anthropic's Claude, and many more, it has become increasingly easy for technical and non-technical people alike to leverage these new tools to enhance or even serve as the foundation for their product.

While reading it, you might have found yourself thinking "well sure, that method works for THAT, but it won't work for what I'M cooking up!" For instance, you might be trying to catch the wave of AI-powered apps, and you've thought of your next big AI Idea. It might seem like in the case of building an AI-powered app that you wouldn't be able to build and validate it in a weekend as Kagan suggests, but that's far from the case.

Here I'll show you how you can build, deploy, and validate your AI Web App to see if you have a Zero or a Hero.

Your Weapon of Choice

If you're a frequent reader of mine, you might have seen this coming, but the tool we'll be working with today is Elixir's Livebook application.

What makes Livebook so well suited for quickly building and deploying an idea to get to validation is that it takes care of so much for you:

  • Compose a simple, effective, and reactive UI using the Kino library
  • Manage secrets and environment variables using your existing credential from your Hub
  • Use smart cells to help setup common operations such as database connections and queries, plotting, data display, or even machine learning tasks using the kino_bumblebee library
    • You can use a smart-cell as is or convert to code to have more granular control
  • Generate a Dockerfile for deployment or use the Hugging Face integration, you can

If you're unfamiliar with Livebook, I suggest you read this article and come back here when you're finished.

Great, now that you're back hopefully you have a good grasp of what Livebook has to offer, and maybe you can even tell where this is going.

The plan is simple:

  1. Use Elixir's robust machine learning ecosystem (I conveniently explain it here) to implement a crude prototype
    1. Leverage libraries like Kino to develop the UI
  2. Deploy the password protected notebook to either a VPS or HuggingFace Spaces using the native integration with Livebook
  3. Start asking people for money in exchange for access to your newly deployed application
  4. Iterate based on feedback from your new customers

Now you might be thinking to yourself "I'm sure it's way more involved than that!" Well, let's work through an example so you can see for yourself.

Let's Build Your AI Web App

💡
If you want to see a live version of a very similar version of this app, you can go to https://huggingface.co/spaces/acalejos/livebook-apps?logs=container

If you're unfamiliar with Elixir, do not fret. I'll do my best to add comments and walk you through this code, and hopefully by the end of it you will see how approachable it is.

Idea

In open-source development, it is not unusual for someone to start a project, it gains a lot of traction and users, and then the original author loses passion for the project or just wants to work on something new. In these cases, it is common for the maintainers to look towards active members of their community to pass the baton of maintainer to. There are even some solutions such as https://seeking-maintainers.net/ that will try to help pair existing maintainers with new maintainers. That is not the case will all big projects, however, and sometimes large projects become abandoned for a wide variety of reasons. Existing solutions usually rely on the current maintainer actively searching for a new one, so there's a potential for an opportunity here.

Knowing this, and knowing that many people don't know where to start when it comes to contributing to open-source projects, you set out to make a site that can find the best abandoned projects and have people pay for access to your list. Not only do you have the list, but you want to integrate fancy new AI features to generate a robust and comprehensive report on the repositories you find.

So, let's for now focus on building out these automated reports for the sake of demonstration. At least while validating, you could certainly hand-pick the repositories, and use this to generate reports.

💡
If you're curious about how you might automate the process of finding these repositories, you can look into the GitHub Repository Search API, which you can use to filter for time of last commit, last activity, number of stars, etc. Using a combination of these queries you can perform powerful searches.

You can find an example of using the Code Search API in Elixir here. The repository search API will have a slightly different endpoint, but is very similar.

By the end, you will have made something that looks like this:

Sample App

And the reports it generates will look like this:

Build It

💡
You can find the code as a Livebook here

You can find the code here. And here is a walkthrough of the code so you have a better understanding of how we built it:

Ship It

Awesome! You have now built your validation product! Next it's time to get it out into the world. As it turns out, Livebook has you covered here!

💡
If you watched the video above in its entirety, you will have seen how to deploy to HuggingFace Spaces using the Livebook integration, so I will not cover that here. What I will cover now is how to configure a Dockerfile so that you can deploy on infrastructure of your choice.

Look for the rocket ship icon on the left sidebar. This is the Deploy tab. From here, you can configure your application with some different settings based on how you want it to behave when deployed. Just click the Configure button at the top right of the slide-over menu.

From here you will configure the following:

  • Set the slug to the URL slug you want the application to be accessible from
  • Set a password for the application if you want it to be password protected. I suggest you do so since the way you will validate this application is to ask people for money in exchange for that password.
  • Select the session type you want to use. I suggest multi-session, which will mean that each new person who connects to your application gets a new session. This means you do not have to implement the server-side logic for handling multiple clients.
  • Select the time to disconnect during inactivity
  • Select whether to show your source code. You likely will not want to show it.
  • Select "Only Render Rich Outputs". If you do not do this, all of your code will be present in the Livebook, not just the code that displays your UI.
  • Select whether to show existing sessions when a new client connects. I suggest you de-select this. You want each new client to start a new instance of the application.

Now if you click the Deploy button at the bottom of this form, it will deploy in the cluster where your Livebook is running. Since this is likely just a local instance, you probably want to instead now exit this configuration menu and click "Deploy With Docker." This will generate a Dockerfile based on the configuration settings we just set.

There are a few other settings you can configure from this page. We don't need GPU support on our deployed Docker image since we're using the OpenAI adapter with instructor, but if you want to use another adapter with a local model, you might want to click one of the buttons to use the CUDA-enabled Docker images.

Now you can copy the generated Dockerfile and deploy on the infrastructure of your choice!

Since each hosting solution has its own method from deploying from a Dockerfile, I won't go into detail here. Consult the documentation from your hosting provider more detail.

Validate It

This is the last but most important part – get somebody to give you money for access to your new application. Notice you didn't have to set up your own authentication, a database, a CRM, an email client, etc.

With just the password protection provided by Livebook, you are now equipped to go start selling your app and see what people are willing to pay, see what they have to say, and generally get feedback to start iterating and/or pivoting on your idea.

You can always also add all of that other stuff if you wish, or more robust forms of authentication, but if you have to be worried about people trying to circumvent your access measure, then perhaps that is validation in and of itself?

Conclusion

If you want more detail about this process, I highly recommend you go out and buy yourself a copy of Million Dollar Weekend. It's a very approachable book that can be read in a day. If you're more inclined towards audiobooks, the audiobook is only about four hours long.

I wanted this article to serve as encouragement to show how approachable it can be to create

Comments