I have a vintage road bike, at the moment there are loose metal bearings in the hubs. Some of the bearings are missing. Can I buy cartridge bearings or do I need to buy loose bearings?
To use cartridge bearings, the hubs must have been designed to use them (absurd kludges aside).
Your hubs will almost surely be classic cup-and-cone hubs, and those will need replacement bearings.
However, do note that the proper number of bearings for a hub is not necessarily a number that completely 'fills' the cup bearing race. You might not be missing any. 9 is typically common, with a little bit of space where it looks as though you could fit a 10th or 11th. Check with your LBS for how many you'll need for your particular hub.
Generally when new there is room for about half a ball additional in the bearing race, but very quickly wear of the cup makes it look like a ball is missing. And a ball bearing assembly can function reasonably well with 2-3 balls actually missing (though this will cause faster wear).
The usual technique, when you don't know for sure if any balls have been lost (or how many) is to go for "full minus one" -- enough balls to fill the race, then take one out.
The balls are cheap and any decent bike shop will have them. (Take a ball or two with you for the shop to measure.) If you replace any balls, though, replace all of them, since the old ones will be worn and not have exactly the same diameter. (And always get 2-3 more than you need, since you'll always drop one or two and not be able to find them.)
I've found that normally there is an odd number of balls -- 9 or 11, eg. But there's no theoretical basis for this rule.
To use cartridge bearings you'd have to replace the hubs, or at the very least get a machine shop to machine the hubs to accept the cartridges (thought there's likely not enough "meat" to allow this).
I've had cartridge hubs in the past and they're not necessarily trouble-free. Cartridges were "the in thing" back maybe 1985, but now you only see them in cranks (where there is room to place a cartridge with no compromises). But if you want cartridge hubs, I believe Phil Woods is still the go-to company to get them (or was last I checked). (And note that the cartridge hubs will not look like standard hubs.)