dPhong31415

dPhong31415

Elixir for generative AI?

I’ve been playing with the idea of building a generative AI app (images/video). Part of me really wants to use Elixir because I love how it handles concurrency and real-time stuff. But I keep wondering… would Elixir just end up being the orchestrator while Python does the actual AI heavy lifting? Or is Nx/Axon good enough now to lean more into Elixir for the ML side too?

Anyone here tried going down this path? Curious what worked (or didn’t).

Most Liked

Margaret

Margaret

Editor at PragProg
joelpaulkoch

joelpaulkoch

At the end of the day whether it’s Elixir or Python, the actual heavy lifting is done below that in C/C++/CUDA/…

So I think the first question is whether you really want to run the models yourself or just use an API which would probably be way cheaper, given that you’ll need a GPU to do image/video generation if you don’t want to wait 10 minutes for a single image. If you use an API for the generative AI part, it doesn’t matter if you write your app in Elixir or Python, so use Elixir and have some fun :wink:

If you want to run the model yourself, Axon/Nx is definitely good enough to run it because it makes use of the same underlying libraries as the Python world (as the most developed backend for Nx is xla via exla library, I think it lacks a bit behind the cutting edge stuff from pytorch. I’m not sure though and I don’t think it would really matter for you’re use case). The bigger issue you’ll run into is that you need an implementation in Elixir for the model you want to run. And that’s in the bumblebee library, which can’t keep up with all the new models developed in Python. If the model is not implemented yet and you’re interested in how all of this works under the hood, you can implement it and open a PR :wink:

The easier way out here is to use the pythonx library, run the model from there and as soon as you or someone else implemented it you can switch to Nx

toon159

toon159

Thank you for the great information :folded_hands:

Where Next?

Popular Ai topics Top

trazorx
Is it possible to build a recommendation system for my online shop? I have online shop and i want to add a recommendation system on it a...
New
Fl4m3Ph03n1x
Background Lately I am in a quest to find a good quality TTS ai generation tool to run locally in order to create audio for some videos I...
New
dPhong31415
I’ve been playing with the idea of building a generative AI app (images/video). Part of me really wants to use Elixir because I love how ...
New
AadityaJujagar
So I came across this privacy-first AI tool for desktop, Jan.ai, so I decided to use it for document analysis purposes with the use of a ...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
AstonJ
Or looking forward to? :nerd_face:
483 11975 256
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1147 28379 760
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
PragmaticBookshelf
Programming Ruby is the most complete book on Ruby, covering both the language itself and the standard library as well as commonly used t...
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New
PragmaticBookshelf
Fight complexity and reclaim the original spirit of agility by learning to simplify how you develop software. The result: a more humane a...
New