Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other models besides OpenAI? #45

Open
cspenn opened this issue Jul 24, 2023 · 1 comment
Open

Other models besides OpenAI? #45

cspenn opened this issue Jul 24, 2023 · 1 comment

Comments

@cspenn
Copy link

cspenn commented Jul 24, 2023

A number of open source models like LLaMa 2 can run in local environments where there's a webserver (like LM Studio, Koboldcpp, etc.) that has identical endpoints to OpenAI. Can we have a flag/option that allows for specifying a different OpenAI-compatible endpoint?

@irudnyts
Copy link
Owner

@cspenn you can do it in the development version:

remotes::install_github("irudnyts/openai", ref = "r6")

library(openai)
client <- OpenAI(
    base_url = "your_base_url"
)
completion <- client$chat$completions$create(
    model = "gpt-3.5-turbo",
    messages = list(list("role" = "user", "content" = "What's up?"))
)

I'm currently working on all other endpoints, and hopefully, I'll be able to roll out a stable version soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants