llm-sorter

A Python library that uses LLMs as comparators for semantic sorting. Sort any list by meaning, tone, complexity, urgency, or any criteria expressible in natural language. This library uses an OpenRouter API key to interface with LLM providers.

Installation

pip install llm-sorter

Requires Python 3.10+

Quick Start

from llm_sorter import LLMSorter

sorter = LLMSorter(api_key="your-openrouter-api-key")

# Sort by reading complexity
passages = [
"The quantum entanglement phenomenon demonstrates non-local correlations...",
"The cat sat on the mat.",
"Climate change affects global weather patterns in complex ways."
]
result = sorter.sort(
items=passages,
prompt="Sort by reading level, simplest first"
)

# Sort support tickets by urgency
tickets = [
"Lo...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help