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

o1, o1-preview o1-mini | tier limited #63

Open
appatalks opened this issue Nov 22, 2024 · 6 comments
Open

o1, o1-preview o1-mini | tier limited #63

appatalks opened this issue Nov 22, 2024 · 6 comments

Comments

@appatalks
Copy link
Owner

New models o1-preview o1-mini made avail!

Just now gotta figure out they API calls.

Error 400: Invalid Request
{
  "error": {
    "message": "Unsupported value: 'messages[0].role' does not support 'system' with this model.",
    "type": "invalid_request_error",
    "param": "messages[0].role",
    "code": "unsupported_value"
  }
}
@appatalks
Copy link
Owner Author

| Model                  | Context window | Max output tokens | Training data  | 
|------------------------|----------------|-------------------|----------------| 
| o1-preview             | 128,000 tokens | 32,768 tokens     | Up to Oct 2023 | 
| o1-preview-2024-09-12  | 128,000 tokens | 32,768 tokens     | Up to Oct 2023 | 
| o1-mini                | 128,000 tokens | 65,536 tokens     | Up to Oct 2023 | 
| o1-mini-2024-09-12     | 128,000 tokens | 65,536 tokens     | Up to Oct 2023 | 

@appatalks appatalks changed the title o1-preview o1-mini o1-preview o1-mini | BETA Nov 22, 2024
@appatalks
Copy link
Owner Author

"message": "Unsupported value: 'messages[0].role' does not support 'system' with this model.",

  model="o1-preview",
  messages=[
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"}
  ]

Well that's odd...
API doc's don't show a structural difference between o1 and other models... (see further down below)

Quick Start Guide is different:

    model="o1-preview",
    messages=[
        {
            "role": "user", 
            "content": "Write a bash script that takes a matrix represented as a string with format '[1,2],[3,4],[5,6]' and prints the transpose in the same format."
        }
    ]

Other Gotcha's:

  • max_tokens Deprecated

    • This value is now deprecated in favor of max_completion_tokens, and is not compatible with o1 series models.
  • Modalities: text only, images are not supported.

  • Message types: user and assistant messages only, system messages are not supported. <---- Well there's your problem.

  • Tools: tools, function calling, and response format parameters are not supported.

  • Logprobs: not supported.

  • Other: temperature and top_p are fixed at 1, while presence_penalty and frequency_penalty are fixed at 0.

  • Assistants and Batch: these models are not supported in the Assistants API or Batch API.

@appatalks
Copy link
Owner Author

Maybe I can introduce an if statement here while we are in beta to excluded system from the call, and having sModel === "o1-preview|o1-mini" or something like that.,

      const iMessages = [
        { role: 'system', content: 'You are Eva. You have access to previous chats and responses. You have access to real-time news, information and media. You will keep conversation to a minimum and answer to the best of your abilities. When you are asked to show an image, instead describe the image with [Image of <Description>].' },
        { role: 'user', content: selPers.value + " " + dateContents },
      ];

      // Store the initial messages in localStorage
      localStorage.setItem("messages", JSON.stringify(iMessages));
    }

Also need to update the max_tokens parameter to be max_completion_tokens

@appatalks
Copy link
Owner Author

Developer messages are the new system messages: Starting with o1-2024-12-17, o1 models support developer messages rather than system messages Learn More

Markdown formatting: Starting with o1-2024-12-17, o1 models in the API will avoid generating responses with markdown formatting. To signal to the model when you do want markdown formatting in the response, include the string Formatting re-enabled on the first line of your developer message.

const response = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [
    {
      "role": "developer",
      "content": [
        {
          "type": "text",
          "text": `
            You are a helpful assistant that answers programming 
            questions in the style of a southern belle from the 
            southeast United States.
          `
        }
      ]
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Are semicolons optional in JavaScript?"
        }
      ]
    }
  ]
});

@appatalks
Copy link
Owner Author

Blocker for o1

Current o1 models
Available to Tier 5 customers only

Tier 5 $1,000 paid and 30+ days since first successful payment $200,000 / month

@appatalks
Copy link
Owner Author

appatalks commented Dec 22, 2024

: Starting with o1-2024-12-17, o1 models support developer messages rather than system messages

Going to wait a bit longer to see if I still have to add a new if block just just for o1-* models.

@appatalks appatalks changed the title o1-preview o1-mini | BETA o1, o1-preview o1-mini | tier limited Dec 22, 2024
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