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 GPT-4o Mini model to OpenAI provider #8007

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

vishesh10
Copy link

@vishesh10 vishesh10 commented Sep 6, 2024

User description

Background

This is in continuation to the #7694 PR.

Along with the addition of GPT-4o Mini support, the chromedriver issue is fixed which was being encountered in the #7694.

Changes 🏗️

  • Updated the webdriver-manager version.
  • Added the GPT-4o Mini model to the OpenAI provider in the openai.py file.
  • Defined new model names GPT4_O_MINI_v1, GPT4_O_MINI_ROLLING, and GPT4_O_MINI.
  • Set prompt token cost to 0.15/1,000,000 and completion token cost to 0.6/1,000,000 for GPT-4o Mini.
  • Established a maximum token limit of 128,000 for GPT-4o Mini.
  • Enabled support for the function call API for the GPT-4o Mini model.

PR Quality Scorecard ✨

  • Have you used the PR description template?   +2 pts
  • Is your pull request atomic, focusing on a single change?   +5 pts
  • Have you linked the GitHub issue(s) that this PR addresses?   +5 pts
  • Have you documented your changes clearly and comprehensively?   +5 pts
  • Have you changed or added a feature?   -4 pts
    • Have you added/updated corresponding documentation?   +4 pts
    • Have you added/updated corresponding integration tests?   +5 pts
  • Have you changed the behavior of AutoGPT?   -5 pts
    • Have you also run agbenchmark to verify that these changes do not regress performance?   +10 pts

PR Type

enhancement, dependencies


Description

  • Added support for the GPT-4o Mini model in the OpenAI provider, including new model names and specifications.
  • Defined prompt and completion token costs, and set a maximum token limit for GPT-4o Mini.
  • Enabled the function call API for the GPT-4o Mini model.
  • Updated the webdriver-manager dependency version to 4.0.2 to fix related issues.

Changes walkthrough 📝

Relevant files
Enhancement
openai.py
Add GPT-4o Mini model support to OpenAI provider                 

forge/forge/llm/providers/openai.py

  • Added new model names for GPT-4o Mini.
  • Defined cost and token limits for GPT-4o Mini.
  • Enabled function call API for GPT-4o Mini.
  • Updated chat model mapping with GPT-4o Mini.
  • +12/-0   
    Dependencies
    pyproject.toml
    Update webdriver-manager dependency version                           

    forge/pyproject.toml

    • Updated webdriver-manager version to 4.0.2.
    +1/-1     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @codiumai-pr-agent-pro codiumai-pr-agent-pro bot added enhancement New feature or request dependencies labels Sep 6, 2024
    Copy link

    PR Description updated to latest commit (61b29e1)

    Copy link

    netlify bot commented Sep 6, 2024

    Deploy Preview for auto-gpt-docs canceled.

    Name Link
    🔨 Latest commit 12ea44d
    🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/66e88cfc43bb830008ce2821

    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Potential Inconsistency
    The new GPT4_O_MINI model is added with different token costs compared to other models. Verify if these costs are accurate and consistent with OpenAI's pricing.

    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Specify a more precise version range for a dependency

    Consider specifying a more precise version range for the webdriver-manager
    dependency, similar to other dependencies in the file, to ensure better
    compatibility and easier maintenance.

    forge/pyproject.toml [57]

    -webdriver-manager = "^4.0.2"
    +webdriver-manager = ">=4.0.2,<5.0.0"
     
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: Specifying a more precise version range for webdriver-manager aligns with best practices for dependency management, ensuring better compatibility and easier maintenance, making it a significant improvement.

    9
    Maintainability
    Add explanatory comment for model version date

    Consider adding a comment explaining the significance of the date in the
    GPT4_O_MINI_v1 model name, as it might not be immediately clear to other developers
    why this specific date is used.

    forge/forge/llm/providers/openai.py [79]

    +# The date represents the initial release of the GPT-4o Mini model
     GPT4_O_MINI_v1 = "gpt-4o-mini-2024-07-18"
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: Adding a comment to explain the significance of the date in GPT4_O_MINI_v1 enhances maintainability and understanding for future developers, making it a valuable improvement.

    8

    Copy link

    codecov bot commented Sep 6, 2024

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 58.18%. Comparing base (0767b17) to head (12ea44d).
    Report is 222 commits behind head on master.

    Additional details and impacted files
    @@            Coverage Diff             @@
    ##           master    #8007      +/-   ##
    ==========================================
    + Coverage   49.63%   58.18%   +8.55%     
    ==========================================
      Files         146      106      -40     
      Lines        8926     5768    -3158     
      Branches     1242      720     -522     
    ==========================================
    - Hits         4430     3356    -1074     
    + Misses       4348     2306    -2042     
    + Partials      148      106      -42     
    Flag Coverage Δ
    Linux 57.88% <100.00%> (+8.44%) ⬆️
    Windows 54.66% <100.00%> (+4.92%) ⬆️
    agbenchmark ?
    autogpt-agent ?
    forge 58.06% <100.00%> (+0.02%) ⬆️
    macOS 57.05% <100.00%> (+8.15%) ⬆️

    Flags with carried forward coverage won't be shown. Click here to find out more.

    ☔ View full report in Codecov by Sentry.
    📢 Have feedback on the report? Share it here.

    @ntindle ntindle requested review from kcze and Pwuts September 16, 2024 19:56
    Copy link
    Contributor

    @kcze kcze left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    LGTM, I checked that all numbers are correct (version, pricing, token count)

    @@ -54,7 +54,7 @@ tiktoken = ">=0.7.0,<1.0.0"
    toml = "^0.10.2"
    uvicorn = { extras = ["standard"], version = ">=0.23.2,<1" }
    watchdog = "4.0.0"
    webdriver-manager = "^4.0.1"
    webdriver-manager = "^4.0.2"
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Was this needed?

    Copy link
    Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thanks for the review @kcze.
    This was done to address the chromedriver issue.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Status: 👍🏼 Mergeable
    Development

    Successfully merging this pull request may close these issues.

    5 participants