← All labsLab 01 / Python / Ollama

Local Notes Assistant

Summarise synthetic operations notes through a bounded local model call, with validated JSON and a model-free fixture path.

What the demonstration does

Reads a bounded notes file, asks the local model for a summary and actions, checks the response schema, and optionally writes a local JSON result. It does not send messages or update a task system. The included notes are synthetic.

Run the fixture path

Download and extract the archive, then run from its root:

python3 -m labs.local_notes.main --fixture
python3 -m unittest discover -s labs/tests -v

Fixture mode uses a canned response and labels it explicitly. It exercises application handling without making an inference-performance claim.

Connect Ollama

Install and start Ollama following the official platform guide, then:

ollama pull qwen3:4b
python3 -m labs.local_notes.main --output runs/notes-result.json

The helper calls the loopback API with a timeout, bounded context/output, and JSON mode. It rejects unexpected fields and invalid types. A schema-valid response still needs factual review before it becomes an action.

Verification and boundaries

Model-free tests cover input limits, malformed responses, JSON parsing, and schema validation. Live Ollama inference was not tested in the initial release. The separate Delivery-Note Model Lab uses MLX; its timings do not establish this model’s performance.

The source archive includes the program, synthetic input, shared helper, tests, and a README. Python’s standard library is sufficient for the fixture path.

Extend carefully

Before using real notes, agree on the data boundary and operating setup. For a batch process, add a checksum-based input manifest, bounded retries, a rejection queue, and reviewed output. Keep task creation or distribution as a separately approved step.