Finally got the PDF OCR flow working, and the LLM can now solve math problems. Only grey diagrams are still hard for it to recognize properly.
I used a math training exam that my son is currently working on in preparation for Gymnasium.
And even the 27B model is sufficient to solve this level of math.