di-sukharev / opencommit

just a GPT wrapper for git — generate commit messages by an LLM in 1 sec — works best with Claude 3.5 — supports local models too
https://www.npmjs.com/package/opencommit
MIT License
6.19k stars 331 forks source link

Payment description in README #106

Closed Christopher-Hayes closed 1 year ago

Christopher-Hayes commented 1 year ago

from the README.md:

You pay for your own requests to OpenAI API. OpenCommit uses ChatGPT official model, that is ~10x times cheaper than GPT-3 and ~6x times cheaper than GPT-4.

Is this correct? I'm a little confused by the wording. How can it be 10x cheaper than GPT-3, but only 6x cheaper than GPT-4?

From my calculations, GPT-4 is approximately 30x more expensive than GPT-3.5-turbo (completions specifically). Is OpenCommit using the davinci-003 prompt complete, or something else? Those 10x cheaper and 6x cheaper values seem off.

Btw, love the idea. I already love gitmoji, so happy opencommit supports it and I can automate it with ai.

di-sukharev commented 1 year ago

hehe, thats the wording from openAI guys, how did you do calculations so you get 30x?

Christopher-Hayes commented 1 year ago

https://openai.com/pricing

GPT-4 (8k version)

Prompt: $0.03 / 1K tokens Completion: $0.06 / 1K tokens

GPT-3.5-turbo

Prompt and completion: $0.002 / 1K tokens

On completion, GPT-4 is 0.06 / 0.002 = 30 times more expensive than GPT-3.5. Or 15x more expensive if you're just comparing prompt pricing.

Looking at the code now, it looks like OpenCommit is using gpt-3.5-turbo: https://github.com/di-sukharev/opencommit/blob/e2f68b72565d84462ac8918ce73770741b152551/src/api.ts#L43

di-sukharev commented 1 year ago

fixed the wording, thanks brother