LLM wrapper for structured data extraction
Top 25.8% on sourcepulse
Kor is a Python library designed for extracting structured data from text using Large Language Models (LLMs), particularly those without native tool-calling capabilities. It targets developers needing to parse unstructured text into predefined schemas, offering a flexible alternative to newer chat model APIs.
How It Works
Kor operates by generating a prompt that includes a user-defined schema and examples, sending it to a specified LLM, and then parsing the LLM's output. It supports two schema definition styles: Kor's own Object
and Text
definitions, and Pydantic models. This approach is advantageous as it works with any LLM capable of understanding prompts and generating text, regardless of whether they support advanced features like JSON mode or function calling.
Quick Start & Requirements
pip install kor
Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
Kor is a prototype with an unstable API and is known for being slow and potentially crashing on long text inputs due to context window limitations. Its extraction quality heavily relies on the quality of provided examples and schema documentation.
6 months ago
1 day