GithubHelp home page GithubHelp logo

Comments (5)

zurawiki avatar zurawiki commented on August 15, 2024 1

Hey @ChristianIvicevic , you bring up a great point here.

In the current design, gptcommit issues N+2 prompts, where N is the number of modified files with diffs under the max_token_limit. The other prompts are the title and summary.

OpenAI Completions are billed by "tokens" that are both sent and generated. Pricing per token depends on the model used. The number of tokens generated are generally predictable (as a commit message is usually only so big) but gptcommit could be sending over a lot of tokens in the form of diff data.

Today, I see two low-hanging solutions for reducing cost:

  • Switch to a different model using the openai.model configuration option
  • Reduce the side of prompts and diff data sent to OpenAI

OpenAI's pricing page can be found at
https://openai.com/api/pricing/#faq-completions-pricing

from gptcommit.

ChristianIvicevic avatar ChristianIvicevic commented on August 15, 2024

Thanks for the summary. I might have a proposal that may be an option to take into consideration. As of right now I can technically create a patch for a specific commit and without its subject line ask ChatGPT about a descriptive commit message. Unlike gptcommit it would not summarize the changes of each touched file, but it's basically a single sentence or paragraph based on a patch file.

Given that GPT can't explain the reasoning behind certain changes summarizing the details of each file feels less valuable so I'd like to know whether the described approach with less output might be a feature of gptcommit to condense output and maybe reduce costs.

from gptcommit.

zurawiki avatar zurawiki commented on August 15, 2024

from gptcommit.

zcf0508 avatar zcf0508 commented on August 15, 2024

https://github.com/markuswt/gpt-commit/blob/f2a8a239bcc7cac36fb73dcd817d5a56782f7d98/gpt-commit.py#L8-L9

This repo uses a shorter prompt.

from gptcommit.

zurawiki avatar zurawiki commented on August 15, 2024

Given the new Chat GPT models and cheaper pricing, is this issue still relevant?

from gptcommit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.