https://github.com/AlexsJones/llmfit gives a good approximation of that.