open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

Support OpenAI's new models.

Open Steve235lab opened this issue 1 year ago • 9 comments

Describe the changes you have made:

Add default context window and max tokens configs for OpenAI's new models: gpt-4-turbo-preview, gpt-4-0125-preview, and gpt-4-1106-vision-preview.

Reference any relevant issues (e.g. "Fixes #000"):

If we can keep these configs updated with as more models as possible, maybe can avoid issues like #915

Pre-Submission Checklist (optional but appreciated):

  • [x] I have included relevant documentation updates (stored in /docs)
  • [x] I have read docs/CONTRIBUTING.md
  • [x] I have read docs/ROADMAP.md

OS Tests (optional but appreciated):

  • [x] Tested on Windows
  • [x] Tested on MacOS
  • [x] Tested on Linux

Steve235lab avatar Mar 19 '24 07:03 Steve235lab

Here's the reference Models - OpenAI API.

Steve235lab avatar Mar 19 '24 07:03 Steve235lab

I don't use other LLMs much, so my commit only focus on OpenAI GPTs. If anyone familiar with other models and their proper context window and max tokens configs, please add configs like this commit to make OI support more models by default.

Steve235lab avatar Mar 19 '24 07:03 Steve235lab

My bad, haven't seen there's already one https://github.com/KillianLucas/open-interpreter/pull/1069

Steve235lab avatar Mar 19 '24 07:03 Steve235lab

There is probably a better way to do this. I'll take a look later today.

Notnaton avatar Mar 19 '24 12:03 Notnaton

Just a note, for the vision models, function calling has to be False or they break.

CyanideByte avatar Mar 19 '24 13:03 CyanideByte

There is probably a better way to do this. I'll take a look later today.

Maybe we can simply use str.startwith to match the prefix of models like gpt-4 and openai/gpt-4?

Steve235lab avatar Mar 21 '24 10:03 Steve235lab

Strongly recommend to try gpt-4-turbo-preview model, it's cheaper and faster.

Steve235lab avatar Mar 21 '24 11:03 Steve235lab

Strongly recommend to try gpt-4-turbo-preview model, it's cheaper and faster.

Exactly this. In OpenAI's January blog post, they stated that 70% of their customers had transitioned to gpt-4-turbo from gpt-4. Its probably higher by now, gpt-4 is a 9 month old legacy model at this point. Its not going to be updated again.

CyanideByte avatar Mar 21 '24 11:03 CyanideByte

@KillianLucas If you are going to merge this, just squeeze my commits. Nobody wants 3 lines changed in 4 commits. >_<

Steve235lab avatar Mar 21 '24 16:03 Steve235lab

Nice @Steve235lab, makes the most of these models without needing to set specific settings.

Will do another test run soon (and set up some more robust testing) — last time I tested with the demos from the launch video, gpt-4 was unfortunately much more intelligent/robust than gpt-4-turbo. If that's changed, we should immediately switch.

Merged! Unfortunately I'm not very good at git, not sure how to squeeze commits, but let me know if it's important to do and I'll figure it out! Thank you so much for this PR.

KillianLucas avatar Mar 24 '24 07:03 KillianLucas