I am having the same problem, that is, replacing client.chat.completions.create which requires OpenAI with something open sourced. Have you been able to solve your questions? If so, could you please kindly share your solution? Thanks.
Reasons:
Blacklisted phrase (0.5): Thanks
Blacklisted phrase (1.5): Have you been able to
RegEx Blacklisted phrase (1.5): solve your questions?