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

[Bug] 总结带图片聊天的token消耗差不多是实际情况的100倍 #5908

Open
narugakuru opened this issue Dec 9, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@narugakuru
Copy link

📦 部署方式

官方安装包

📌 软件版本

v2.15.8

💻 系统环境

Windows

📌 系统版本

Win11家庭版 23H2 22635.4145

🌐 浏览器

Edge

📌 浏览器版本

Microsoft Edge 版本 131.0.2903.86 (正式版本) (64 位)

🐛 问题描述

图中有两次聊天总结的token消耗达到了离谱的4w8,聊天内容见图2,仅仅只是翻译一张图片的文本。
最上面的2024-12-09 16:25:32时间的token消耗是同样的对话但是在lobechat的聊天总结。我测试了多个工具lobechat, chatbox都是正常的
网页端https://app.nextchat.dev/#/chat和软件都是一样的问题

image
image

📷 复现步骤

发送图片让4o或者4o-mini翻译图片文本,4o-mini总结聊天,只有有图片的时候会有异常
https://app.nextchat.dev/#/chat网页端也是一样的问题

🚦 期望结果

这个bug是怎么回事?因为lobechat消耗是正常的,看起来不像是api供应商的问题

📝 补充信息

No response

@narugakuru narugakuru added the bug Something isn't working label Dec 9, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] In summary, the token consumption of chatting with pictures is almost 100 times higher than the actual situation.

📦 Deployment method

Official installation package

📌 Software version

v2.15.8

💻 System environment

Windows

📌 System version

Win11 Home Edition 23H2 22635.4145

🌐 Browser

Edge

📌 Browser version

Microsoft Edge version 131.0.2903.86 (official version) (64-bit)

🐛 Problem description

In the picture, the token consumption of two chat summaries reached an outrageous 4w8. The chat content is shown in Figure 2, which is just a translation of the text of a picture.
The token consumption at the top of 2024-12-09 16:25:32 is the same conversation but in the chat summary of lobechat. I tested multiple tools lobechat and chatbox are all normal.
The web page https://app.nextchat.dev/#/chat and the software have the same problem.

image
image

📷 Steps to reproduce

Send a picture and let 4o or 4o-mini translate the text of the picture. 4o-mini summarizes the chat. Exceptions will only occur when there are pictures.
https://app.nextchat.dev/#/chat web page has the same problem

🚦 Expected results

What's going on with this bug? Since lobechat consumption is normal, it doesn't look like an issue with the api provider.

📝 Supplementary information

No response

@QAbot-zh
Copy link

QAbot-zh commented Dec 9, 2024

先说结论:计算没什么问题,4o-mini 的图片消耗就是非常大。

我做了一组实验:

  • lobechat 图片对话:

image

image

  • nextchat 图片对话:

image

image


可以看到他们的后台 token 统计是差不多的,在使用同一个图片、同一个模型情况下,两个应用产生的计费是没有差别的

这是我使用的图片的信息:

image

使用官方的视觉计算器算一下,token 接近、价格消耗接近(毕竟没有算上文本部分),所以计费基本没问题:

image

那为什么 4o 消耗的 token 少那么多?

来看看 4o 的计费:

image

注意看框里标出来的 base tokens,4o mini(2833)比 4o(85)足足大了 33 倍,这就是 token 看起来差别那么大的原因,4o mini 在文本处理上降本了,但图片没有,所以 OpenAI 通过这个方式把费用拉了回来

@yann0917
Copy link

4o-mini 的多模态消耗比 4o 的大太多了,我之前遇到过这个问题。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


The multi-modal consumption of 4o-mini is much larger than that of 4o. I have encountered this problem before.

@narugakuru
Copy link
Author

narugakuru commented Dec 18, 2024

@QAbot-zh @yann0917
感谢解答,确实没注意到这个问题

但还有一个很奇怪的地方,请看第一张图片的三次调用记录,我使用纯4o-mini进行聊天和总结
1, 单次图片提问的消耗是870+539token,没有使用官方视觉计费器的方式
2, 聊天总结是26021+4token消耗! 第一对聊天记录加一起按理说应该是1400+token。使用了官方视觉计费器方式
3, 然后我在不清除第一次聊天记录的前提下,再次对话的token消耗是1435+376 tokens消耗!没有使用官方视觉计费器的方式

唯独总结会有很高的消耗,聊天和总结的计费逻辑居然不一样,总结时是按照官方视觉计费器来算的,聊天却有另一套计费逻辑
这是因为调用类型类似chat,Completion 的差异吗?

image
背景样式定义

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Thanks for the answer

But there is another very strange thing. Please see the three call records in the first picture. I use pure 4o-mini to chat and summarize.

  1. The consumption of a single picture question is 870+539 tokens
  2. The chat summary is 26021+4 token consumption! The first pair of chat records together should theoretically be 1400+tokens.
  3. Then, without clearing the first chat history, the token consumption for another conversation is 1435+376 tokens consumption, which is normal! In line with the above calculation

That is to say, only the summary will have this exception. In other words, the billing method of using 4o-mini in next-chat summary is different? Is there a difference between chat and completion because of the calling type?

image
Background style definition

@QAbot-zh
Copy link

@narugakuru 我没有复现哦,使用 gpt-4o-mini,两次对话,一次标题生成,浏览器F12记录了三次网络请求,oneapi 日志里也是对应的三次记录,提示数据都很大,基本都对得上

image

image

背景样式设计

【ps. 官方网站不知道怎么了传图失败,我是在自己部署的网站上聊天测试的】

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants