I often enjoy playing around with AI models, especially Text-to-Speech models. Unfortunately these are usually built in python, so I as a mostly javascript programmer, I’ve got some extra work to do to access them.
In this article I’ll be building a simple API around https://github.com/suno-ai/bark and dockerizing it.
Why Flask?: Because its a minimal framework and I don’t need anything extra for my simple API with just a few endpoints. In a more serious API I’d probably at least consider using something like fastapi (but definitely not Django).
This article is mainly for my future self, when I need to do this again and forget how python’s ecosystem works.. but hopefully this has helped you too.
Flask API
Remember to create a Python Virtual Environments first.