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

Add support for gpt-4-turbo #323

Closed
simonw opened this issue Nov 6, 2023 · 8 comments
Closed

Add support for gpt-4-turbo #323

simonw opened this issue Nov 6, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Nov 6, 2023

Announced at OpenAI DevDay today - ~3x cheaper than GPT-4, and has a 128,000 token limit.

@simonw simonw added the enhancement New feature or request label Nov 6, 2023
simonw added a commit that referenced this issue Nov 6, 2023
This doesn't work yet though, they have not released the model.
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2023

Not working yet (I guessed the model name):

llm --model gpt-4-turbo 'hi'                                 
Error: The model `gpt-4-turbo` does not exist

simonw added a commit that referenced this issue Nov 6, 2023
simonw added a commit that referenced this issue Nov 6, 2023
This doesn't work yet though, they have not released the model.
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2023

Now working in this branch: https://github.com/simonw/llm/compare/gpt-4-turbo

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2023

Oh it's gpt-4-1106-preview according to https://openai.com/blog/new-models-and-developer-products-announced-at-devday

Not working yet though:

$ llm -m gpt-4-turbo 'hi'
Error: The model `gpt-4-1106-preview` does not exist or you do not have access to it.
Learn more: https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.

https://help.openai.com/en/articles/7102672-how-can-i-access-gpt-4.

simonw added a commit that referenced this issue Nov 6, 2023
@fourseven
Copy link

fourseven commented Nov 6, 2023

Appreciate the work you've done with LLM, it's a very useful tool. I followed the Adding more OpenAI Models instructions for the new model to set it up, and wanted to post this for others until it's officially released/supported.

For what it's worth, my account also doesn't yet have access, the following results in Error: The model 'GPT4 Turbo' does not exist

Edit: I had a human readable model name instead of the alias in the below config, have updated it now and I get data back!

llm -m gpt-4-1106-preview "Generate 5 names for a pet mice that are puns"

1. Squeakheart - A pun on "sweetheart" with a nod to the characteristic mouse squeak.
2. Mice-ter Whiskers - A play on "Mister Whiskers" emphasizing the "mice" part.
3. Cheese Chaser - A humorous take on the stereotype of mice loving cheese.
4. Whisker Twister - A fun blend of "whisker" and "twister" to reflect a mouse's nimble movements.
5. Gouda Buddy - A cheesy twist on "good buddy," referencing a well-known type of cheese.
# $(llm logs path)/extra-openai-models.yaml

- model_id: gpt-4-1106-preview
  model_name: gpt-4-1106-preview
  aliases: ['gpt-4-turbo', '4-turbo', '4t']

@simonw
Copy link
Owner Author

simonw commented Nov 6, 2023

Demo to summarize comments on https://news.ycombinator.com/item?id=38166420

curl -s "https://hn.algolia.com/api/v1/items/38166420" | \
  jq -r 'recurse(.children[]) | .author + ": " + .text' | \
  llm -m gpt-4-turbo 'Summarize the themes of the opinions expressed here,
  including direct quotes in quote markers (with author attribution) for each theme.
  Fix HTML entities. Output markdown. Go long.'

Output: https://gist.github.com/simonw/d50c8634320d339bd88f0ef17dea0a03

@simonw simonw closed this as completed in b2a1272 Nov 6, 2023
simonw added a commit that referenced this issue Nov 6, 2023
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2023

Appreciate the work you've done with LLM, it's a very useful tool. I followed the Adding more OpenAI Models instructions for the new model to set it up, and wanted to post this for others until it's officially released/supported.

Nice! I am glad that feature worked as intended.

@cmungall
Copy link
Contributor

cmungall commented Nov 6, 2023

For anyone following the instructions here: https://llm.datasette.io/en/stable/other-models.html#adding-more-openai-models

I had to add both model_id and model_name e.g.

- model_name: gpt-4-1106-preview
  model_id: gpt-4 turbo preview
  aliases: ["4-turbo", "gpt-4-turbo"]

@shvechikov
Copy link

What about adding an explicit support for JSON mode introduced in GPT-4 Turbo?

openai.Completion.create(
    ...
    response_format={ "type": "json_object" }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants