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/gpt-4o-mini",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What's in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]
}
]
})
console.log(completion.choices[0].message)
}
main()
Feature/Aspect | GPT-4o | GPT-4o Mini | GPT-3.5 Turbo |
---|---|---|---|
Model Type | Full-sized, advanced language model | Small, cost-efficient language model | Previous generation language model |
Context Window | 128k tokens | 128k tokens | 4k tokens |
Safety Features | Comprehensive safety protocols | Advanced safety measures, including instruction hierarchy | Basic safety features |
Multimodal Capabilities | Supports text, audio, and video inputs | Supports text and image inputs | Primarily text input |
Performance Benchmark Score | Higher scores on various benchmarks | 82% on MMLU (Massive Multi-task Language Understanding) | Lower scores on similar benchmarks |