  We introduce two constructions to obtain left-invariant Ricci-flat
pseudo-Riemannian metrics on nilpotent Lie groups, one based on gradings, the
other on filtrations, both depending on the combinatorics of the set of
weights.
  As an application, we show that every nilpotent Lie algebra of dimension up
to $7$ and every nice nilpotent Lie algebra of dimension up to $9$ admit an
indefinite Ricci-flat metric.
