AI modules suddenly stopped working

That means your database user can’t run

https://github.com/discourse/discourse-ai/blob/main/lib/embeddings/vector_representations/base.rb#L154

on the Discourse database. I suggest checking your permissions.