Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
I am trying to use o3-mini for my python project but I get an error saying this:
Traceback (most recent call last):
File "/home/openai/dev/ai_benchmark/ai_benchmark.py", line 41, in <module>
answer = send_question(models[i - 1], "What is 4 * 4 + 4?")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/openai/dev/ai_benchmark/ai_benchmark.py", line 10, in send_question
stream = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/openai/.local/lib/python3.12/site-packages/openai/_utils/_utils.py", line 279, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/openai/.local/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 863, in create
return self._post(
^^^^^^^^^^^
File "/home/openai/.local/lib/python3.12/site-packages/openai/_base_client.py", line 1283, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/openai/.local/lib/python3.12/site-packages/openai/_base_client.py", line 960, in request
return self._request(
^^^^^^^^^^^^^^
File "/home/openai/.local/lib/python3.12/site-packages/openai/_base_client.py", line 1064, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model `o3-mini` does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}}
By the way, this issue happens on both windows and wsl.
To Reproduce
Create a chat completion
Write o3-mini for the model.
Run the project.
from openai import OpenAI
expected_answer = "20"
client = OpenAI(
api_key="sk-svcacct-ywHeOzoW_qM0hLasab662PDBc4TDg1ofqKfGXBFQpQEv5vhVWpy3jjVPGwSDYicl6eoeT3BlbkFJAUNZUxO3bbEAGOjFzutFUUF8ugM9mH4d1jICgcVvolee32pC8iDy9MpSrbg-KrI9YccA"
)
def send_question(ai_model, question):
stream = client.chat.completions.create(
model=ai_model,
messages=[
{
"role": "system",
"content": "Answer the asked math questions like this (assuming asked question is 2+2): '4'. When writing a float, write with a comma: '4,5'."
},
{
"role": "user",
"content": question
}
],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content is not None:
answer = chunk.choices[0].delta.content
return answer
models = [
"gpt-4",
"gpt-4o-mini"
"chatgpt-4o-latest",
"o1-mini",
"o1",
"o3-mini"
]
for i in range(len(models)):
answer = send_question(models[i - 1], "What is 4 * 4 + 4?")
if answer == expected_answer:
print("Test passed!")
else:
print("Test failed!")
Code snippets
OS
Windows and WSL
Python version
3.12.3
Library version
openai v1.61.1
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
I am trying to use o3-mini for my python project but I get an error saying this:
By the way, this issue happens on both windows and wsl.
To Reproduce
Create a chat completion
Write
o3-minifor the model.Run the project.
Code snippets
OS
Windows and WSL
Python version
3.12.3
Library version
openai v1.61.1