What is the best way to decrypt LoRaWAN frames on embedded hardware?

We’re torn between running Chirpstack in the cloud or on a Gateway.

Chirpstack requires an RDBMS, Redis, and a lot of resources that are better located in a scalable and more manageable cloud environment than on the limited resources of an embedded Gateway device.

However, the internet is unreliable. In our application, if we lose connectivity between the gateway and the cloud, it is critical that some LoRaWAN frames are processed and actioned LOCALLY on site.

Is there any “official” lightweight (at least no database) Chirpstack packet decryption module/library/server we can deploy on a Gateway so that we can decrypt LoRaWAN frames and act of them without a full blown Chirpstack instance, or are we resigned to writing our own packet decryptor (with some messiness around dev_addr changes) - which seems off the beaten track and a duplication of perfectly good Chirpstack code?