A building management system for generating a building model for a building and operating building equipment of the building based on the building model, wherein the building management system comprises a processing circuit configured to: - receive a context , wherein the context comprises metadata defining the building model for the building; - generate a building model editor interface for viewing and editing the received context , wherein the building model editor interface comprises building elements for the building model, wherein the building elements are based on the received context and represent the building equipment; - receive user edits of the context via the building model editor interface, wherein the user edits comprise placement of building elements, connection between the building elements and editing of attribute options for the building elements; - generate an updated context based on the user edits of the context ; and - deploy the updated context to control environmental conditions of the building with the building equipment based on the updated context , and wherein the processing circuit is further configured to: - generate an optimization problem, and optimization constraints for the optimization problem, based on the placement of building elements, the connection between building elements, and the editing of the attribute options, wherein the optimization constraints include at least one of a power inequality constraint based on equipment limits defined by the context and an energy balance constraint based on the connections between the building elements defined by the context; and - perform the optimization with the optimization constraints to generate control settings for the building equipment of the building and control the building equipment based on the control settings. - receive a context , wherein the context comprises metadata defining the building model for the building; - generate a building model editor interface for viewing and editing the received context , wherein the building model editor interface comprises building elements for the building model, wherein the building elements are based on the received context and represent the building equipment; - receive user edits of the context via the building model editor interface, wherein the user edits comprise placement of building elements, connection between the building elements and editing of attribute options for the building elements; - generate an updated context based on the user edits of the context ; and - deploy the updated context to control environmental conditions of the building with the building equipment based on the updated context , and - generate an optimization problem, and optimization constraints for the optimization problem, based on the placement of building elements, the connection between building elements, and the editing of the attribute options, wherein the optimization constraints include at least one of a power inequality constraint based on equipment limits defined by the context and an energy balance constraint based on the connections between the building elements defined by the context; and - perform the optimization with the optimization constraints to generate control settings for the building equipment of the building and control the building equipment based on the control settings. <EOS>