https://factoriobin.com/post/x4l8wj
Put the item you want to build in the constant combinator; The 5 assemblers below be set to the recipe for each quality level of the item.
By default each level will buffer 4-5 stacks of a item at a quality level, if the next level up isn’t full, start to drop items onto the belt for recycling. (We get to 4 stacks, when we are over 4 stacks, if we need to grind for quality, we will). If the higher level quality exists and is 4 stacks, we wont grind.
Request 5x the ingredients into the requestor chest for each assembler.
No quality modules on the legendary assembler.
Using buffers for the output to pull in any items from the network, including quality upgrades from different production quality levels (the legendary output on the epic production line will move to the legendary buffer)
You could make this more flexible by routing all the wires going to the assembler into a power pole, so replacing the assembler with a different crafter is easy.
Adding more throuput to lower quality teirs might be as easy as adding more crafters. Alternatively, each crafter might be able to become it’s own module, with just one wire connection to other modules and the initial combinators, and the quality be set arbitrarily on each module. If you need more throuput, you can just add another module.
The next step to that is setting the quality of the recipe based on need, with every module always working. Then adding more modules directly increase throuput with no extra thought required.
Pulling the stocked amount out into the constant combinator would be good for readability. Having a readout of stocked amounts might be fun too.