Constant combinator reading full belt, decider combinator sending an activation signal to an inserter with a filter determined by how much you want to keep. Inserter dumps off the side. It's how my space platform is running right now.
There are many ways to solve for this problem. For my science platform, I have a priority splitter on iron plates going to science production. Anything that takes the other path goes into cargo and gets sent down.
I couldn't find a vanilla method to limit sending stuff down though, so that can be an issue. For iron, it isn't a problem. I was making far more space science packs than I could consume though and they started building up in my logistics storage. I downloaded Earendel's AAI Signal Transmission mod to allow sending requests to the station. If anyone know a vanilla method to handle this, I'd love to know it, but I couldn't find it. It feels like it should exist.
I think that would require more circuit wizardry than I know how to apply, but the new selector combinator is probably where you want to start. You'll want to try to set a request at the drop platform based on the contents of the space platform.
Drop off the edge with an inserter. I feed everything into the hub. Then I have an inserter set to read the hub for each chunk type. If it's greater than 5 it gets thrown overboard. For production it's the same just disable the factory when there is enough. That prevents build ups.