langfun 0.1.2.dev202412110804__py3-none-any.whl → 0.1.2.dev202412120804__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.
- langfun/core/llms/vertexai.py +14 -2
- {langfun-0.1.2.dev202412110804.dist-info → langfun-0.1.2.dev202412120804.dist-info}/METADATA +1 -1
- {langfun-0.1.2.dev202412110804.dist-info → langfun-0.1.2.dev202412120804.dist-info}/RECORD +6 -6
- {langfun-0.1.2.dev202412110804.dist-info → langfun-0.1.2.dev202412120804.dist-info}/LICENSE +0 -0
- {langfun-0.1.2.dev202412110804.dist-info → langfun-0.1.2.dev202412120804.dist-info}/WHEEL +0 -0
- {langfun-0.1.2.dev202412110804.dist-info → langfun-0.1.2.dev202412120804.dist-info}/top_level.txt +0 -0
langfun/core/llms/vertexai.py
CHANGED
@@ -40,7 +40,7 @@ except ImportError:
|
|
40
40
|
|
41
41
|
# https://cloud.google.com/vertex-ai/generative-ai/pricing
|
42
42
|
# describes that the average number of characters per token is about 4.
|
43
|
-
|
43
|
+
AVGERAGE_CHARS_PER_TOKEN = 4
|
44
44
|
|
45
45
|
|
46
46
|
# Price in US dollars,
|
@@ -102,6 +102,18 @@ SUPPORTED_MODELS_AND_SETTINGS = {
|
|
102
102
|
cost_per_1k_input_chars=0.000125,
|
103
103
|
cost_per_1k_output_chars=0.000375,
|
104
104
|
),
|
105
|
+
# TODO(sharatsharat): Update costs when published
|
106
|
+
'gemini-exp-1206': pg.Dict(
|
107
|
+
rpm=20,
|
108
|
+
cost_per_1k_input_chars=0.000,
|
109
|
+
cost_per_1k_output_chars=0.000,
|
110
|
+
),
|
111
|
+
# TODO(sharatsharat): Update costs when published
|
112
|
+
'gemini-2.0-flash-exp': pg.Dict(
|
113
|
+
rpm=20,
|
114
|
+
cost_per_1k_input_chars=0.000,
|
115
|
+
cost_per_1k_output_chars=0.000,
|
116
|
+
),
|
105
117
|
# TODO(chengrun): Set a more appropriate rpm for endpoint.
|
106
118
|
'vertexai-endpoint': pg.Dict(
|
107
119
|
rpm=20,
|
@@ -215,7 +227,7 @@ class VertexAI(rest.REST):
|
|
215
227
|
return (
|
216
228
|
cost_per_1k_input_chars * num_input_tokens
|
217
229
|
+ cost_per_1k_output_chars * num_output_tokens
|
218
|
-
) *
|
230
|
+
) * AVGERAGE_CHARS_PER_TOKEN / 1000
|
219
231
|
|
220
232
|
@functools.cached_property
|
221
233
|
def _session(self):
|
@@ -96,7 +96,7 @@ langfun/core/llms/openai.py,sha256=l49v6RubfInvV0iG114AymTKNogTX4u4N-UFCeSgIxw,2
|
|
96
96
|
langfun/core/llms/openai_test.py,sha256=kOWa1nf-nJvtYY10REUw5wojh3ZgfU8tRaCZ8wUgJbA,16623
|
97
97
|
langfun/core/llms/rest.py,sha256=sWbYUV8S3SuOg9giq7xwD-xDRfaF7NP_ig7bI52-Rj4,3442
|
98
98
|
langfun/core/llms/rest_test.py,sha256=NZ3Nf0XQVpT9kLP5cBVo_yBHLI7vWTYhWQxYEJVMGs4,3472
|
99
|
-
langfun/core/llms/vertexai.py,sha256=
|
99
|
+
langfun/core/llms/vertexai.py,sha256=bwOJGuTSsQHqNoa6UIXhk6MUkyMd_b6dzd3Txrw3Rps,14565
|
100
100
|
langfun/core/llms/vertexai_test.py,sha256=ffcA5yPecnQy_rhkuYAw_6o1iLW8AR8FgswmHt6aAys,6725
|
101
101
|
langfun/core/llms/cache/__init__.py,sha256=QAo3InUMDM_YpteNnVCSejI4zOsnjSMWKJKzkb3VY64,993
|
102
102
|
langfun/core/llms/cache/base.py,sha256=rt3zwmyw0y9jsSGW-ZbV1vAfLxQ7_3AVk0l2EySlse4,3918
|
@@ -148,8 +148,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
148
148
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
149
149
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
150
150
|
langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
|
151
|
-
langfun-0.1.2.
|
152
|
-
langfun-0.1.2.
|
153
|
-
langfun-0.1.2.
|
154
|
-
langfun-0.1.2.
|
155
|
-
langfun-0.1.2.
|
151
|
+
langfun-0.1.2.dev202412120804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
152
|
+
langfun-0.1.2.dev202412120804.dist-info/METADATA,sha256=OTHTCXZcoQyoFOUiSZqyvA1XirxpyusZ3GUjHXqi8s4,8281
|
153
|
+
langfun-0.1.2.dev202412120804.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
154
|
+
langfun-0.1.2.dev202412120804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
155
|
+
langfun-0.1.2.dev202412120804.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{langfun-0.1.2.dev202412110804.dist-info → langfun-0.1.2.dev202412120804.dist-info}/top_level.txt
RENAMED
File without changes
|