What this covers: vision models, lossless compression, Docling and Unstructured, and image size. It also covers PDF layout, text parsing, and data sets that set the compression.
Do not send raw input to a vision model
So oftentimes we send like the input which comes from user, and then we will send it to vision model that okay, hey you read it and go for it. No, that's that can easily be avoided. Rather, most of the vision models are very good enough so you go for some of the lossless compressions and so on, so that you know you can send as minimal input as possible and still able to get output accordingly. That way you can able to control the cost in vision models, especially on document reading and understanding.
Why document parsers exist
The main reason why some of these repos like Docling and unstructured or these guys exist is mainly because you know vision model can do well. nowadays Qwen based vision models are very good enough, and they will be able to read and they will be able to provide output very well. But it can easily accumulate more and more when you are actually not controlling the input and directly putting it, putting the model to run everything, you need to make sure the layers of sending those information like you control what is the maximum amount of data that need to be sent and how you can achieve that without losslessness or what kind of input that is, and analyze that and send only the things which is needed that way you can able to control.
Compress images and read the layout
For example, many of the companies are doing you know, they are even reducing it to specific size of pixels because vision models are able to understand certain size of pixels, it doesn't need to be like a very large frame of picture, but you can compress it to a certain pixel or show and send it, and then you will be able to infer those instead of sending every PDF with 90 pages, for example, and sending the vision model to find what is in the PDF. You can either if it is text-based PDF or you wanted to you know read the layouting, you will first read the layouting and understand how the structure is split, and then send those accordingly. If you are able to parse without vision, then it is okay. If it is actually a PDF of multiple images, then you know per page you can have four images, then you it's better to go for per page four images rather than every image in a single page. So, those tactics, what you need to do in terms of reducing the input quality without compromising on the output quality is something you need to build when you are actually building your agent, and how you can measure that it comes with your data set.
Let your data set decide
So, when you are preparing that data set, you need to prepare, like okay, what is the best case? What is the worst case, and what amount of compression that is needed, whether it is needed or not, those choices that your code need to dictate, and then you will be able to plan. So, this is purely an architectural problem rather than rather than models capability.