martosaur

martosaur

InstructorLite – structured outputs for LLMs, a tinkering-friendly fork of Instructor

Hello,

I’m excited to introduce InstructorLite – a fork of the Instructor package.

Instructor brought the very idea of structured LLM prompting to the Elixir ecosystem. InstructorLite is aimed to distill it into a composable set of simple tools that people can build upon.

What’s new in InstructorLite 0.1.0 compared to Instructor 0.0.5?

  • More granular API for more flexibility
  • Anthropic adapter
  • Reduced source code complexity
  • All streaming capabilities removed
  • BYO json schema as an official policy. Schema converter is still there, but it’s best-effort
  • Llamacpp adapter now uses JSON schema instead of GBNF grammar
  • OpenAI adapter is reimplemented using brand new structured outputs instead of JSON mode (Introduction to Structured Outputs)
  • Fixed Ecto 3.12 compatibility

It’s not a drop-in replacement, but it’s very close. Feel free to report any issues you run into if you decide to give it a try!

Hex: instructor_lite | Hex
Migration guide: Migrating from Instructor — instructor_lite v1.2.0
Repo:

https://github.com/martosaur/instructor_lite

Most Liked

martosaur

martosaur

InstructorLite v1.0.0

  • OpenAI adapter was changed to use Responses API.
  • New ChatCompletionsCompatible adapter was added for people who want to continue using OpenAI Chat Completions endpoint or, as the name suggests, other chat completions compatible providers like Grok.
  • Jason dependency is now optional. InstructorLite will use built-in JSON module if it’s available
  • Some general housekeeping: more tests, revamped docs and cookbooks, standardized prompts across adapters, etc. All adapters were tested against reasoning models to verify reasoning tokens in output do not surprise them.

A very short migration guide: Changelog — instructor_lite v1.2.0

martosaur

martosaur

Version 0.3.0 released featuring Gemini adapter :tada:

igorb

igorb

Appreciate your work! I just returned to a project using Instructor today and bumped into the compatibility issue with Ecto 3.12. Tried the fork that attempted to fix it but it didn’t work (bummer that instructor doesn’t seem to be maintained anymore!). But migrating to instructor_lite was a breeze and everything works great now.

Where Next?

Popular in Announcing Top

mathieuprog
Hello :waving_hand: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First a...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New
tmbb
I’ve published the first version of my Makeup library. It’s a syntax highlighter for Elixir in the spirit of Pygments, Currently it highl...
New
Crowdhailer
The latest release of Ace (0.10.0) includes serving content over HTTP/2. I have started writing a webserver to teach my self more about...
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 14206 119
New
Jskalc
Hi! Today, after a couple weeks of development I’ve released v0.1 of LiveVue. It’s a seamless integration of Vue and Phoenix LiveView, i...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
zachdaniel
Ash Framework What is Ash? Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement