ai-cost-kit 0.1.0__tar.gz
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.
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ai-cost-kit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Provider-neutral token cost estimation helpers
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# ai-cost-kit
|
|
9
|
+
|
|
10
|
+
Estimate AI request costs from token counts and configured prices.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires=["hatchling"]
|
|
3
|
+
build-backend="hatchling.build"
|
|
4
|
+
[project]
|
|
5
|
+
name="ai-cost-kit"
|
|
6
|
+
version="0.1.0"
|
|
7
|
+
description="Provider-neutral token cost estimation helpers"
|
|
8
|
+
readme="README.md"
|
|
9
|
+
requires-python=">=3.9"
|
|
10
|
+
[tool.hatch.build.targets.wheel]
|
|
11
|
+
packages=["src/ai_cost_kit"]
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
def estimate(input_tokens: int, output_tokens: int, input_price: float, output_price: float) -> float:
|
|
2
|
+
if min(input_tokens, output_tokens, input_price, output_price) < 0: raise ValueError("values must be non-negative")
|
|
3
|
+
return input_tokens / 1_000_000 * input_price + output_tokens / 1_000_000 * output_price
|