Machine learning models often treat predictions as unconstrained points, although real outputs must satisfy semantic constraints: trajectories should avoid obstacles, physical quantities obey laws, and engineering designs must be feasible. To represent predictive uncertainty while respecting constraints, probabilistic algebraic layers compositionally combines unconstrained probabilistic predictions with domain-specific algebraic constraints, restricting their support to outputs that satisfy these constraints. However, exact normalization becomes inefficient as dimensionality grows. To overcome this limitation, we design a new family of plug-and-play differentiable prediction layers, CiPAL, that exploit structure common in real-world constrained problems: constraints often involve only subsets of variables; their feasibility boundaries are usually spatially localized; as well as data, requiring to deal with constraints in an adaptive way. We showcase CiPAL on real-world applications in trajectory prediction and optical engineering, where it outperforms existing methods in both log-likelihood and point-prediction metrics, while guaranteeing the satisfaction of the constraints.