Best way to determine what model is is use for response

Our account has paid more than the $1 to unlock GPT-4 access. We are wondering is there a way to call the API to determine what model you are using? I know that sounds odd.

Take for example this script using “gpt-4-0613” for the model. The response is “No, I am OpenAI’s language model, GPT-3. GPT-4 has not been released yet.” However, the response object says the model: “gpt-4-0613”

What do you get when you run this script?

import openai

openai.api_key = "your_api_key"
    
messages = [ {"role": "user", "content": "are you gpt-4?" } ]

model = "gpt-4-0613"

response = openai.ChatCompletion.create(
    model=model,
    messages=messages,
)

print(response)

our response:

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "No, I am OpenAI's language model, GPT-3. GPT-4 has not been released yet.",
        "role": "assistant"
      }
    }
  ],
  "created": 1691185166,
  "id": "chatcmpl-...",
  "model": "gpt-4-0613",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 25,
    "prompt_tokens": 14,
    "total_tokens": 39
  }
}

Do not ask the model about itself, it does not know about itself. This is a 100%, guaranteed, method to induce a hallucination.

The model you are using is the model you indicate in your request and what is returned in the response.

That’s it.

3 Likes

If you ask ChatGPT through the website UI it nails the question every time, no halucination.

“Yes, I’m based on the GPT-4 architecture, which is a more advanced model developed by OpenAI compared to its predecessors. How can I assist you today?”

Why would the API be different?

I’d think because you control the system prompting when you make an API call, but with ChatGPT there’s all kinds of stuff that gets injected (though luckily we do have some access to add our own stuff in now as well).

Because the ChatGPT UI has a system message telling it what it is.

https://chat.openai.com/share/0de54976-552b-483a-8b1e-e2b8e15b96d6

1 Like

Because the ChatGPT UI has a system message that can be user-upgraded to be truthful and persistent.