Per Application-Defined SQL Functions documentation, custom SQL functions can be marked as deterministic by setting SQLITE_DETERMINISTIC bit. This allows such functions to be used in certain contexts where they otherwise wouldn't be able to such as with the WHERE clause of partial indexes or in generated columns (https://www.sqlite.org/c3ref/c_deterministic.html#sqlitedeterministic).
As a point of reference, the better-sqlite3 library exposes this through the options argument in its Database#function() method. One more option that it exposes through this mechanism is SQLITE_DIRECTONLY bit so it may make sense to support that as well.