Starfleet is the Federations military, as is shown by the uniforms, rank, hierarchy, armament, organisation, etc. But the remit of Starfleet is far greater than any present day one, and is only really a fully mobilised armed force when at war--most of the time I think they could be called peacekeepers.
It's militarised when it needs to be and not when it doesn't. Suits me just fine thanks
Commander Austin Harris, First Officer, Deep Space Nine (by FltCpt. Bossco)
8.01 - Darkest Before Dawn
(Chapter 8 added, 12/09/2015)