3 ms·
Hey guys, We built an open-source AI SDK (Python & JavaScript) that provides a drop-in replacement for OpenAI’s chat completion endpoint. We'd love to know wha
by smarvin2 3y ago
Hey guys,
We built an open-source AI SDK (Python & JavaScript) that provides a drop-in replacement for OpenAI’s chat completion endpoint. We'd love to know what you think so we can make switching as easy as possible and get more folks on open-source.
You can swap in almost any open-source model on Huggingface. HuggingFaceH4/zephyr-7b-beta, Gryphe/MythoMax-L2-13b, teknium/OpenHermes-2.5-Mistral-7B and more.
If you haven't seen us here before, we're PostgresML, an open-source MLOps platfom built on Postgres. We bring ML to the database 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 escape OpenAI's clutches. Give it a go and let us know if we're missing any models, or what else would help you switch.
You can check out the blog post for the details, 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"]
- bravura 3y ago"We bring ML to the database rather than the other way around." Can you explain to me what that means? Maybe I've been having this problem recently.