I've built rely, which is a framework for building very custom relays.
It's not plug and play but you can do anything with it.
https://github.com/pippellia-btc/rely
If you choose to try it and find some issues or the docs aren't clear, let me know, I'll gladly help!