Heavyweight: GPT-4 API is fully open for use

background

I believe that many developers who apply for the GPT-4 API have received email notifications from OpenAI. Starting from 2023.07.06, all OpenAI API paid users can use GPT-4.

Among the current evaluations of all large language models, there is no doubt that GPT-4 is the brightest star.

With the GPT-4 API, it means that developers can make applications with more powerful functions and better experience.

In addition, OpenAI officially stated that it will abandon the Completions API, and some models currently available for this API will be offline on January 4, 2024. The follow-up OpenAI plan is to allow developers to use the Chat Completions API.

In addition, some models of Embedding and the Edits API will also be offline on January 4, 2024.

GPT-4 API is fully open

GPT-4 is currently the most powerful large language model. Since the API was opened in March, millions of developers have applied for it, and many successful applications have been developed based on the GPT-4 API.

Starting from 2023.07.06, developers who have a record of API payment can use the GPT-4 8K context version of the API.

Developers of new applications are expected to be approved by the end of July 2023, and then OpenAI will reduce the rate limit of the API based on the existing computing power, so that developers can use the GPT-4 API more smoothly.

GPT-3.5 Turbo, DALL.E and Whisper API will all be open for developers to use.

It is expected that in the second half of 2023, fine-tuning based on the GPT-4 and GPT-3.5 Turbo models will also be available.

Obsolete Completions API

OpenAI introduced the Chat Completions API in March 2023 , and now about 97% of API usage comes from the Chat Completions API.

The Completions API was introduced in June 2020 to provide developers with the ability to interact with the OpenAI language model.

现在有了Chat Completions API后,完全可以覆盖Completions API的功能,而且Chat Completions API更为强大,可以满足非常多的使用场景和对话需求。

下面简单介绍几种Chat Completions API的使用场景:

  • 文本总结(Text summarization)
System
Summarize this message in max 10 words.

User
Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter. When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows, and is on average the third-brightest natural object in the night sky after the Moon and Venus.

Assistant
Jupiter: Largest planet, visible to the naked eye at night.
  • 代码补全(Code completion)
System
Complete the following code.


User
def fibonacci(num):


Assistant
if num == 0:
  return 0
elif num == 1:
  return 1
else:
  fib = [0, 1]
  for i in range(2, num + 1):
     fib.append(fib[i-1] + fib[i-2])
  return fib[num]
  • 小样本学习(Few-shot learning)
System
You translate corporate jargon into plain English.


User
New synergies will help drive top-line growth.


Assistant
Working well together will make more money.


User
Let’s circle back when we have more bandwidth to touch base on opportunities for increased leverage.


Assistant
When we’re less busy, let’s talk about how to do better.


User
This late pivot means we don’t have time to boil the ocean for the client deliverable.


Assistant
Because of this sudden change, we don’t have enough time to complete the entire project for the client.

We plan to continue investing most of our platform efforts in this direction, as we believe it will offer an increasingly capable and easy-to-use experience for developers. We’re working on closing the last few remaining gaps of the Chat Completions API quickly, such as log probabilities for completion tokens and increased steerability to reduce the “chattiness” of responses.

废弃Completions API的旧模型

OpenAI接下来会把重点放在Chat Completions API,不再投入精力支持Completions API。

从2023年1月4日开始,Completions API目前可以使用的一些模型会下线,开发者要继续使用Completions API,得使用新模型,参考如下表格:

Older model New model
ada ada-002
babbage babbage-002
curie curie-002
davinci davinci-002
davinci-instruct-beta gpt-3.5-turbo-instruct
curie-instruct-beta
text-ada-001
text-babbage-001
text-curie-001
text-davinci-001
text-davinci-002
text-davinci-003
  • 如果开发者使用的是基于GPT-3模型的稳定模型版本,例如ada, babbage, curie, davinci,那代码可以不用修改,这些稳定版本的模型底层会在2024年1月4日后自动升级为上面表格里右侧的新模型。

    右侧的新模型在接下来几周开放测试,调用API的时候指定新Model的名字即可,例如 ada-002, babbage-002, curie-002, davinci-002

  • 如果开发者使用的是其他旧模型名称,例如 text-davinci-003,那就需要在手工修改API里调用的模型名称为gpt-3.5-turbo-instruct,这个新模型也会在接下来几周开放测试。

同时,OpenAI也把Completions API在官网的API文档里标记为legacy,不推荐大家继续使用了。

所以还在用Completions API的赶紧去拥抱Chat Completions API吧。

废弃Embedding旧模型

从2024年1月4日开始,只能使用text-embedding-ada-002这个Embedding Model,其它Embedding Model都会下线,不能再使用。

text-embedding-ada-002是2022年12月上线的,比其它Embedding Model更强大而且成本更低。现在99%的embedding API调用都在使用这个模型。

这对使用旧模型来做embedding的开发者来说是一个痛苦的事情,因为不同模型embedding的结果是不一样的,开发者需要在旧模型下线前提前做好适配和测试。

OpenAI官方承诺会补偿旧模型的用户。

Older model New model
code-search-ada-code-001 text-embedding-ada-002
code-search-ada-text-001
code-search-babbage-code-001
code-search-babbage-text-001
text-search-ada-doc-001
text-search-ada-query-001
text-search-babbage-doc-001
text-search-babbage-query-001
text-search-curie-doc-001
text-search-curie-query-001
text-search-davinci-doc-001
text-search-davinci-query-001
text-similarity-ada-001
text-similarity-babbage-001
text-similarity-curie-001
text-similarity-davinci-001

Deprecated Edits API

Currently the Edits API can use text-davinci-edit-001and code-davinci-edit-001these two models.

Starting from January 4, 2024, the Edits API cannot use these two models. To continue using the Edits API, you must use the GPT-3.5 Turbo model.

But the official no longer recommends that you use the Edits API, and this API will also be discarded.

We recommend using the Chat Completions API directly instead of the Edits API, as shown in the following example:

System
Apply the change requested by the user to the code.


User
def fibonacci(num):
  if num <= 1:
    return num
  else:
    return fibonacci(num-1) + fibonacci(num-2)
print(fibonacci(10))


User
Rename the function to fib.


Assistant
def fib(num):
  if num <= 1:
    return num
  else:
    return fib(num-1) + fib(num-2)
print(fib(10))

Related Reading

Summarize

Articles and sample codes are open source on GitHub: GPT Practical Tutorials to learn about mainstream LLM.

Official account: advanced coding.

Personal website: Jincheng's Blog .

Zhihu: Wuji .

References

Guess you like

Origin juejin.im/post/7253240772840063013