MeUtils 2025.7.7.17.42.1__py3-none-any.whl → 2025.7.15.17.2.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {MeUtils-2025.7.7.17.42.1.dist-info → MeUtils-2025.7.15.17.2.8.dist-info}/METADATA +261 -260
- {MeUtils-2025.7.7.17.42.1.dist-info → MeUtils-2025.7.15.17.2.8.dist-info}/RECORD +37 -28
- examples/_openaisdk/openai_audio_asr.py +43 -0
- examples/_openaisdk/openai_edits.py +34 -8
- examples/_openaisdk/openai_gitee.py +17 -11
- examples/_openaisdk/openai_google_image.py +42 -43
- examples/_openaisdk/openai_modelscope.py +73 -1
- examples/_openaisdk/openai_moon.py +12 -11
- meutils/ai_audio/tin.py +68 -0
- meutils/ai_audio/xx.py +14 -0
- meutils/apis/audio/elevenlabs.py +49 -0
- meutils/apis/audio/gitee.py +51 -0
- meutils/apis/gitee/edits.py +48 -0
- meutils/apis/gitee/images/kolors.py +1 -1
- meutils/apis/images/edits.py +1 -1
- meutils/apis/images/lora.py +67 -0
- meutils/apis/images/recraft.py +3 -3
- meutils/apis/models.py +25 -0
- meutils/apis/oneapi/channel.py +9 -6
- meutils/apis/oneapi/tasks.py +89 -0
- meutils/apis/oneapi/user.py +1 -1
- meutils/apis/ppio/videos.py +2 -2
- meutils/apis/utils.py +142 -4
- meutils/data/VERSION +1 -1
- meutils/io/files_utils.py +38 -2
- meutils/llm/check_utils.py +36 -2
- meutils/llm/completions/qwenllm.py +33 -6
- meutils/llm/openai_polling/chat.py +1 -1
- meutils/llm/openai_utils/billing_utils.py +11 -7
- meutils/llm/openai_utils/common.py +3 -3
- meutils/oss/{ali.py → ali_oss.py} +21 -9
- meutils/schemas/oneapi/common.py +81 -46
- meutils/schemas/openai_types.py +8 -3
- {MeUtils-2025.7.7.17.42.1.dist-info → MeUtils-2025.7.15.17.2.8.dist-info}/LICENSE +0 -0
- {MeUtils-2025.7.7.17.42.1.dist-info → MeUtils-2025.7.15.17.2.8.dist-info}/WHEEL +0 -0
- {MeUtils-2025.7.7.17.42.1.dist-info → MeUtils-2025.7.15.17.2.8.dist-info}/entry_points.txt +0 -0
- {MeUtils-2025.7.7.17.42.1.dist-info → MeUtils-2025.7.15.17.2.8.dist-info}/top_level.txt +0 -0
meutils/schemas/oneapi/common.py
CHANGED
@@ -22,7 +22,8 @@ MJ_FAST = 1.5
|
|
22
22
|
STEP = 2
|
23
23
|
MINIMAX_VIDEO = 3
|
24
24
|
|
25
|
-
FAL =
|
25
|
+
FAL = 3
|
26
|
+
FAL_MODELS = {
|
26
27
|
'fal-elevenlabs-tts-turbo-v2.5': 0.3,
|
27
28
|
'fal-kling-video-lipsync-audio-to-video': 0.5,
|
28
29
|
|
@@ -46,14 +47,24 @@ FAL = {
|
|
46
47
|
'fal-flux-pro-kontext-max': 0.08 * 3,
|
47
48
|
'fal-flux-pro-kontext-max-text-to-image': 0.08 * 3,
|
48
49
|
'fal-flux-pro-kontext-max-multi': 0.08 * 3,
|
50
|
+
|
51
|
+
# hailuo
|
52
|
+
"fal-ai/minimax/hailuo-02/standard/text-to-video": 0.27 * FAL, # 6 10
|
53
|
+
"fal-ai/minimax/hailuo-02/standard/image-to-video": 0.27 * FAL, # 6 10
|
54
|
+
|
55
|
+
"fal-ai/minimax/hailuo-02/pro/text-to-video": 0.48 * FAL,
|
56
|
+
"fal-ai/minimax/hailuo-02/pro/image-to-video": 0.48 * FAL,
|
57
|
+
|
49
58
|
}
|
50
59
|
|
51
|
-
|
52
|
-
|
60
|
+
FAL_MODELS = {
|
61
|
+
model.replace("fal-ai", "fal").replace("{{BASE_URL}}/", "").replace("/", "-").lower(): v for model, v in
|
62
|
+
FAL_MODELS.items()}
|
53
63
|
|
54
64
|
MODEL_PRICE = {
|
55
|
-
**
|
65
|
+
**FAL_MODELS,
|
56
66
|
|
67
|
+
"async-task": 0.0001,
|
57
68
|
"chatfire-claude": 0.02,
|
58
69
|
"o1:free": FREE,
|
59
70
|
# "claude-3-7-sonnet-code:free": "claude-3-7-sonnet-code"
|
@@ -64,6 +75,11 @@ MODEL_PRICE = {
|
|
64
75
|
|
65
76
|
"gpt-search": 0.02,
|
66
77
|
|
78
|
+
# elevenlabs
|
79
|
+
# Your request will cost $0.03 per minute of audio transcribed.
|
80
|
+
"elevenlabs/scribe_v1": 0.03 * 3 * 1000000 / 60 / 2, # 0.0015/s
|
81
|
+
"elevenlabs/eleven_turbo_v2_5": 0.05 * 3 * 1000 / 2, # Your request will cost $0.05 per thousand characters.
|
82
|
+
|
67
83
|
# 谷歌
|
68
84
|
"gemini-2.0-flash-search": 0.01,
|
69
85
|
"gemini-2.0-flash-exp-image-generation": 0.03,
|
@@ -116,6 +132,7 @@ MODEL_PRICE = {
|
|
116
132
|
|
117
133
|
# veo
|
118
134
|
"veo3": 2,
|
135
|
+
"veo3-frames": 2,
|
119
136
|
"veo3-pro": 8,
|
120
137
|
"veo3-pro-frames": 8,
|
121
138
|
|
@@ -225,21 +242,6 @@ MODEL_PRICE = {
|
|
225
242
|
|
226
243
|
"deepseek-ai/Janus-Pro-7B": 0.01,
|
227
244
|
|
228
|
-
# replicate
|
229
|
-
"api-replicate-flux-1.1-pro": 0.040,
|
230
|
-
"api-replicate-flux-1.1-pro-ultra": 0.060,
|
231
|
-
"api-replicate-flux-dev": 0.025,
|
232
|
-
"api-replicate-flux-pro": 0.055,
|
233
|
-
"api-replicate-flux-schnell": 0.003,
|
234
|
-
"api-replicate-ideogram-v2": 0.080,
|
235
|
-
"api-replicate-ideogram-v2-turbo": 0.050,
|
236
|
-
"api-replicate-recraft-v3": 0.040,
|
237
|
-
"api-replicate-recraft-v3-svg": 0.080,
|
238
|
-
"api-replicate-stable-diffusion-3": 0.035,
|
239
|
-
"api-replicate-stable-diffusion-3.5-large": 0.065,
|
240
|
-
"api-replicate-stable-diffusion-3.5-large-turbo": 0.040,
|
241
|
-
"api-replicate-stable-diffusion-3.5-medium": 0.035,
|
242
|
-
|
243
245
|
# sd
|
244
246
|
"stable-diffusion-xl-base-1.0": 0.01,
|
245
247
|
"stable-diffusion-2-1": 0.01,
|
@@ -269,10 +271,6 @@ MODEL_PRICE = {
|
|
269
271
|
"chat-kolors": 0.02,
|
270
272
|
"chat-kling": 0.02,
|
271
273
|
"chat-video": 0.1,
|
272
|
-
"chat-video-kling": 0.1,
|
273
|
-
"chat-video-gen3": 0.1,
|
274
|
-
"chat-video-vidu": 0.1,
|
275
|
-
"chat-video-vidu-vip": 0.3,
|
276
274
|
"chat-flux.1.1-pro": 0.1,
|
277
275
|
|
278
276
|
# aitools
|
@@ -348,7 +346,6 @@ MODEL_PRICE = {
|
|
348
346
|
"o1-mini-all": 0.2,
|
349
347
|
"o1-preview-all": 0.6,
|
350
348
|
|
351
|
-
"o3": 0.6 * 0.8,
|
352
349
|
"o3-mini": 0.05,
|
353
350
|
"o3-mini-high": 0.1,
|
354
351
|
|
@@ -423,7 +420,9 @@ MODEL_PRICE = {
|
|
423
420
|
|
424
421
|
# MJ
|
425
422
|
"mj-chat": 0.3,
|
423
|
+
"mj_fast_video": 0.8 * MJ_FAST,
|
426
424
|
|
425
|
+
"mj_fast_edits": 0.1 * MJ_FAST,
|
427
426
|
"mj_fast_blend": 0.1 * MJ_FAST,
|
428
427
|
"mj_fast_custom_oom": 0,
|
429
428
|
"mj_fast_describe": 0.05 * MJ_FAST,
|
@@ -474,6 +473,8 @@ MODEL_RATIO = {
|
|
474
473
|
"gpt-4-plus": 2.5,
|
475
474
|
"gpt-4o-plus": 2.5,
|
476
475
|
"jina-deepsearch": 2,
|
476
|
+
"jina-deepsearch-v1": 2,
|
477
|
+
|
477
478
|
"deepresearch": 2,
|
478
479
|
"deepsearch": 2,
|
479
480
|
|
@@ -517,12 +518,30 @@ MODEL_RATIO = {
|
|
517
518
|
"grok-3-mini-beta": 0.15,
|
518
519
|
"grok-3-mini-fast-beta": 0.3,
|
519
520
|
|
521
|
+
"grok-4": 1.5,
|
522
|
+
|
520
523
|
# 定制
|
521
524
|
"lingxi-all": 1,
|
522
525
|
|
526
|
+
# 月之暗面 https://platform.moonshot.cn/docs/price/chat#%E4%BA%A7%E5%93%81%E5%AE%9A%E4%BB%B7
|
527
|
+
"kimi-latest-8k": 1,
|
528
|
+
"kimi-latest-32k": 2.5,
|
529
|
+
"kimi-latest-128k": 5,
|
530
|
+
|
531
|
+
"moonshot-v1-8k": 1,
|
532
|
+
"moonshot-v1-32k": 2.5,
|
533
|
+
"moonshot-v1-128k": 5,
|
534
|
+
|
535
|
+
"kimi-vl-a3b-thinking": 1,
|
536
|
+
"moonshot-v1-8k-vision-preview": 1,
|
537
|
+
"moonshot-v1-32k-vision-preview": 2.5,
|
538
|
+
"moonshot-v1-128k-vision-preview": 5,
|
539
|
+
|
523
540
|
"kimi": 5,
|
524
541
|
"kimi-128k": 5,
|
525
542
|
"kimi-dev-72b": 1,
|
543
|
+
"moonshotai/kimi-k2-instruct": 2,
|
544
|
+
"kimi-k2-0711-preview": 2,
|
526
545
|
|
527
546
|
# 智谱 https://www.bigmodel.cn/pricing
|
528
547
|
'glm-4-9b-chat': 0.1,
|
@@ -547,19 +566,8 @@ MODEL_RATIO = {
|
|
547
566
|
"glm-z1-air": 0.25, # "glm-z1-air": "glm-z1-air==THUDM/GLM-Z1-32B-0414"
|
548
567
|
"glm-z1-airx": 2.5, # "glm-z1-airx": "glm-z1-airx==THUDM/GLM-Z1-Rumination-32B-0414"
|
549
568
|
|
550
|
-
|
551
|
-
"
|
552
|
-
"kimi-latest-32k": 2.5,
|
553
|
-
"kimi-latest-128k": 5,
|
554
|
-
|
555
|
-
"moonshot-v1-8k": 1,
|
556
|
-
"moonshot-v1-32k": 2.5,
|
557
|
-
"moonshot-v1-128k": 5,
|
558
|
-
|
559
|
-
"kimi-vl-a3b-thinking": 1,
|
560
|
-
"moonshot-v1-8k-vision-preview": 1,
|
561
|
-
"moonshot-v1-32k-vision-preview": 2.5,
|
562
|
-
"moonshot-v1-128k-vision-preview": 5,
|
569
|
+
"glm-4.1v-thinking-flash": 0.1,
|
570
|
+
"glm-4.1v-thinking-flashx": 1,
|
563
571
|
|
564
572
|
# 阿里千问 https://dashscope.console.aliyun.com/billing
|
565
573
|
"qwen-long": 0.25,
|
@@ -597,7 +605,7 @@ MODEL_RATIO = {
|
|
597
605
|
"qwen3-235b-a22b": 2,
|
598
606
|
"qwen-math-plus": 2,
|
599
607
|
|
600
|
-
"qwq-32b":
|
608
|
+
"qwq-32b": 0.5,
|
601
609
|
"qwq-plus": 0.8,
|
602
610
|
"qwq-max": 0.8,
|
603
611
|
"qwq-max-search": 2,
|
@@ -698,6 +706,7 @@ MODEL_RATIO = {
|
|
698
706
|
"deepseek-r1-250528": 2,
|
699
707
|
"deepseek-r1-250528-qwen3-8b": 0.3,
|
700
708
|
"deepseek-r1-250528-think": 2,
|
709
|
+
"deepseek-r1-160k": 2,
|
701
710
|
|
702
711
|
"deepseek-search": 1,
|
703
712
|
'deepseek-r1-search': 2,
|
@@ -797,6 +806,13 @@ MODEL_RATIO = {
|
|
797
806
|
"hunyuan-a13b-instruct": 0.5,
|
798
807
|
|
799
808
|
# 百度文心
|
809
|
+
"baidu/ernie-4.5-300b-a47b": 2, # sili
|
810
|
+
"baidu/ernie-4.5-vl-424b-a47b": 2, # pp
|
811
|
+
|
812
|
+
"baidu/ernie-4.5-0.3b": 0.1, # pp免费
|
813
|
+
"baidu/ernie-4.5-21B-a3b": 0.1, # pp免费
|
814
|
+
"baidu/ernie-4.5-vl-28b-a3b": 0.1, # pp免费
|
815
|
+
|
800
816
|
"ernie-4.5-turbo-vl-32k": 0.45,
|
801
817
|
"ernie-4.5-turbo-128k": 0.12,
|
802
818
|
"ernie-x1-turbo-32k": 0.15,
|
@@ -823,6 +839,7 @@ MODEL_RATIO = {
|
|
823
839
|
"tts-1-hd": 15,
|
824
840
|
"tts-1-hd-1106": 15,
|
825
841
|
"whisper-1": 15,
|
842
|
+
"whisper-large-v3-turbo": 15,
|
826
843
|
|
827
844
|
# claude
|
828
845
|
|
@@ -1007,6 +1024,7 @@ MODEL_RATIO = {
|
|
1007
1024
|
|
1008
1025
|
"meta-llama/Llama-4-Scout-17B-16E-Instruct": 0.1,
|
1009
1026
|
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": 0.2,
|
1027
|
+
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-Turbo": 0.2,
|
1010
1028
|
|
1011
1029
|
# groq https://console.groq.com/docs/models
|
1012
1030
|
"llama3-8b-8192": 0.01,
|
@@ -1061,6 +1079,8 @@ COMPLETION_RATIO = {
|
|
1061
1079
|
"gpt-4-plus": 5,
|
1062
1080
|
"gpt-4o-plus": 5,
|
1063
1081
|
"jina-deepsearch": 4,
|
1082
|
+
"jina-deepsearch-v1": 4,
|
1083
|
+
|
1064
1084
|
"deepresearch": 4,
|
1065
1085
|
"deepsearch": 4,
|
1066
1086
|
|
@@ -1070,6 +1090,8 @@ COMPLETION_RATIO = {
|
|
1070
1090
|
"kimi-latest-128k": 3,
|
1071
1091
|
"kimi-dev-72b": 4,
|
1072
1092
|
"kimi-vl-a3b-thinking": 5,
|
1093
|
+
"moonshotai/kimi-k2-instruct": 4,
|
1094
|
+
"kimi-k2-0711-preview": 4,
|
1073
1095
|
|
1074
1096
|
"moonshot-v1-8k": 5,
|
1075
1097
|
"moonshot-v1-32k": 4,
|
@@ -1092,6 +1114,7 @@ COMPLETION_RATIO = {
|
|
1092
1114
|
"grok-3-fast-beta": 5,
|
1093
1115
|
"grok-3-mini-beta": 5 / 3,
|
1094
1116
|
"grok-3-mini-fast-beta": 4 / 0.6,
|
1117
|
+
"grok-4": 5,
|
1095
1118
|
|
1096
1119
|
"gpt-4-all": 4,
|
1097
1120
|
"gpt-4-gizmo-*": 4,
|
@@ -1154,8 +1177,9 @@ COMPLETION_RATIO = {
|
|
1154
1177
|
"llama-3.1-405b-instruct": 6,
|
1155
1178
|
"meta-llama/Meta-Llama-3.1-405B-Instruct": 6,
|
1156
1179
|
|
1157
|
-
"meta-llama/Llama-4-Scout-17B-16E-Instruct":
|
1158
|
-
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8":
|
1180
|
+
"meta-llama/Llama-4-Scout-17B-16E-Instruct": 4,
|
1181
|
+
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": 4,
|
1182
|
+
"meta-llama/Llama-4-Maverick-17B-128E-Instruct-Turbo": 4,
|
1159
1183
|
|
1160
1184
|
"llama-3.3-70b-instruct": 4,
|
1161
1185
|
|
@@ -1171,6 +1195,14 @@ COMPLETION_RATIO = {
|
|
1171
1195
|
"command-r-08-2024": 4,
|
1172
1196
|
"command-r-plus-08-2024": 4,
|
1173
1197
|
|
1198
|
+
# 百度
|
1199
|
+
"baidu/ernie-4.5-300b-a47b": 4, # sili
|
1200
|
+
"baidu/ernie-4.5-vl-424b-a47b": 4, # pp
|
1201
|
+
|
1202
|
+
"baidu/ernie-4.5-0.3b": 4, # pp免费 baidu/ernie-4.5-0.3b,baidu/ernie-4.5-21B-a3b,baidu/ernie-4.5-vl-28b-a3b
|
1203
|
+
"baidu/ernie-4.5-21B-a3b": 4, # pp免费
|
1204
|
+
"baidu/ernie-4.5-vl-28b-a3b": 4, # pp免费
|
1205
|
+
|
1174
1206
|
"ERNIE-Speed-8K": 3,
|
1175
1207
|
"ERNIE-Speed-128K": 3,
|
1176
1208
|
|
@@ -1232,11 +1264,9 @@ COMPLETION_RATIO = {
|
|
1232
1264
|
"qwen2.5-coder-32b-instruct": 3,
|
1233
1265
|
|
1234
1266
|
"qwen-turbo-2024-11-01": 3,
|
1235
|
-
"qwen/qwq-32b-preview": 3,
|
1236
|
-
"Qwen/QwQ-32B-Preview": 3,
|
1237
|
-
"qwq-32b": 3,
|
1238
1267
|
|
1239
|
-
"qwq-32b
|
1268
|
+
"qwq-32b": 2,
|
1269
|
+
|
1240
1270
|
"qvq-72b-preview": 3,
|
1241
1271
|
|
1242
1272
|
"qwen-long": 4,
|
@@ -1360,8 +1390,9 @@ COMPLETION_RATIO = {
|
|
1360
1390
|
"deepseek-v3-fast": 4,
|
1361
1391
|
|
1362
1392
|
'deepseek-r1': 4,
|
1393
|
+
"deepseek-r1-160k": 5,
|
1394
|
+
|
1363
1395
|
'deepseek-reasoner': 4,
|
1364
|
-
"deepseek-reasoner-164k": 8,
|
1365
1396
|
"deepseek-r1-250120": 4,
|
1366
1397
|
"deepseek-r1-0528": 4,
|
1367
1398
|
"deepseek-r1-250528": 4,
|
@@ -1393,6 +1424,8 @@ COMPLETION_RATIO = {
|
|
1393
1424
|
"glm-zero": 5,
|
1394
1425
|
"glm-zero-preview": 5,
|
1395
1426
|
"glm-4v-flash": 5,
|
1427
|
+
"glm-4.1v-thinking-flash": 2,
|
1428
|
+
"glm-4.1v-thinking-flashx": 4,
|
1396
1429
|
|
1397
1430
|
"step-1-flash": 5,
|
1398
1431
|
"step-1-8k": 5,
|
@@ -1610,4 +1643,6 @@ if __name__ == '__main__':
|
|
1610
1643
|
|
1611
1644
|
print([k for k in MODEL_RATIO if k.startswith(('deepseek', 'doubao', 'moon'))] | xjoin(","))
|
1612
1645
|
|
1613
|
-
print(',
|
1646
|
+
print([k for k in MODEL_PRICE if k.startswith(('chat-',))] | xjoin(","))
|
1647
|
+
|
1648
|
+
# print(','.join(FAL))
|
meutils/schemas/openai_types.py
CHANGED
@@ -40,8 +40,13 @@ class Tool(BaseModel):
|
|
40
40
|
|
41
41
|
class CompletionUsage(_CompletionUsage):
|
42
42
|
prompt_tokens: int = 1000
|
43
|
-
completion_tokens: int =
|
44
|
-
total_tokens: int =
|
43
|
+
completion_tokens: Optional[int] = None
|
44
|
+
total_tokens: Optional[int] = None
|
45
|
+
|
46
|
+
def __init__(self, /, **data: Any):
|
47
|
+
super().__init__(**data)
|
48
|
+
self.completion_tokens = self.completion_tokens or 0
|
49
|
+
self.total_tokens = self.total_tokens or self.prompt_tokens + self.completion_tokens
|
45
50
|
|
46
51
|
|
47
52
|
class ChatCompletionMessage(_ChatCompletionMessage):
|
@@ -440,7 +445,7 @@ class TTSRequest(BaseModel):
|
|
440
445
|
|
441
446
|
speed: Optional[float] = None
|
442
447
|
|
443
|
-
response_format: Literal["mp3", "opus", "aac", "flac", "wav", "pcm", "url"] = "
|
448
|
+
response_format:Union[str, Literal["mp3", "opus", "aac", "flac", "wav", "pcm", "b64_json", "url"]] = "b64_json"
|
444
449
|
|
445
450
|
class Config:
|
446
451
|
json_schema_extra = {
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|