songquanpeng / one-api

OpenAI 接口管理 & 分发系统,支持 Azure、Anthropic Claude、Google PaLM 2 & Gemini、智谱 ChatGLM、百度文心一言、讯飞星火认知、阿里通义千问、360 智脑以及腾讯混元,可用于二次分发管理 key,仅单可执行文件,已打包好 Docker 镜像,一键部署,开箱即用. OpenAI key management & redistribution system, using a single API for all LLMs, and features an English UI.
https://openai.justsong.cn/
MIT License
18.27k stars 4.12k forks source link

4-vision计费不准确 #762

Open ye4293 opened 10 months ago

ye4293 commented 10 months ago

例行检查

问题描述 4-vision计费不准确,只计算了token提示词的费用,没有计算图片产生的费用 复现步骤

预期结果

相关截图 如果没有的话,请删除此节。

ckt1031 commented 10 months ago

@ye4293 你可以自己提出計費的想法

ye4293 commented 10 months ago

???

ckt1031 @.***> 于2023年12月2日周六 13:39写道:

@ye4293 https://github.com/ye4293 你可以自己提出計費的想法

— Reply to this email directly, view it on GitHub https://github.com/songquanpeng/one-api/issues/762#issuecomment-1837049972, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAVUTO3N6XCMAXY5P3NGMATYHK5HRAVCNFSM6AAAAABAANFBICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGA2DSOJXGI . You are receiving this because you were mentioned.Message ID: @.***>

ckt1031 commented 10 months ago

???

ckt1031 @.***> 于2023年12月2日周六 13:39写道:

@ye4293 https://github.com/ye4293 你可以自己提出計費的想法

— Reply to this email directly, view it on GitHub https://github.com/songquanpeng/one-api/issues/762#issuecomment-1837049972, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAVUTO3N6XCMAXY5P3NGMATYHK5HRAVCNFSM6AAAAABAANFBICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGA2DSOJXGI . You are receiving this because you were mentioned.Message ID: @.***>

你就這樣擺出問題, 啥也沒有, issue rules也沒有遵守, 你覺得誰會協助你?

ye4293 commented 10 months ago

我的问题,没有细致填写规则

popdo commented 10 months ago

https://platform.openai.com/docs/guides/vision/calculating-costs 官网这里给出了vision模型发送图片详细扣费说明

ckt1031 commented 10 months ago

https://platform.openai.com/docs/guides/vision/calculating-costs 官网这里给出了vision模型发送图片详细扣费说明

這是官方那邊的計算方法, 我們這邊無法直接複製 看看我的想法, 如果要強行計算模型的費用, 那麼要有圖片的原圖, 本地分析解像度, 但這樣會佔用大量服務器帶寬和網絡流量

popdo commented 10 months ago

https://platform.openai.com/docs/guides/vision/calculating-costs 官网这里给出了vision模型发送图片详细扣费说明

這是官方那邊的計算方法, 我們這邊無法直接複製 看看我的想法, 如果要強行計算模型的費用, 那麼要有圖片的原圖, 本地分析解像度, 但這樣會佔用大量服務器帶寬和網絡流量

还有一个方案。无论是上传的图片还是发送的网络图片地址,我们自己计算好将尺寸传递给oneapi计算即可。oneapi每次只需要接收一个额外的size数组参数。oneapi根据这个size计算费用。

ckt1031 commented 10 months ago

自己计算好

用户可以操纵和改变大小,以绕过计算成本

songquanpeng commented 10 months ago

是的,这个计费确实比较麻烦,目前还没有什么好的想法

lijie97 commented 10 months ago

你怎样可以用gpt-4-vision-preview呢, 我直接报错

json: cannot unmarshal object into Go struct field Message.messages.content of type string

ckt1031 commented 10 months ago

你怎样可以用gpt-4-vision-preview呢, 我直接报错

json: cannot unmarshal object into Go struct field Message.messages.content of type string

你沒更新吧🥲

lijie97 commented 10 months ago

你怎样可以用gpt-4-vision-preview呢, 我直接报错 json: cannot unmarshal object into Go struct field Message.messages.content of type string

你沒更新吧🥲

我用的docker版本的, 刚刚看了还是v0.5.8-alpha.1, 看着还没有更新到最新的

popdo commented 10 months ago

有图片时暂时给个基础扣费也好,总比现在一分不扣强。可以先按图片数量和最低标准或1024的尺寸扣费

wang0yue commented 4 months ago

有图片时暂时给个基础扣费也好,总比现在一分不扣强。可以先按图片数量和最低标准或1024的尺寸扣费

+1,现在最新的gpt-4o也是,上传图片会用base64编码,而网站没有计算