elixir-nx / bumblebee

Pre-trained Neural Network models in Axon (+ 🤗 Models integration)
Apache License 2.0
1.27k stars 90 forks source link

Reducing entry barrier for Elixir ML - can we showcase bumblebee based elixir code exposed as REST api to integrate with other frameworks ? #262

Closed insidesmart closed 9 months ago

insidesmart commented 9 months ago

Kudos for the great work done so far in elixir to support machine learning. Bumblebee is an awesome addition.

Question

Is there a live book which can explain how to use elixir ML code (for eg speech to text Neural Network task) as a REST api endpoint to integrate with other frameworks like nextjs/sveltekit/nuxtjs/rails/laravel ?

Is this already created by someone ?. If yes, please indicate it to me. I will be thankful. If no, can this be provided as a sample livebook for new users to adopt ?

Background

Is there any way to reduce the entry barrier today for developers coming from python or other language/frameworks to adopt elixir for ML needs.

While phoenix & liveview combo is an ideal fit for ML related web apps in elixir, there are many developers from other ecosystem who cannot fully adopt elixir stack but could use elixir as an api to support ML usecases with their existing frameworks.

I see lot of sample projects for python based ml frameworks like langchain/llamaindex along with api creation modules like flask to create a quick REST api which are integrated with some of the above listed frameworks.

josevalim commented 9 months ago

There are example apps here: https://github.com/elixir-nx/bumblebee/tree/main/examples/phoenix (it also includes a README with deployment considerations)

And the original announcement shows how to move any Bumblebee serving into a Phoenix app: https://news.livebook.dev/announcing-bumblebee-gpt2-stable-diffusion-and-more-in-elixir-3Op73O

So my suggestion would be:

  1. Use Livebook "Neural Network task" smart cell to build an example
  2. Move the example mostly as is to a Phoenix app (as shown in the second video)
  3. ...
  4. Profit!

Please explore it and let us know, if you have any questions, feel free to ask here or on ElixirForum. And if you write an article, let us know. :)

insidesmart commented 9 months ago

Thanks. This is useful. Will come back after exploring them.