Chart Question Answering Agent with Vision Language Model and Python

Can a small vision model on a laptop answer questions about charts, if it only reads the chart and Python does the arithmetic? This project builds a Pydantic AI agent: granite3.2-vision:2b turns the chart into a validated table, qwen2.5:3b writes Python that runs in a sandbox, errors go back for repair, and read-off answers are cross-checked. Both models run in local Ollama on a laptop with RTX 2050 4 GB (Ryzen 7, 8 GB RAM).

NOTE: Research and teaching demo on a public benchmark, run with small local models on a laptop. Answers can be wrong: check them against the chart before you use them. Uploaded images stay on this computer and are deleted after the request. Model-written code runs in a separate process with a time limit, a memory limit, no sockets and no file writes outside its temp folder, after an import allow-list check. This is defence in depth for a local demo: a Python-level allow-list and audit hook are NOT a security boundary against a determined attacker.

Category: Department of Computer Science and Engineering / Agent Development

Agent Development Project AG23 from ProTechSC Academy, with graphical abstract, video demonstration and project guidance.