Expand description
§Vibesort
A Rust library for sorting arrays using Large Language Models (LLMs).
This library provides a simple interface to sort arrays by leveraging LLM APIs such as OpenAI, Anthropic, or other compatible services. It sends the array to the LLM and parses the sorted result.
§Features
- Sort arrays of any type that implements
Display,Serialize, andDeserializeOwned - Support for any LLM API compatible with OpenAI’s chat completion format
- Comprehensive error handling with detailed error messages
- Async/await support using Tokio
§Example
use vibesort_rs::Vibesort;
let sorter = Vibesort::new(
"your-api-key",
"gpt-3.5-turbo",
"https://api.openai.com/v1",
);
let numbers = vec![3, 1, 4, 1, 5, 9, 2, 6];
let sorted = sorter.sort(&numbers).await?;
println!("{:?}", sorted); // [1, 1, 2, 3, 4, 5, 6, 9]Structs§
- Vibesort
- Client for sorting arrays using LLM APIs.
Enums§
- Vibesort
Error - Error types for vibesort operations.