trex  by automorphic-ai

Enforce 100% structured LLM output

Created 2 years ago
251 stars

Top 99.9% on SourcePulse

GitHubView on GitHub
Project Summary

Trex addresses the challenge of reliably extracting structured data from Large Language Models (LLMs). It targets developers and data engineers who require deterministic, schema-compliant output from LLM generations, offering a significant benefit by guaranteeing data conformity through user-defined grammars.

How It Works

Trex transforms unstructured text into structured data by leveraging user-specified regular expressions (regex) or context-free grammars (CFG). The system intelligently restructures LLM outputs to precisely conform to the defined schema, ensuring predictable and usable structured data. This approach provides a robust mechanism for enforcing data integrity post-generation.

Quick Start & Requirements

  • Installation: pip install git+https://github.com/automorphic-ai/trex.git
  • Prerequisites: Requires an API key obtained by signing up at automorphic.ai.
  • Experimentation: A playground is available for trying out Trex.
  • Self-hosting: Contact via email for self-hosting inquiries.

Highlighted Details

  • Enforces structured JSON generation.
  • Supports structured custom CFG generation.
  • Enables structured custom regex generation.
  • Features generation from JSON schema.

Maintenance & Community

Join their Discord server or follow on Twitter for updates, discussions, and contributions. For assistance or inquiries, contact them via email.

Licensing & Compatibility

The repository's license is not explicitly stated in the provided README. Compatibility for commercial use or closed-source linking is therefore undetermined.

Limitations & Caveats

Features such as auto-prompt generation for unstructured ETL and integration with more advanced models are listed as future work, suggesting current reliance on manual prompt engineering and existing model capabilities. Self-hosting requires direct engagement with the developers.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Starred by John Resig John Resig(Author of jQuery; Chief Software Architect at Khan Academy), Sasha Rush Sasha Rush(Research Scientist at Cursor; Professor at Cornell Tech), and
2 more.

llmparser by kyang6

0%
429
LLM tool for structured data extraction and classification
Created 3 years ago
Updated 2 years ago
Feedback? Help us improve.