We built an open-source AI SDK (Python & JavaScript)that provides a drop-in replacement for OpenAI’s chat completion endpoint.
Let us know what you think so we can make switching as easy as possible and get more folks on open-source.
If you haven't seen us here before, we're PostgresML, an open-source MLOps platform built on Postgres. We bring ML to your data(base) rather than the other way around. We're incredibly passionate about keeping AI truly open. So we needed a way for our customers to easily move off of OpenAI's closed models. Especially now that there are better performing models, anyways.
You can check out the doc linked or the blog post from when we first released it, but here's the git diff:
- from openai import OpenAI + from pgml import OpenSource AI
We built an open-source AI SDK (Python & JavaScript)that provides a drop-in replacement for OpenAI’s chat completion endpoint.
Let us know what you think so we can make switching as easy as possible and get more folks on open-source.
If you haven't seen us here before, we're PostgresML, an open-source MLOps platform built on Postgres. We bring ML to your data(base) rather than the other way around. We're incredibly passionate about keeping AI truly open. So we needed a way for our customers to easily move off of OpenAI's closed models. Especially now that there are better performing models, anyways.
You can check out the doc linked or the blog post from when we first released it, but here's the git diff:
- from openai import OpenAI + from pgml import OpenSource AI
- client = OpenAI(openai_api_key=openai_api_key) + client = OpenSourceAI(database_url=database_url)
messages = [{"role": "system", "content" : "You are a helpful assistant"}, {"role": "user", "content" : "What is 1+1?"}]
- response = client.chat.completions.create(..) + response = client.chat_completions_create(..)
- return response.choices[0].message.content + return response["choices"][0]["message"]["content"]