Who manufactured all the standardized arms and armor for the Roman legions?

by Hadadezer

Were there large state owned smithies producing helmets, gladii and loricas in batches of hundreds?

Did the state contract private manufacturers across the empire and provide standardized blueprints?

Was it a bit of both in ad hoc?

Tiako

You hit on the correct answer in that it was a bit of both and ad hoc, but I will start with a fun illustrative passage from Cassius Dio about the lead up to the bar Kokhba Revolt in Jerusalem (69.12):

At Jerusalem [Hadrian] founded a city in place of the one which had been razed to the ground, naming it Aelia Capitolina, and on the site of the temple of the god he raised a new temple to Jupiter. This brought on a war of no slight importance nor of brief duration, for the Jews deemed it intolerable that foreign races should be settled in their city and foreign religious rites planted there. So long, indeed, as Hadrian was close by in Egypt and again in Syria, they remained quiet, save in so far as they purposely made of poor quality such weapons as they were called upon to furnish, in order that the Romans might reject them and they themselves might thus have the use of them;[emphasis mine] but when he went farther away, they openly revolted.

The first reason I used this is because it is just a solid scheme, which everyone loves, but it also is useful in understanding how the army operated in the provinces. Dio Cassius was born about two decades after the revolt and had no first hand knowledge of it, he also did not spend much time in describing it so he probably had no particular expertise on its details, but he had served in several high ranking provincial posts in the empire, which had dual civil and military functions, thus he was personally acquainted with how the army functioned. The story might not be true (I choose to believe it is) but its details would at least be plausible enough to Cassius Dio that he would relay it, and thus we can assume that the army would indeed have civilians manufacture its equipment, whether through contracting or coercion, and that this was done to standards.

However the army was also capable of doing a fair amount of its own crafting. The immunes were a class of soldiers who had specialized skills and were thus exempt for ordinary duties, these included surveyors, doctors, and hunters, but also blacksmiths, carpenters and other skilled craftsmen. Forts would have workshops (fabricae) and while these were probably mostly occupied by maintenance of equipment there is no reason to this they would not also do some manufacture. Later in the empire during the fourth century these expanded into centralized factories (also called fabricae) that served entire regions and were managed by civil servants. This has been discussed in previous answers, there is also some debate about how extensive the operations of these fabricae actually were, but I do not really feel confident in wading into that debate myself.

But even the most maximal interpretations of late imperial fabricae would not say that they were comparable to something as organized as weapons production under the Song Dynasty. The Roman empire in general was somewhat shoestring, the stick of its army and its shocking capacity for destruction overlaid a general use of co-option and autonomy.

reaperkronos1

The other answer here is excellent, I just wanted to add a little blurb about the ad hoc aspect of Roman military logistics.

I’m contrast to state-sourced manufacturing, which as u/Tiako mentioned intensified in the fourth century, private sourcing remained relatively constant throughout. The most recognizable part of this system were the Publicanii, wealthy equites who took government contracts to provide a service to the government. This could range from the civil, like tax collection and construction, to the military, like arms provisioning and feeding troops. While the specific Publicanii system did wane as the emperors centralized Rome’s bureaucracy, the practice of using “private” individuals to provide supplies continued, this time with the government (in the form of a civil/military officer) as the sole buyer instead of a private intermediary.

At the same time as these wealthy Publicanii would have been taking on government contracts, a significant chunk of military logistics would depend on the local context. Roman legions stationed on the Rhine for instance, might source their grain and beer from Northern Gaul and lands beyond the frontier. Though the merchants selling them food would likely not have been Publicanii, they nonetheless fulfilled the exact same function, just at a smaller more agriculturally-focused level.

As u/Tiako mentioned, Roman organization could be very as hoc and shoestring. Not to delve into topics beyond the scope of your question, but you can notice a similar situation when looking at administration from the principale to the dominate. In the principate, the emperor might have a staff as small as 300 to run the empire with, a surprisingly low figure. In the provinces, local elites were expected to provide their own staffs for government positions, generally drawing them from their household. Just like with military logistics there was an eclectic blend central authority and vast local autonomy that combined to create a difficult to understand system of organization.