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
joeb

joeb

I agree. It would be awesome if we can do a lot of these Generative AI stuff in Elixir.

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

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

Other popular topics Top

AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
AnfaengerAlex
Hello, I’m a beginner in Android development and I’m facing an issue with my project setup. In my build.gradle.kts file, I have the foll...
New