Sort by Weight with an LLM¶
Write a program in your preferred programming language that sends the following prompt to an LLM (e.g. a locally hosted LLM executed using Ollama):
Please sort the following objects by weight from lightest to heaviest: pencil, book, paperclip
and asks the LLM to respond only with a JSON document structured as follows:
Your program should:
- Send the prompt to the LLM.
- Receive the JSON response.
- Parse the JSON to extract the ordered list of objects.
- Print the ordered objects to standard output as follows:
Upload your solution in a GitHub repository, include a README file with clear instructions on how to set up and run your program, and then share the repository with me.
Last update:
November 24, 2025