The Buildings library is a freely available Modelica library that is based on Modelica.Fluid. It contains component models for building heating, ventilation and air conditioning systems. It also contains an interface that allows co-simulation with the Ptolemy software framework for concurrent, real-time, embedded systems developed by the University of California at Berkeley. The primary applications are controls design, energy analysis and model-based operation. The library has been used to model hydronic space heating systems, variable air volume flow systems and it has been linked to the EnergyPlus building energy simulation program for co-simulation using Ptolemy II. The library contains dynamic and steady-state component models that are applicable for analyzing fast transients when designing control algorithms and for conducting annual simulations when assessing energy performance. For most models, dimensional analysis is used to compute the performance for operating points that differ from nominal conditions. This allows parameterizing models in the absence of detailed geometrical information which is often impractical to obtain during the conceptual design phase of building systems.