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

danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: GitHub - tmbb/phoenix_ws: Websockets implemented over Phoenix Ch...
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
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
blatyo
The best overview for how things are tied together is this presentation. Modules and functions are pretty well documented at this point, ...
New
mbuhot
Leverage Open Api 3.0 (Swagger) to document, test, validate and explore your Plug and Phoenix APIs. Generate and serve a JSON Open API ...
New
RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 12673 134
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
versilov
Could not wait for the missing Elixir ML libraries to appear, so, I wrote one myself, taking https://github.com/sdwolfz/exlearn as a foun...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New

Other popular topics Top

New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
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
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement