Unleashing the Power of Akash Network: Deploying a Timmothy Olyphant or Josh Duhamel Inference Application

Gratatouille
3 min readDec 7, 2022

--

I recently got into learning about deep learning/AI and dabbling in the web3 space which I believe has a lot of potential. With the help of fast.ai and Akash Network, I built a simple website called timorjosh.com where you can upload a picture of either Timmothy Olyphant or Josh Duhamel and it will get it right… most of the time.

I learned how to train the image classification model using fast.ai, a non-profit research group aiming to democratize AI for all with practical courses and resources. After going through the first two courses of fast.ai’s deep learning course, I decided to get my hands wet and use my recently learned ML skills to solve the Josh Duhamel-Timmothy Olyphant dilemma.

For some people it’s hard to differentiate between the two, even Timothy Olyphant’s mom got tricked into thinking Josh Duhamel was her son in a family Christmas photos.

I used a training template from one of fast.ai’s free notebooks which can be found here. You can follow along with this video in case you get stuck.

I elected to deploy the site through Akash Network to learn how it works and deploy a site on the first decentralized cloud (DeCloud) computing marketplace. Akash enables anybody in the world with a computer that has excess compute resources to be a cloud provider, bridging the gap between developers and providers with costs up to 10 times lower than the cloud giants like AWS, Google Cloud, and Microsoft Azure.

I built the web app using Flask with WSGI and Nginx and baking it into a docker image so it can easily be deployed through Akash. If you want to deploy the application yourself through Akash you can use this SDL file:

---
version: '2.0'
services:
timorjosh:
image: 'awalz/timorjosh:latest'
expose:
- port: 8888
as: 80
http_options:
max_body_size: 26214400
to:
- global: true
profiles:
compute:
timorjosh:
resources:
cpu:
units: 4
memory:
size: 5GB
storage:
- size: 10GB
placement:
dcloud:
pricing:
timorjosh:
denom: uakt
amount: 1000
deployment:
timorjosh:
dcloud:
profile: timorjosh
count: 1

The above specifies a Docker Compose-like specification under services, how much computational resources to allocate for each service under profiles.compute, named datacenter profiles under profiles.placement, and a map between datacenter profiles and compute profiles under deployment. More info. on the SDL structure can be found here.

I deployed the application using Cloudmos’ Deploy tool, the application’s GUI makes it easier to use compared to Akash’s more advanced CLI tool and with the configurations above it costs about $3 a month to run the web app. In order to deploy to Akash, you must have a wallet with a minimum of 5 $AKT (Where to buy Akash Token.) You can follow the timestamped video below to deploy the SDL file above through Cloudmos deploy.

Conclusion

Deploying timorjosh.com on Akash network was a challenging and educational experience. It allowed me to learn how to use fast.ai to build an image classification model and then deploy it on Akash’s decentralized cloud computing platform. Although the application is relatively simple, it enabled me to gain a better understanding of the technologies involved in creating and deploying deep learning applications onto the DeCloud.

If you’d like to keep up with my adventures in web3, AI, and other topics, you can follow me on Twitter.

--

--

Gratatouille
0 Followers

here to explore web3, ai, and make at least one person's life better