magentic icon indicating copy to clipboard operation
magentic copied to clipboard

Does magentic support o1 and o1-mini models?

Open Lawouach opened this issue 1 year ago • 2 comments

Hi,

I was trying to use these models today while generating structured output with OpenaiChatModel. But, I ran into issues as these models do not support the same range of parameters as older models like gpt-4. Thus magentic breaks quite heavily.

Notably, the o1 models don't:

  • support to set max_tokens (aside from setting it to 1)
  • allow the parallel_tool_calls parameter
  • support tools

Lawouach avatar Jan 28 '25 13:01 Lawouach

Right now all structured output in magentic uses tool calls which these models don't support. o1 (but not o1-mini I think) supports openai's structured outputs, which magentic should really be using in the case where a single structured output is desired (no union in return type and no functions provided). Issue for that is #295 Apart from that, I think we just have to wait for openai to add support for tools. The parallel_tool_calls and max_tokens parameters could be optionally omitted.

https://platform.openai.com/docs/guides/structured-outputs#supported-models

jackmpcollins avatar Jan 29 '25 08:01 jackmpcollins

@jackmpcollins It looks like o3-mini now supports function calls -- https://platform.openai.com/docs/models#o3-mini

These models also use developer messages rather than system messages (which are now deprecated iiuc) -- not sure if magentic under-the-hood still relies on those?

Exciting times!

mnicstruwig avatar Feb 03 '25 12:02 mnicstruwig