import OpenAI from "openai"
const openai = new OpenAI({
baseURL: "https://api.aiapilab.com/v1",
apiKey: $AIAPILAB_API_KEY
})
async function main() {
const completion = await openai.chat.completions.create({
model: "openai/o1-preview-2024-09-12",
messages: [
{
"role": "user",
"content": "Write a blog about cat."
}
]
})
console.log(completion.choices[0].message)
}
main()
Feature/Aspect | GPT-4o | Claude 3.5 Sonnet | OpenAI o1-preview (2024-09-12) |
---|---|---|---|
Context Window | Supports a context window of up to 32,768 tokens. | Limited context handling compared to o1. | Supports a large context window of up to 128,000 tokens. |
Coding Competency | Strong coding abilities but slightly less effective than o1 in certain scenarios. | Competent in coding tasks, but not as high-performing as o1. | Reached the 89th percentile in coding competitions, excels at generating and debugging code. |
Performance in STEM | High performance in general tasks, but lower in complex STEM compared to o1. | Effective in general tasks but not specialized for high-level STEM. | Exhibits PhD-level accuracy in physics, chemistry, and biology benchmarks. |
Reasoning Capability | Strong reasoning but not as specialized in complex STEM tasks as o1. | Good reasoning ability but less effective in complex tasks compared to o1. | Advanced reasoning with a "chain of thought" approach, excels in complex problem-solving. |
Safety and Alignment | Moderate safety measures, lower score in jailbreaking tests compared to o1. | Lower safety scores, more susceptible to manipulation. | Improved safety measures, scored 84 in jailbreaking tests, higher than GPT-4o. |