PromtEngineer/Gemma4-Visual-Agent ? reverse-engineered prompt

Reverse engineered prompt

Build me a local visual reasoning app for Apple Silicon that lets me upload an image or video and ask natural language questions about what is in it.

I want the app to use a vision language model for scene understanding and a segmentation model for exact object detection and counting, so it can answer things like how many cars are there, are there more people than dogs, or describe the largest object of a certain type. It should show the result step by step, including what model is being used, what it decided to do next, how long each step took, and the image with boxes or masks drawn on it.

Please also add a compare view that runs the same question two ways, one with just the vision language model and one with the full detection plus reasoning flow, so I can see the difference. If helpful, look up the current docs online for the models and MLX setup before wiring it together.