"""Talk to a model running on your own computer, in about ten lines.

Before you run it:
    1. Install Ollama and start it (see https://ollama.com/download).
    2. Download a model:   ollama pull olmo-3:7b-instruct
    3. Install the library: pip install ollama

Run it:
    python hello_local.py
    python hello_local.py "Explain what a Python dictionary is in two sentences."

Dedicated to the public domain under CC0 1.0.
"""
import sys

from ollama import chat

MODEL = "olmo-3:7b-instruct"
question = " ".join(sys.argv[1:]) or "In one sentence, why is Python popular for working with data?"

response = chat(model=MODEL, messages=[{"role": "user", "content": question}])
print(response.message.content)
