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

[Self-Host] The model gpt-4o does not exist or you do not have access to it. #1052

Open
auserwn opened this issue Jan 12, 2025 · 1 comment

Comments

@auserwn
Copy link

auserwn commented Jan 12, 2025

client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
def generate_completion(role, task, content):
"""Generate a completion using OpenAI."""
print(f"Parameters: role={role}, task={task[:50]}..., content={content[:50]}...")
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": f"You are a {role}. {task}"},
{"role": "user", "content": content}
]
)

Why do I still encounter an error related to "4o" even after setting the model to "gpt-4o-mini"??

       ^^^^^^^^^^^^^^

File "D:\apps\python\Lib\site-packages\openai_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model gpt-4o does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}

@nickscamara
Copy link
Member

nickscamara commented Jan 12, 2025

Sees like your openai python package might be out of date. Try uninstalling and installing again.

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

No branches or pull requests

2 participants