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.1.2
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.0.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.

martosaur

martosaur

Released version 0.2.0 (Changelog) with a couple of bugfixes and simpler way to switch to a less strict json mode with OpenAI adapter.

martosaur

martosaur

I looked into Ollama and the implementation would depend heavily on the underlying open source model, so I don’t believe it makes sense implementing a universal adapter. However, I went ahead and created an example cookbook on how to implement your own Ollama adapter. It pretty much includes a functional adapter for llama3.1 model

Where Next?

Popular in Announcing Top

isaias-dias-machado
IEx’s h macro is great but it lacks a pager, so I built a small tool that caches documentation and lets you fuzzy search through it in yo...
New
RobinBoers
Renders Jinja templates, either from disk or defined at runtime, with support for all native Jinja features (including extends). It does...
New
MRdotB
Greetings Elixir community! Today, I’m thrilled to present you with resvg_nif, an open-source project that provides Elixir bindings for ...
New
roriholm
Hi! I just wanted to share my public release of something I’ve been working on. The Paradigm library provides some core utilities for a d...
New
rbino
Hey folks! I’m happy to introduce TigerBeetlex, an Elixir client for TigerBeetle, the financial transactions database. I’ve been working...
New
Antrater
Hi there! At Moon Design System, we have been working hard for the past six months on the next generation of our LiveView component libra...
New
corka149
A JSON patch is a way to define a sequence of manipulating operations on a JavaScript object. The IETF published the RFC 6902 - found he...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
fuelen
Hey folks! Want to present a toolkit for writing command-line user interfaces. It provides a convenient interface for colorizing text...
New
rodloboz
Sifter is a a query filtering library for Ecto. It lets frontend apps send human-readable query strings like: "elixir phoenix status:pu...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement