Note: The current version uses the OpenAI API, but it should be adaptable to run on local models instead.