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

How to properly configure elia to use OpenAI with api_base #73

Open
paw-lu opened this issue Jul 9, 2024 · 0 comments
Open

How to properly configure elia to use OpenAI with api_base #73

paw-lu opened this issue Jul 9, 2024 · 0 comments

Comments

@paw-lu
Copy link

paw-lu commented Jul 9, 2024

If I set the environment variables OPENAI_API_KEY and OPENAI_BASE_URL, I can successfully run this python script:

from openai import OpenAI
client = OpenAI()

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "Hello world!",
        }
    ],
    model="gpt-3.5-turbo",
)
print(chat_completion.choices[0].message.content)
$ export OPENAI_API_KEY = "abc123"
$ export OPENAI_BASE_URL = "https://paw-lu.com/api/v1"
$ python run_openai.py
Hello! How can I assist you today?

However when I try to use the same values in elia's config:

[[ models ]]
name = "gpt-3.5-turbo"
display_name = "Hello"
api_key = "abc123"
api_base = "https://paw-lu.com/api/v1"

I get a 500: internal server error from OpenAI.

What am I doing wrong here that makes the two inconsistent?

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

1 participant