There is probably use for go-skynet/LocalAI[0] or lm-sys/FastChat[1] which can emulate an OpenAI API using local models.
0: https://github.com/go-skynet/LocalAI 1: https://github.com/lm-sys/FastChat/
Edit: idk if any of this support function calling tho