This directory contains examples of using Ollama with Python. Some of you might be wondering: What is Ollama? It's a tool that allows you to use LLMs locally. Once Ollama is installed and a large language model (LLM) has been downloaded, you can use that model in the terminal. Ollama also has a simple graphical interface (similar to ChatGPT).
This blog post describes how to install Ollama on a Mac. The procedure shown should be very similar under Linux and Windows.
The first example (ollama-api.py) demonstrates how to access Ollama's HTTP endpoint. A request is sent to a local model via this endpoint. The response is displayed in the terminal and saved to the file generated_output.md (Markdown format).