Running ML models in Elixir using Pythonx

I just discovered Pythonx, which runs a Python interpreter in the same OS process as Elixir. Looks like it also wraps uv so it sets up a virtual environment with all the Python dependencies your code needs. Here's how I got the MLX version of the recently released…

Building a Membrane Pipeline to talk to Google Gemini

This post was also published in the Software Mansion blog. Large Language Models like Google’s Gemini 2.0 Flash and OpenAI’s GPT-4o Realtime are multimodal, meaning users can chat with them via text, talk to them directly like in a conversation, or even send a live video feed.…

Gemini file upload in Elixir

If you want to send videos or images to the Google Gemini API, eg for video summarization, you need to upload the video to a separate endpoint and wait for it to get processed. This is described in the Gemini docs, and it's fairly straightforward to translate into…

Implementing distributed pooling in Elixir

In Elixir, once you have clustering set up, it's ridiculously easy to run some code on another node in your cluster: Node.spawn(:"another_beam_instance@10.0.1.2", fn -> # This runs on a different node send(self(), node()) end) receive do response…

TIL: `pg` vs `pg2` Erlang modules

I started reading up on Erlang's pg module(pg = "process groups", it's not related to Postgres!) recently and kept seeing references to pg2. This is quite confusing because pg is the newer module that replaces pg2. From pg.erl's initial commit message:…

FLAME Dashboard

I just released a small Elixir package: flame_dashboard(Hex.pm package). It adds a page to Phoenix LiveDashboard that lets you monitor your FLAME pools. Here's a video showing the dashboard in action: 0:00 /0:13 1×…

Elixir clustering on a Kamal+Hetzner deployment

I've been experimenting with Kamal for deploying an Elixir application. The application was previously deployed on Fly.io and relies on the Erlang VM's clustering capabilities, so I had to get this working on the Hetzner deployment I'd spun up using Kamal. It took…

TIL: Configuring multiple FLAME backends

In OctoCut, I have to perform a few tasks that are CPU or memory intensive. Instead of performing them on the machine serving web requests, I want to perform them on a different machine. FLAME is perfect for this. (If you're not familiar with FLAME, I highly recommend…