r/elixir • u/mikehostetler • 8d ago
Announcing Tune: evals, evolutionary search, and prompt optimization for Elixir
I'm excited to share my newest package in the ReqLLM family: Tune
Tune measures and improves Elixir code, including LLM prompts. You give it a function or an LLM program, some labeled examples, and a score. It runs your code, searches for a better setting or prompt, and then checks the winner against your current version on examples the search didn’t see.
The same small API covers three jobs:
- Evals: score live code, saved answers, tool calls, or transcripts, and gate a release on a paired comparison.
- Evolution: grid or genetic search over any Elixir value.
- Prompt optimization: strategies modeled on DSPy and GEPA, in native Elixir with no Python.
Model calls go through ReqLLM. Learned values export as plain JSON you can load at runtime.
Tune.new(%{review_at: 50}, run: &MyApp.Router.route/2)
|> Tune.data(validation: validation, test: test)
|> Tune.score(:accuracy, fn row, out -> if out == row.expected, do: 1, else: 0 end)
|> Tune.vary(review_at: [50, 60, 70])
|> Tune.search(:grid)
|> Tune.tune()I will be deprecating `jido_eval` and `jido_evolve`, with guidance that they will be replaced with Tune. While Tune will be part of my Jido Ecosystem, it doesn't require Jido at all and sits closer to ReqLLM and LLM DB.
Appreciate any feedback!