Settings

Theme

Show HN: LLM Sorter – Python package to sort lists of items using LLM calls

github.com

1 points by dkalola 3 months ago · 2 comments · 1 min read

Reader

Just a quick experiment I thought of building. Limited practical usage, for sure.

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.

dmarwicke 3 months ago

this has to be insanely expensive right? merge sort does n log n comparisons, so sorting 100 items is like 600 llm calls

  • dkalolaOP 3 months ago

    Yes, that's right. This is not a practical approach given current LLM limitations. But perhaps in the future if the cost of each individual call decreases, and if latency decreases (and models run locally), but context window remains limited this approach could be more useful as it uses pairwise comparisons rather than loading the entire context window.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection