Discover and explore top open-source AI tools and projects—updated daily.
thmsmlrElixir library for structured LLM outputs
Top 46.4% on SourcePulse
This Elixir library, instructor_ex, enables structured data output from Large Language Models (LLMs) by leveraging Ecto schemas. It targets Elixir developers seeking to integrate LLM capabilities into their applications, providing a robust way to ensure LLM responses are not only correctly formatted but also semantically valid through Ecto's validation system.
How It Works
The library acts as a spiritual port of the Python Instructor library, abstracting the complexity of JSON schema generation. Instead, it uses Elixir's Ecto schemas, including @llm_doc attributes for LLM descriptions and validate_changeset/1 functions for validation rules. The use Instructor macro integrates these schemas, allowing Instructor.chat_completion/1 to request structured responses directly mapped to Ecto schemas. The max_retries parameter facilitates automatic iterative correction of LLM output based on validation failures.
Quick Start & Requirements
Mix.install([:instructor]) or add {:instructor, "~> 0.1.0"} to mix.exs.Highlighted Details
Maintenance & Community
thmsmlr.Licensing & Compatibility
Limitations & Caveats
The library is in its early stages (v0.1.0), indicating potential for breaking changes and missing features. The lack of explicit licensing information could be a concern for commercial adoption.
4 months ago
1+ week
dzhng
eyurtsev
zjunlp
BoundaryML
microsoft
katanaml
pydantic