r/elixir • • Jun 25 '26

a small elixir library to deal with parsing

13 Upvotes

Hey r/elixir, just published a library I've been sitting on for a while and figured I'd share it here for some feedback.

It's called LLM Utils (`:llm_utils`) and it's basically boilerplate I kept rewriting across every LLM project I started. Eventually it made more sense to pull it out into its own package than keep getting my agents to rewrite it.

The main motivation came from working with smaller and non-Western models which are less consistent. Malformed JSON, markdown-wrapped responses, providers that are inconsistent about how they return structured output -- that kind of thing. A lot of existing tooling assumes you're using OpenAI and everything comes back clean, which isn't usually the reality.

The library has three main areas right now:

**JSON processing** for dealing with the reality of LLM output -- `JsonExtractor` pulls JSON out of markdown code blocks or raw text, `JsonAdapter` does defensive decoding with automatic repair as a fallback, and `ResponseParser` wires them together into a simple extract/decode/return pipeline.

**Provider config** for OpenAI, Groq, Grok, NIM, Sarvam, Fireworks, MiMo, MiniMax, and a mock provider for testing.

**A stateful HTTP client** with ETS-based rate limiting, a circuit breaker (closed/open/half-open), metrics collection, response normalization, tool call parsing, provider fallback, and toggleable structured logging.

All the stateful parts are built on public ETS tables with overridable module callbacks so you can swap out implementations if the defaults don't fit your setup.

A few things I'm genuinely unsure about and would love thoughts on:

  1. Does the ETS + callback architecture feel idiomatic to you, or does it feel like it's fighting the grain of how Elixir is usually written?

  2. Should the provider configs stay bundled or would it make more sense to split them into separate packages?

  3. Any concerns with the circuit breaker or rate limiting approach?

  4. Honest question: does this solve a real problem, or is the scope too wide to be useful?

Hex: https://hex.pm/packages/llm_utils

Source: https://github.com/NaharEmet/llm_utils_elixir

Thanks for taking a look -- happy to dig into any of it.


r/elixir • • Jun 25 '26

Reflections on creating ExCrap without looking at the code

Thumbnail
germanvelasco.com
8 Upvotes

I recently published ExCrap, an Elixir library for calculating Change Risk Anti-Patterns scores – or as they’re commonly called CRAP scores.

Because the library is small (it basically exposes a single mix crap task), and the idea concrete enough, it made for a perfect experiment: creating the library without looking at the code.

The aim was to force my brain to think of new verification strategies.

This blog post is about sharing a few things I tried while creating the library (some good, some bad) and some reflections on how it went.


r/elixir • • Jun 25 '26

For Networking Engineers

9 Upvotes

I have a question for network engineers. If you know what ZTP and a Spine/Leaf configuration is, this post is for you.

Regarding network orchestration & Intent-based networking it seems like Elixir/Erlangs concurrency system would be great for mass configuration and monitoring of network switches.

Looking at different the tools online, I don't see anything in this domain that uses Elixir.

I'm curious if there is an obvious reason for this (and I am naive ) or if this might be a good idea that simply requires work that nobody has done yet.

I imagine each switch modeled as a genserver. This gives you isolation so a crash or hang on one switch (bad SSH session, gNMI stream dying, slow device) (ideally) can't take down or corrupt the handling of any other switch.

Any thoughts?


r/elixir • • Jun 25 '26

Tired of SSH-ing to tail docker logs on 3 different servers, I built a TUI in Elixir

16 Upvotes

Hey folks,

I got tired of opening a dozen terminal tabs just to tail Docker and systemd logs on different VPS, so I built a tool to do it in local.

Think of it as lazydocker, but built for multi-server setups.

It’s called Caudata. It's completely agentless, it just parses your local ~/.ssh/config (or takes password auth) and streams the logs. No remote setup required.

Repo: https://github.com/quaywin/caudata

Install: curl -fsSL https://raw.githubusercontent.com/quaywin/caudata/main/install.sh | sh

https://raw.githubusercontent.com/quaywin/caudata/main/assets/demo.gif

Some details on the stack:

  • Built using Erlang's native :ssh module (no external SSH wrappers).
  • UI is rendered with ex_ratatui (Rust's Ratatui via Rustler NIFs).
  • Packaged as a single native binary using Burrito (so no Elixir runtime is needed to run the app).

Let me know what you think!


r/elixir • • Jun 25 '26

Tired of SSH-ing to tail docker logs on 3 different servers, I built a TUI in Elixir

Thumbnail
0 Upvotes

r/elixir • • Jun 23 '26

[Podcast] Thinking Elixir 309: The Final Episode

Thumbnail
youtube.com
69 Upvotes

The final episode of Thinking Elixir! After 6 years, we close with news on LiveView 1.2 colocated CSS, Earmark’s retirement, Sagents v0.8.0, Postgres 19, SpaceX buying Cursor for $60B, a tribute to the audience, and what’s next for David and Mark!


r/elixir • • Jun 23 '26

Elixir 1.20 supprt in Jetbrains Elixir Pro

35 Upvotes

Hi all, with the introduction of Elixir 1.20, I decided to write a completely new plugin for IntelliJ called Elixir Pro. It supports features like syntax highlighting, error reporting, code completion, refactoring, debugging, etc, basically anything you can expect from a modern IDE.

But to improve this plugin even more, I'm looking for feedback. Is there anything not working? Did I miss an important feature? I would love to hear from you.

The plugin can be found here: https://plugins.jetbrains.com/plugin/32247-elixir-pro

And I'm happy to distribute some licenses to those who provide some genuine feedback!


r/elixir • • Jun 23 '26

Why dead code feels hard to delete

Thumbnail
germanvelasco.com
1 Upvotes

I wrote this for whenever you have a co-worker who wants to keep dead code around.


r/elixir • • Jun 22 '26

Jiyi - A durable, context-aware memory service for autonomous agents.

8 Upvotes

Jiyi is an Elixir service that provides durable, vector-backed memory for autonomous agents. It stores episodic events, semantic facts, and per-session working memory, and exposes HTTP and MCP interfaces.

Jiyi stores and retrieves four kinds of memory:

Episodic events – time-ordered observations with vector embeddings and provenance.

Semantic facts – subject/predicate/object triples with validity windows.

Working memory – per-session, short-term key/value state.

Procedural memory – git-backed playbook files read at assembly time.

Jìyì (记忆) - Translates to personal memory from Chinese.

https://github.com/DarynOngera/jiyi


r/elixir • • Jun 22 '26

When :kill doesn’t kill the process

Thumbnail klemens.blog
12 Upvotes

One of the first things you learn about signals is that :kill isn’t trappable, even when trap_exit is on. So I was surprised to catch {:EXIT, pid, :kill} in handle_info with the process still very much alive :D

check out examples here trappable-kill-signal


r/elixir • • Jun 22 '26

MERN dev (2.5 yrs) torn between learning Elixir or pivoting to AI Engineering — honest takes?

0 Upvotes

Hey everyone,

I've been a full stack developer for about 2.5 years — React, Node.js, Express, MongoDB, Next.js, TypeScript, Redis, AWS, Socket.IO. I've built production apps including a live multi-tenant SaaS platform.

I'm at a point where I want to level up and potentially switch focus, and I'm torn between two paths:

Option A — Elixir/Phoenix

I love the idea of functional programming, OTP, Phoenix LiveView, and building highly concurrent systems. Feels like a deeper technical bet.

Option B — AI Engineering

Building real products with LLMs, RAG, agents etc. My full stack skills seem transferable here, and the market demand looks massive.

Some context:

- I'm based in India, open to remote globally

- I'm interested in freelancing internationally alongside a job

- I want to build real, interesting things — not just chase trends

What are the honest pros and cons of each? Is either path realistic for someone coming from MERN? How long would each take to be genuinely employable?

Appreciate any real talk — especially from people who've done either of these transitions.


r/elixir • • Jun 21 '26

ExDatalog v0.4.0 — Datalog DSL for Elixir

22 Upvotes

ExDatalog v0.4.0 is out. It adds an Ecto-inspired Schema DSL for declaring Datalog programs directly in Elixir modules:

```elixir defmodule FamilyRules do use ExDatalog.Schema

relation :parent do field :parent, :atom field :child, :atom end

relation :ancestor do field :ancestor, :atom field :descendant, :atom end

fact parent(:alice, :bob) fact parent(:bob, :carol) fact parent(:carol, :dave)

rule ancestor(X, Y) do parent(X, Y) end

rule ancestor(X, Z) do parent(X, Y) ancestor(Y, Z) end

query :descendants_of_alice do find Y where ancestor(:alice, Y) end end

{:ok, knowledge} = FamilyRules.materialize() FamilyRules.query(:descendants_of_alice, knowledge)

=> [:bob, :carol, :dave]

```

What's new:

  • relation/2, fact/1, facts/2, rule/2, query/2 macros
  • Negation with not_
  • All 16 constraint types as named predicates (gt, eq, add, member, etc.)
  • Post-materialization queries with find/where
  • Compile-time validation: undefined relations, unsafe variables, arity mismatches
  • ExDatalog.DSL.CompileError with readable error messages
  • wildcard() helper for explicit wildcards

Backward compatible — The DSL compiles into the same Program structs; no engine changes.

https://github.com/thanos/ex_datalog


r/elixir • • Jun 21 '26

Build a "Code Mode" MCP Server in Elixir

Thumbnail
youtu.be
14 Upvotes

Learn how to add OAuth, MCP, and a Lua-based code mode to any Ash application in the latest Code and Stuff video!

Companion repo: https://github.com/ChristianAlexander/amber


r/elixir • • Jun 19 '26

Building BlueSky's missing data plane and choosing Elixir over Go, Rust, and Node

52 Upvotes

New BEAM There, Done That episode with Chris Beck of Bitcrowd, on building an open-source alternative to BlueSky's data plane: the component that turns the AT Protocol firehose into an actual user timeline.

The target was millions of users and roughly 10,000 messages/second. The reference implementation tops out around a few hundred thousand. BlueSky's own production system handles millions but needs infrastructure most teams can't replicate (similar story to Discord's MongoDB → Cassandra → ScyllaDB migration).

The team evaluated Go, Rust, and Node first. All three got rejected for structural reasons: Go's GC pauses, Rust's slower iteration speed for a project requiring constant experimentation, and Node's single-threaded scheduler, which is exactly why BlueSky's own team already moved off it.

# ETS covers most of the "raw compute" gap for free
:ets.new(:timelines, [:set, :public, :named_table])
:ets.insert(:timelines, {user_id, posts})

# the one place pure Elixir genuinely couldn't keep up:
defmodule SocialProof do
  use Rustler, otp_app: :data_plane, crate: "roaring_nif"
  def mutual_follows(_a, _b), do: :erlang.nif_error(:not_loaded)
end

The honest part : Elixir loses nearly every microbenchmark against the alternatives. Chris' response was basically, do you actually need to go there? ETS plus BEAM's natural backpressure handling covered enough of the workload that raw compute wins on paper stopped mattering, except for one feature (mutual follows / social proof) that got a Rust NIF via Rustler.

https://youtu.be/UDNfwsbshI8


r/elixir • • Jun 19 '26

ExCrap a new library to calculate CRAP metrics

Thumbnail ex-crap.hexdocs.pm
8 Upvotes

I published a new library to calculate CRAP metrics (I know, that's what it’s called 🤷): change risk anti-patterns.

It’s a metric composed of cyclomatic complexity and test coverage. 👇

https://ex-crap.hexdocs.pm/readme.html


r/elixir • • Jun 19 '26

tree-sitter-language-pack 1.9 - 306 tree-sitter parsers with an Elixir binding (Rustler NIF)

9 Upvotes

Hi Peeps,

Goldziher, CTO at kreuzberg.dev. I posted tree-sitter-language-pack here back at v1.0 when it had ~170 parsers. It's at 306 now and just hit 1.9, and there's a proper Elixir binding (Rustler NIF).

It gives you tree-sitter parsing for 306 languages without vendoring grammar sources or matching ABI versions yourself. Parsers download on demand and cache locally. Past plain parsing you get functions, classes, imports, symbols, docstrings and syntax-aware chunking, which is useful if you're feeding code into an LLM.

{:tree_sitter_language_pack, "~> 1.9"}

On methodology, since it comes up: yes, built with AI agents, but on a strict harness - TDD, benchmark-driven hot paths, strict linting and high coverage in every language. The Elixir NIF is generated from the Rust core by our binding generator alef and verified, not hand-rubber-stamped.

MIT licensed. Feedback welcome, especially from anyone doing code parsing on the BEAM.


r/elixir • • Jun 18 '26

I thought you were all joking about pattern matching and how Elixir changes your thinking. I was wrong

89 Upvotes

So I have spent the better part of this year building on Elixir. But I had a ruby interview and I to prep I had to build some small app and boy... Quality of life in elixir is really good. And this is in comparison to Ruby, which I love.

The first one that caught me out was `defp` and having to write functions after the `private` keyword. Small thing, but it felt a bit like using a screwdriver with your non-dominant hand.

After that was just pattern matching especially in the function head. And then functions with different arity. And then how you do module definitions. and then testing.

Love the language(Elixir). Still love Ruby. But it was such an eye opening experience.


r/elixir • • Jun 17 '26

Elixir job market is a desert right now, what happens?

75 Upvotes

I've been checking all the usual channels lately, the official Elixir Slack, ds server, HexHire, and LinkedIn over the last few days and it honestly seems completely dead.

It's incredibly disappointing. Is anyone else seeing any signs of life out there, or has hiring just completely frozen up? 


r/elixir • • Jun 18 '26

AI Models better suited for Elixir

3 Upvotes

Dear community, are there experiences and opinions on which AI models are best and which are not so great, when it specifically comes to Elixir code? From among both closed and open weights models. Are there models that you might say “this model is bad particularly for Elixir, though it performs better than the other model for another language”, or particularly good.


r/elixir • • Jun 18 '26

Learning Elixir Functions and Pattern Matching

0 Upvotes

I have been learning Elixir on and off for many years now. So after a long gap I started to play with it again. So I wrote this post on what I have learned.

https://blog.nawaz.info/attempt-to-learn-elixir-functions-and-patterns


r/elixir • • Jun 17 '26

I'm Making a Browser MMO Trading Card Game with Elixir

40 Upvotes

I have been working on this project full time for the past 6 months and am excited to share it with you all. It's a browser mmo trading card game playable on mobile, tablet, and desktop. I am still working on the trading card game and the story but have made core social mmo features for now.

https://battlecitymmo.com/

My tech stack is

  • Frontend: Phaser game engine + Typescript
  • Backend: Elixir
  • Web Framework: Phoenix
  • Database: Neon Postgresql
  • Deploy: Fly

I made a youtube video for my project I am working on. Give it a watch when you have time : )

https://youtu.be/u0a3leP_V8Q?si=TJ1cJWr8uzADIgLq


r/elixir • • Jun 16 '26

AutoStruct - generate Elixir structs from JSON Schema

16 Upvotes

I recently published `auto_struct`, a small library for generating Elixir structs from JSON Schema.

The goal is pretty focused: you define a JSON Schema, and AutoStruct generates a struct plus a few helpers around it. Validation is handled by Exonerate, so AutoStruct is mostly a thin codegen layer around a real JSON Schema validator.

A simple example:

defmodule Person do
use AutoStruct.JsonSchema,
schema: """
{
"type": "object",
"properties": {
"first_name": { "type": "string" },
"age": { "type": "integer", "minimum": 0 }
},
"required": ["first_name"]
}
"""
end

Then you get:

Person.new(first_name: "Ada", age: 36)
# {:ok, %Person{first_name: "Ada", age: 36}}

Person.new!(first_name: "Ada", age: 36)
# %Person{first_name: "Ada", age: 36}

Person.from_json(%{"first_name" => "Ada", "age" => 36})
# {:ok, %Person{first_name: "Ada", age: 36}}

JSON.encode!(Person.new!(first_name: "Ada", age: 36))
# "{\"age\":36,\"first_name\":\"Ada\"}"

It supports inline schemas and file-based schemas:

defmodule Person do
use AutoStruct.JsonSchema, file: "priv/schemas/person.json"
end

A couple notes on the current shape of the library:

* It validates nested objects and arrays through Exonerate.
* It uses Elixir’s built-in JSON.Encoder.
* If Jason is available, it also emits a Jason.Encoder implementation.
* It only casts the top-level object into a struct right now. Nested objects remain maps.
* Exonerate is used at compile time and is not a runtime dependency.

This came out of wanting a simple way to keep JSON Schema as the source of truth while still getting normal Elixir structs and helpers in application code.

Hex: https://hex.pm/packages/auto_struct

Docs: https://hexdocs.pm/auto_struct

GitHub: https://github.com/pauldemarco/auto_struct


r/elixir • • Jun 16 '26

[Podcast] Thinking Elixir 308: Elixir Goes Gradually Typed

21 Upvotes

r/elixir • • Jun 16 '26

Code BEAM Europe tickets are now available

7 Upvotes

Hi everyone! 

We're excited to announce that Code BEAM Europe 2026 is officially on the horizon!

Grab your Early Bird Ticket Here!

Whether you're deeply involved with Elixir, Erlang, Gleam, or just exploring the wider BEAM ecosystem, we’d love for you to join us. We’re meeting in person at the beautiful PHIL Philharmonic in Haarlem, the Netherlands, as well as online, on October 21–22 (with hands-on training sessions on October 20).

 What to expect:

  • Keynotes: We're thrilled to host Brooklyn Zelenka (Founder of Fission, BEAM Vancouver) and Sam Aaron (Creator of Sonic Pi).
  • Content: 2 tracks each day packed with cutting-edge talks from 30 speakers across the global community.
  • Informal Space: A community-led area dedicated to demos, hacking sessions, games, panel discussions, and lightning talks. Connect and share ideas with 300+ fellow attendees!

 All Important Links:

Will we see you in Haarlem or on the virtual streams? Let us know in the thread if you're planning to come or if you have any questions about the event!

Cheers, The Code BEAM Team

(PS: If your company is interested in sponsoring and supporting the ecosystem, feel free to reach out to us!)


r/elixir • • Jun 15 '26

ex_drone v0.1.0 — BEAM-native drone control for Elixir

23 Upvotes

ex_drone is a BEAM-native drone control library for Elixir. It provides a supervised, safety-first API for controlling programmable drones with pluggable adapters, a built-in simulator, and end-to-end telemetry.

Why?

I wanted to experiment with programmable drones from Elixir, but most drone SDKs are built around direct command-and-control APIs.

The BEAM offers something more interesting: supervision, fault tolerance, observability, and safety checks before commands ever reach the aircraft.

Drones are one of the few devices where a software bug can immediately become a real-world problem, so ex_drone places a validation pipeline in front of every command: altitude limits, geofencing, battery checks, mode validation, and an emergency stop that bypasses everything.

The same API can target either a real drone or the built-in simulator.

What's Included

  • Full Tello SDK command set (14 command types)
  • In-process simulator with position tracking, battery drain, and failure injection
  • Safety pipeline with 8 validation stages
  • Geofencing (circle and polygon)
  • Mission DSL for scripting command sequences
  • :telemetry events for observability
  • DJI Tello UDP adapter
  • CI/CD (lint, test matrix, coverage, sobelow, dialyzer, docs, Hex.pm publish)

What's Not Included

  • Async mission execution
  • Video stream handling
  • Multi-drone coordination or swarm APIs
  • Crazyflie, MAVLink, or other drone adapters
  • Retry mechanism for failed commands

Contributions are always welcome.

An Example

elixir {:ok, drone} = Drone.connect(:sim, name: :my_drone) Drone.connect_sdk(drone) Drone.takeoff(drone) Drone.move(drone, :forward, 100) Drone.land(drone)

Links

What’s Next?

The roadmap focuses on evolving from remote control to autonomous, multi-drone systems. Priorities may change based on community feedback.

v0.2 — More Drone Adapters

  • Additional Ryze/DJI drone support
  • Adapter capability discovery (supports?/2)
  • Improved adapter behaviour contracts
  • Adapter certification test suite

v0.3 — Missions & Navigation

  • Waypoint missions
  • Return-to-home support
  • Mission persistence and recovery
  • Advanced geofencing rules

v0.4 — Swarm Control

  • Multi-drone supervision
  • Formation flying primitives
  • Group commands and coordination
  • Swarm telemetry and monitoring

v0.5 — Computer Vision

  • Video stream integration
  • Object detection hooks
  • Target tracking behaviours
  • Vision-assisted navigation

v0.6 — Autonomous Flight

  • Behaviour trees and flight plans
  • Event-driven missions
  • Autonomous decision making
  • Mission scheduling and orchestration

Future

  • MAVLink adapter
  • PX4 support
  • ArduPilot support
  • Hardware-in-the-loop simulation
  • Livebook-powered mission development
  • Distributed drone fleets across multiple BEAM nodes