LLM Plugin for Semantic Line Sorting

2025-02-12
LLM Plugin for Semantic Line Sorting

This command-line plugin leverages a Large Language Model (LLM) to semantically sort lines of text. Similar to the GNU `sort` command, but instead of alphabetical order, it ranks lines based on semantic relevance to a given query. Input can be from files or standard input. Users can customize the sorting method, output limit, model, and prompt template. A default prompt is provided, but customization is supported. Installation is straightforward: clone the code, create a virtual environment, and install dependencies.