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

Change models of GPT using cli option or environment variable #106

Open
ryo-ma opened this issue Mar 25, 2023 · 3 comments
Open

Change models of GPT using cli option or environment variable #106

ryo-ma opened this issue Mar 25, 2023 · 3 comments

Comments

@ryo-ma
Copy link
Collaborator

ryo-ma commented Mar 25, 2023

No description provided.

@minheibis
Copy link
Contributor

実は、新しいモデルと古いモデルでは、API のエンドポイントが異なるようです[1]。

First Header Second Header Second Header
Newer models (2023–) gpt-4, gpt-3.5-turbo https://api.openai.com/v1/chat/completions
Older models (2020–2022) text-davinci-003, text-davinci-002, davinci, curie, babbage, ada https://api.openai.com/v1/completions

そして、精度の面では、gpt-4, gpt-3.5-turboには差があるようですが、gpt-3.5-turboとtext-davinci-003の差はそこまでないかもしれません[2]。

[2]より抜粋
The difference between these APIs derives mainly from the underlying GPT models that are available in each. The chat completions API is the interface to our most capable model (gpt-4), and our most cost effective model (gpt-3.5-turbo). For reference, gpt-3.5-turbo performs at a similar capability level to text-davinci-003 but at 10% the price per token! See pricing details here.

入力のフォーマットも異なるようなので、gpt-3.5-turbo と text-davinci-003 でどの程度差があるかをまずは実験した上で、gpt-3.5-turbo で良さそうであれば、ステップ① 叩く API エンドポイントを変えて、入力のフォーマットも併せて変更し、ステップ② gpt-3.5-turbo と gpt-4 を環境変数で入力するような形(これはこのissueで想定されているように、モデル名を環境変数で指定する意味)にするのが良さそうだと思われます。

参考:
[1] GPT - OpenAI API - https://platform.openai.com/docs/guides/gpt

[2] GPT - OpenAI API - https://platform.openai.com/docs/guides/gpt/chat-completions-vs-completions

@ryo-ma
Copy link
Collaborator Author

ryo-ma commented Jun 26, 2023

基本的に性能面を考えてgpt-3.5-turboで良いと考えております。
実装した当時はtext-davinci-003が適切だったので。

なのでおっしゃる通り環境変数およびCLIで指定できるモデルとしてはgpt-3.5-turbogpt-4かなと思っています。

@minheibis
Copy link
Contributor

@ryo-ma こちらもまだ対応されてなければ、私の方で、今週来週くらいに作業してみようと思います。

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

No branches or pull requests

2 participants