Show HN: LLM Sorter – Python package to sort lists of items using LLM calls
github.comJust 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. this has to be insanely expensive right? merge sort does n log n comparisons, so sorting 100 items is like 600 llm calls 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.