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

feat: support gpt-4o mini #1665

Merged
merged 2 commits into from
Jul 22, 2024
Merged

feat: support gpt-4o mini #1665

merged 2 commits into from
Jul 22, 2024

Conversation

HynoR
Copy link
Contributor

@HynoR HynoR commented Jul 19, 2024

resolve issue: #1664

ps: 有一个小坑, 4o mini 识图模型的tile价格对标 4o,为mini的token价格的33倍。因此我修改了图片token计算方式
ref: additionalCost

image

image

image

我已确认该 PR 已自测通过,相关截图如下:
(此处放上测试通过的截图,如果不涉及前端改动或从 UI 上无法看出,请放终端启动成功的截图)

@WqyJh
Copy link
Contributor

WqyJh commented Jul 19, 2024

官网上的价格计算器上显示,gpt-4o mini的图像价格确实与 gpt-4o 一致
image
image

@HynoR
Copy link
Contributor Author

HynoR commented Jul 19, 2024

总之改动了一下图片计算token的函数避免错误消耗非流模式下的token,希望帮忙review。也请使用该模型的朋友注意一下这个特殊的模型计算方法。

Copy link

codecov bot commented Jul 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 1.29%. Comparing base (2a892c1) to head (d04c0dc).

Files Patch % Lines
relay/adaptor/openai/token.go 0.00% 6 Missing ⚠️
relay/billing/ratio/model.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1665      +/-   ##
========================================
- Coverage   1.29%   1.29%   -0.01%     
========================================
  Files        142     142              
  Lines      10070   10076       +6     
========================================
  Hits         130     130              
- Misses      9926    9932       +6     
  Partials      14      14              

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

@songquanpeng songquanpeng merged commit 296ab01 into songquanpeng:main Jul 22, 2024
3 of 4 checks passed
mxdlzg pushed a commit to mxdlzg/one-api that referenced this pull request Oct 15, 2024
* feat: support gpt-4o mini

* feat: fix gpt-4o mini image price
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

Successfully merging this pull request may close these issues.

4 participants