Skip to content

req\_llm

Elixir library for unified LLM calls across providers, with an evaluate interface that calls Jev via TypeSafe or OpenRouter.

ProjectproductionApache-2.0

Overview

ReqLLM is a Req- and Finch-backed Elixir package that standardizes requests and responses across LLM providers, with a Vercel AI SDK-inspired high-level API (generate_text, stream_text, generate_object and more). It draws on the LLMDB catalog, exposing over 1,200 models across 21 provider integrations, including non-text operations such as embeddings, image generation, speech, transcription, rerank and OCR, with a large recorded fixture suite.

For decision models, ReqLLM has an evaluate function. ReqLLM.evaluate("typesafe:jev-latest", state, questions) sends typed questions to TypeSafe, and the same call can route through OpenRouter (for example typesafe/jev-1.13 or ~typesafe/jev-latest) or OpenAI's endpoint depending on which key is set. Jev also supports score questions with an ordered criteria list. That lets Elixir applications use Jev alongside generative models behind one interface.

What the decision model decides

TypeQuestionAnswers
ChoiceTyped questions passed to ReqLLM.evaluate, e.g. classifying 'Refund me today'—
ScoreOrdered-criteria score questions—

How it works

  1. Set TYPESAFE_API_KEY, OPENROUTER_API_KEY or OPENAI_API_KEY
  2. Define typed questions in Elixir
  3. Call ReqLLM.evaluate with a provider:model spec and state
  4. Pattern-match the typed answers

Strengths

  • One Elixir interface for generative and decision models
  • Can reach Jev via TypeSafe or OpenRouter
  • Large recorded fixture suite

Caveats

  • Jev is a small part of a broad library
  • Evaluate details beyond the README examples not shown

Getting started

Add req_llm from Hex, set TYPESAFE_API_KEY, then ReqLLM.evaluate("typesafe:jev-latest", state, questions).

At a glance

Type
Project
Status
production
Language
Elixir
Runtime
Elixir library
Has code
yes
Has tests
yes
License
Apache-2.0

Use cases and integrations

How curated lists describe it

Frequently asked questions

How do I call Jev from Elixir?

Use ReqLLM.evaluate("typesafe:jev-latest", state, questions) with TYPESAFE_API_KEY set.

Can I use OpenRouter instead?

Yes, with model specs like openrouter:typesafe/jev-1.13.

Does it support score questions?

Yes, with an ordered criteria list.

Related projects

  • Ax, a DSPy-style multi-language LLM framework, listed with a native TypeSafe provider for Boolean, Choice, Score and raw Jev questions.

    PluginproductionTypeScript
  • Effect TypeScript library whose @effect/ai-typesafe package maps classify, probability and rating operations to Jev questions.

    ProjectproductionTypeScript
  • PHP monorepo whose Polyglot module adds a TypeSafe driver for typed Noul, Choice and Score decisions alongside LLM inference.

    ProjectproductionPHP
  • Self-hosted multi-tenant AI agent platform listed as including optional TypeSafe client tools for classification, scoring and yes/no.

    LibraryproductionPython
  • Provider-agnostic TypeScript AI SDK; per list sources, an @tanstack/ai-typesafe adapter exposes Jev decisions through decide().

    ServiceproductionTypeScript
  • TypeSafe Jev provider for the SwiftDecision framework, returning validated probability distributions through its DecisionBackend protocol.

    ProjectbetaSwift