This paper presents two coupled software packages which receive widespread use in the field of numerical simulations of Quantum Chromo-Dynamics. These consist of the BAGEL library and the BAGEL Fermion sparse-matrix library, BFM.The Bagel library can generate assembly code for a number of architectures and is configurable -supporting several precision and memory pattern options to allow architecture specifig optimisation. It provides high performance on the QCDOC, BlueGene/L and BlueGene/P parallel computer architectures that are popular in the the field of lattice QCD. The code includes a complete conjugate gradient implementation for the Wilson and Domain Wall fermion actions, making it easy to use for third party codes including the Jefferson Laboratory's CHROMA, UKQCD's UKhadron, and the Riken-Brookhaven-Columbia collaboration's CPS packages.