mikehostetler

mikehostetler

ReqLLM – Composable LLM client built on Req

ReqLLM v1.27.0

I’m especially excited about this release because it brings the OpenAI Decisions API into ReqLLM through the new ReqLLM.evaluate/4 function.

I also want to highlight ReqLLM’s callback-based Model Routing API. It lets an application select a model at request time without putting a fixed routing policy inside ReqLLM.

OPENAI DECISIONS API

Use an evaluation-capable model to ask named boolean, choice, and score questions about text or JSON-compatible state.

questions = %{
  queue: %{
    type: :choice,
    instructions: "Which team should handle this?",
    criteria: %{
      billing: "Billing and refunds",
      support: "Technical help"
    }
  },
  urgent: %{
    type: :boolean,
    instructions: "Does this need immediate action?"
  }
}

{:ok, decision} =
  ReqLLM.evaluate(
    "openai:gpt-6-luna",
    %{ticket: "Refund me today"},
    questions,
    provider_options: [openai: [safety_identifier: "tenant-123"]]
  )

decision.object["queue"]["choice"]
decision.object["urgent"]["probability"]

The safety_identifier option is optional. Answers remain keyed by question name. The full provider response remains available in decision.provider_meta.raw_response.

LLMDB is the source for model eligibility. ReqLLM.evaluation_models/0 lists the evaluation models that ReqLLM can call.

CALLBACK MODEL ROUTING

Pass a router struct to a normal ReqLLM generation function. ReqLLM normalizes the request, calls resolve/2 once, and continues through the selected model’s standard provider path.

defmodule MyApp.ModelRouter do
  @behaviour ReqLLM.Router

  defstruct fast: "openai:gpt-6-luna",
            deep: "openai:gpt-6-sol"

  @impl true
  def resolve(router, %ReqLLM.Router.Request{routing_context: context}) do
    model = if context[:depth] == :deep, do: router.deep, else: router.fast
    ReqLLM.model(model)
  end
end

router = struct(MyApp.ModelRouter)

{:ok, response} =
  ReqLLM.generate_text(
    router,
    "Explain OTP supervision",
    routing_context: %{depth: :deep}
  )

ReqLLM.Response.text(response)

The application owns the routing policy. The callback can use local rules, an evaluation model, or another service. ReqLLM passes routing_context through unchanged.

The same routing contract works with generate_text, stream_text, generate_object, and stream_object.

OTHER CHANGES

  • Azure Chat Completions log-probability support
  • Gemini 3 object output when tools are present
  • A bounded JSON Schema validator cache with FIFO by default and optional LRU or custom eviction
  • Safer redaction of unknown provider reasoning payloads
  • Correct OpenAI anonymous authentication and exact streaming model identity
  • Responses API refusals decoded as text with a content_filter finish reason
  • A fix for non-streaming connection-pool timeouts
  • Contract hardening for streaming, tools, telemetry, usage, billing, URL selection, and timeout cleanup

Thanks to Arton Ragsdale, mvanhorn, Wu Shuwen, Justin Smestad, and Nickjgniklu for their work in this release.

LINKS

Where Next? Top

Trending in News & Updates Top

mat-hek
Popcorn, the library that runs Elixir code in the browser, is now stable :popcorn: This is possible because it now builds on a very stab...
New
bartblast
Hologram UI is in the works - the official component library for Hologram - and the waiting list is now open. A common reaction when I m...
New
bartblast
This thread is for updates on the Hologram website (docs, new pages, roadmap, feature status, etc.). You can watch this thread to get no...
New
mandar1045
Stampede 1.2 is out, and I finally got to try it at a bigger scale. What’s new --find-limit: instead of a fixed number of users, it add...
New
uzaydurdu
Hey Elixir folks, I’ve been working on Xenia 0.2.0, and it’s nearly ready. This release focuses on performance, easier integration, and...
New
rodloboz
Hi all, I’ve just released Sake 0.5.0, and I want to explain better what it’s for, because I think many Phoenix apps can use it now. Wh...
New
Potions
I’m working to make Potions the easiest way to deploy Elixir applications, and the next step in that journey is live: you can now bring y...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
raa-ziq
Hi everyone :waving_hand: I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews