Brave Search API + local Qwen — AI Luke companion

Install Python 3 and Ollama. Open Ollama, then open a terminal in the folder
containing brave_local_ai.py. The code uses Python’s standard library.

Download the model and check that Ollama can see it:
    ollama pull qwen3:4b
    python3 brave_local_ai.py --doctor

Open the Brave Search API dashboard, activate a plan with LLM Context, and
use a key belonging to that plan. A legacy Free key can reject LLM Context
even when its account has also activated Search. Keep the key off screen.
Check and ask prompt for the key with terminal echo disabled. If you already
supply it via your local secret manager as BRAVE_API_KEY, they will use it.

The fixed date below reproduces the question from the 9 November test. Search
results can change. Use today's date and compare against the publisher if
you want to answer the current question instead.

Ask with no web tool:
    python3 brave_local_ai.py --mode offline --question "What is the latest stable Blender release as of 09 November 2026? Give the version, release date and official Blender source. Distinguish stable from beta and LTS updates."

Test Brave alone (one LLM Context request):
    python3 brave_local_ai.py --mode check --question "site:blender.org/download/ Blender latest stable release"

Connect the same model and question to Brave (at most one LLM Context request):
    python3 brave_local_ai.py --mode ask --question "What is the latest stable Blender release as of 09 November 2026? Give the version, release date and official Blender source. Distinguish stable from beta and LTS updates."

The Python program executes Qwen's search request, sends the search query to
Brave, and supplies the passages to Ollama at 127.0.0.1. Identical queries in
one turn share one web request. Passages are used in memory. The source
list and local answer are printed in your terminal. Open the publisher’s
page and compare the answer with its dated claims. A matching link does
not establish that the release number or date is correct.
