martosaur
Handwave is a thin wrapper around InstructorLite that makes it simpler to use vague handwaving in your apps.
It comes with 3 built-in providers (Handwave.OpenAI, Handwave.Claude and Handwave.Gemini) and behaviour to define your own.
Here’s its whole API surface:
- Use
llm_ifwhen you can’t come up with a regularif:
import Handwave.OpenAI
llm_if user_email, "looks suspicious?" do
{:error, :blocked}
else
create_user(user_email)
end
- Use
llm_rewritewhen you just need thatterm() -> 🧠🪄✨ -> stringfunction:
iex> llm_rewrite(
%Req.Response{status: 401, body: "session token expired"},
"Tell user what to do without technical details"
)
"Your session has expired. Please log in again to continue."
- Use
llm_routewhen you want LLM to just figure out what to do:
import Handwave.OpenAI
@impl Oban.Worker
def process(job) do
# do things
catch
kind, error ->
formatted = Exception.format(kind, error, __STACKTRACE__)
formatted
|> llm_route([:snooze, :cancel, :error], "Snooze if it makes sense to try later, cancel if it's a lost cause, otherwise just error")
|> case do
:snooze -> {:snooze, 60}
:cancel -> {:cancel, error}
_ -> {:error, formatted}
end
end
Have fun.
- Hex
- Repo
Trending in Announcing
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub.
Docs are at OpenaiEx User Gu...
New
WebAuthnLiveComponent WebAuthnComponents
See this post about renaming the package.
Passwordless authentication for Phoenix LiveView app...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
I’ll shortly be launching Text, a nascent text analysis library.
Current functionality
In this early version (not ready for prime time) ...
New
Following on from my CLDR lbraries I started work on Unicode transforms. But like everything related to CLDR there is a lot of yak-shavin...
New
Other Trending Topics
We have 4 in-person tickets to Code BEAM Europe 2026 (21-22 October, PHIL Haarlem) to give away:
1 diversity ticket (sponsored by AppSi...
New
Happy Friday, all! :slight_smile:
Our October meetup is coming up next week - Wednesday, October 14th at 19h CET via Zoom! This month we...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #ai
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
FlyingNoodle
llm_if← this is a joke right? Are we really at that point?DaAnalyst
I actually like this, specially the
llm_rewrite.llm_ifcould be useful for non- too-deterministic cases, such as branching in video games.martosaur
That were exactly my thoughts that led me to making this package, but ultimately, I came to realization that this is a useful library (that’s why I released it). Structured outputs for LLMs enable embedding small bits of intelligence in conventional application code and at this point I can’t help but admit that sometimes this is useful. Admittedly, examples in the readme are silly, because they have to be small and because I chose a playful tone for the library as a way to cope with new reality. But in real life I use this type of stuff to determine, for example, if user wants to do a “broad” search or “focused” one and trigger different search pipeline based on perceived intent.
I agree that this can be an absolutely cursed way to do things in the wrong hands. I’m not too worried though as it seems like nobody it writing code by hand these days and Claude won’t use this library.
felixbr
I love this
Initially wasn’t sure if it’s satire or not but maybe we’re at the point where that doesn’t matter anymore.