metergraph-core 0.9.1__tar.gz → 0.9.2__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.
Files changed (32) hide show
  1. {metergraph_core-0.9.1/src/metergraph_core.egg-info → metergraph_core-0.9.2}/PKG-INFO +9 -1
  2. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/README.md +8 -0
  3. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/pyproject.toml +1 -1
  4. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/calls.py +4 -1
  5. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/catalog.py +2 -0
  6. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/data/prices.yaml +38 -2
  7. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/data/sources.yaml +4 -4
  8. metergraph_core-0.9.2/src/metergraph_core/providers/google.py +43 -0
  9. {metergraph_core-0.9.1 → metergraph_core-0.9.2/src/metergraph_core.egg-info}/PKG-INFO +9 -1
  10. metergraph_core-0.9.1/src/metergraph_core/providers/google.py +0 -14
  11. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/MANIFEST.in +0 -0
  12. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/setup.cfg +0 -0
  13. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/__init__.py +0 -0
  14. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/billing.py +0 -0
  15. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/catalog_delta.py +0 -0
  16. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/catalogs.py +0 -0
  17. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/data/models.yaml +0 -0
  18. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/extractors.py +0 -0
  19. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/families.py +0 -0
  20. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/loader.py +0 -0
  21. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/models.py +0 -0
  22. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/providers/__init__.py +0 -0
  23. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/providers/anthropic.py +0 -0
  24. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/refresh.py +0 -0
  25. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/reliability.py +0 -0
  26. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/responses.py +0 -0
  27. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/retrieval.py +0 -0
  28. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core/sources.py +0 -0
  29. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core.egg-info/SOURCES.txt +0 -0
  30. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core.egg-info/dependency_links.txt +0 -0
  31. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core.egg-info/requires.txt +0 -0
  32. {metergraph_core-0.9.1 → metergraph_core-0.9.2}/src/metergraph_core.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metergraph-core
3
- Version: 0.9.1
3
+ Version: 0.9.2
4
4
  Summary: Open, effective-dated LLM pricing catalog and deterministic cost calculator for popular models across major providers and gateways, including OpenAI, Anthropic, Google Gemini, AWS Bedrock, OpenRouter, Vercel AI Gateway, and more.
5
5
  Author: Metergraph
6
6
  License-Expression: Apache-2.0
@@ -61,6 +61,14 @@ The result identifies the applied model and price. Check `status` before using
61
61
  its cost as a complete total: missing usage or unsupported rates can make a
62
62
  result `partial` or `unpriced`.
63
63
 
64
+ Azure Foundry pricing requires the deployment's underlying model version, SKU,
65
+ and Azure resource region. Verified GPT-6 Astra, Sol, and Luna Global Standard
66
+ deployments use a versioned model such as `model="gpt-6-luna@2026-09-22"`,
67
+ `channel="azure-foundry-global-standard"`, and `region="eastus"` with
68
+ `calculate_cost()`. A generic `provider="azure"` call stays unpriced because its
69
+ deployment type is unknown. Batch and cache-write usage remain partial where
70
+ the catalog lacks a matching rate.
71
+
64
72
  Served OpenAI `priority`/`fast` and Vertex `priority` calls use model-specific
65
73
  catalog rates where verified. Priority coverage starts on November 22, 2026.
66
74
  Requested Priority that falls back to standard uses standard pricing. Search
@@ -31,6 +31,14 @@ The result identifies the applied model and price. Check `status` before using
31
31
  its cost as a complete total: missing usage or unsupported rates can make a
32
32
  result `partial` or `unpriced`.
33
33
 
34
+ Azure Foundry pricing requires the deployment's underlying model version, SKU,
35
+ and Azure resource region. Verified GPT-6 Astra, Sol, and Luna Global Standard
36
+ deployments use a versioned model such as `model="gpt-6-luna@2026-09-22"`,
37
+ `channel="azure-foundry-global-standard"`, and `region="eastus"` with
38
+ `calculate_cost()`. A generic `provider="azure"` call stays unpriced because its
39
+ deployment type is unknown. Batch and cache-write usage remain partial where
40
+ the catalog lacks a matching rate.
41
+
34
42
  Served OpenAI `priority`/`fast` and Vertex `priority` calls use model-specific
35
43
  catalog rates where verified. Priority coverage starts on November 22, 2026.
36
44
  Requested Priority that falls back to standard uses standard pricing. Search
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "metergraph-core"
3
- version = "0.9.1"
3
+ version = "0.9.2"
4
4
  description = "Open, effective-dated LLM pricing catalog and deterministic cost calculator for popular models across major providers and gateways, including OpenAI, Anthropic, Google Gemini, AWS Bedrock, OpenRouter, Vercel AI Gateway, and more."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -10,6 +10,7 @@ from .catalog import CostComponents, CostResult, ModelUsage, direct_channel_for_
10
10
  from .loader import LoadedCatalog
11
11
  from .providers import model_identity
12
12
  from .providers.anthropic import rejected_without_usage
13
+ from .providers.google import rejected_without_usage as google_rejected_without_usage
13
14
  from .responses import _as_mapping, _bundled_catalog, _first, cost_from_response, response_format, _native_input_tokens
14
15
 
15
16
  _ZERO = Decimal('0')
@@ -305,7 +306,9 @@ def price_call_from_record(
305
306
  if row.get('input_tokens_include_cache') is True:
306
307
  values['input_tokens'] = _native_input_tokens(values, cost)
307
308
  token_cost = cost(**values)
308
- if normalize_provider(provider or '') == 'anthropic' and rejected_without_usage(row):
309
+ if (normalize_provider(provider or '') == 'anthropic' and rejected_without_usage(row)) or (
310
+ normalize_provider(provider or '') in {'google', 'vertex-ai'} and google_rejected_without_usage(row, channel)
311
+ ):
309
312
  free = replace(token_cost, cost_usd=_ZERO, status='priced',
310
313
  reasons=('provider_failure_not_billable',), missing_dimensions=(),
311
314
  components=CostComponents(_ZERO, _ZERO, _ZERO, _ZERO))
@@ -34,6 +34,8 @@ _PROVIDER_ALIASES = {
34
34
  _DIRECT_CHANNEL_BY_PROVIDER = {
35
35
  "anthropic": "anthropic-api",
36
36
  "openai": "openai-api",
37
+ # Generic Azure traffic has no channel: its deployment SKU must be known.
38
+ "azure-foundry-global-standard": "azure-foundry-global-standard",
37
39
  "google": "google-api",
38
40
  "vercel": "vercel-ai-gateway",
39
41
  "openrouter": "openrouter-api",
@@ -6,14 +6,15 @@
6
6
  #
7
7
  # Community updates welcome: add an alias or price entry with its provider
8
8
  # source_url and open a PR. CI validates structure and date overlaps.
9
- version: "2026-11-22.1"
9
+ version: "2026-11-25.1"
10
10
  currency: USD
11
- pricing_verified_at: "2026-11-22"
11
+ pricing_verified_at: "2026-11-25"
12
12
  models:
13
13
  - canonical_id: openai/gpt-6-sol
14
14
  publisher: openai
15
15
  family: {id: openai/gpt-sol, display_name: GPT Sol}
16
16
  aliases:
17
+ - {provider: azure-foundry-global-standard, alias: gpt-6-sol@2026-09-22, channel: azure-foundry-global-standard}
17
18
  - {provider: openai, alias: gpt-6-sol, channel: openai-api}
18
19
  - {provider: litellm, alias: gpt-6-sol, channel: openai-api}
19
20
  - {provider: unknown, alias: gpt-6-sol, channel: openai-api}
@@ -60,6 +61,17 @@ models:
60
61
  cache_write_5m_per_mtok: 5.0
61
62
  cache_write_1h_per_mtok: 10.0
62
63
  source_url: https://developers.openai.com/api/docs/models/gpt-6-sol
64
+ - channel: azure-foundry-global-standard
65
+ region: global
66
+ effective_from: "2026-09-22"
67
+ input_per_mtok: 2.00
68
+ output_per_mtok: 10.00
69
+ cache_read_per_mtok: 0.20
70
+ rules:
71
+ input_includes_cache_read: true
72
+ input_includes_cache_write: true
73
+ long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
74
+ source_url: https://azure.microsoft.com/en-us/blog/gpt-6-astra-sol-and-luna-for-production-agents-in-microsoft-foundry/
63
75
  - channel: vercel-ai-gateway
64
76
  region: global
65
77
  effective_from: "2026-09-23"
@@ -118,6 +130,7 @@ models:
118
130
  publisher: openai
119
131
  family: {id: openai/gpt-luna, display_name: GPT Luna}
120
132
  aliases:
133
+ - {provider: azure-foundry-global-standard, alias: gpt-6-luna@2026-09-22, channel: azure-foundry-global-standard}
121
134
  - {provider: openai, alias: gpt-6-luna, channel: openai-api}
122
135
  - {provider: litellm, alias: gpt-6-luna, channel: openai-api}
123
136
  - {provider: unknown, alias: gpt-6-luna, channel: openai-api}
@@ -164,6 +177,17 @@ models:
164
177
  cache_write_5m_per_mtok: 0.25
165
178
  cache_write_1h_per_mtok: 0.5
166
179
  source_url: https://developers.openai.com/api/docs/models/gpt-6-luna
180
+ - channel: azure-foundry-global-standard
181
+ region: global
182
+ effective_from: "2026-09-22"
183
+ input_per_mtok: 0.10
184
+ output_per_mtok: 0.50
185
+ cache_read_per_mtok: 0.01
186
+ rules:
187
+ input_includes_cache_read: true
188
+ input_includes_cache_write: true
189
+ long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
190
+ source_url: https://azure.microsoft.com/en-us/blog/gpt-6-astra-sol-and-luna-for-production-agents-in-microsoft-foundry/
167
191
  - channel: vercel-ai-gateway
168
192
  region: global
169
193
  effective_from: "2026-09-23"
@@ -222,6 +246,7 @@ models:
222
246
  publisher: openai
223
247
  family: {id: openai/gpt-astra, display_name: GPT Astra}
224
248
  aliases:
249
+ - {provider: azure-foundry-global-standard, alias: gpt-6-astra@2026-09-03, channel: azure-foundry-global-standard}
225
250
  - {provider: openai, alias: gpt-6-astra, channel: openai-api}
226
251
  - {provider: litellm, alias: gpt-6-astra, channel: openai-api}
227
252
  - {provider: unknown, alias: gpt-6-astra, channel: openai-api}
@@ -268,6 +293,17 @@ models:
268
293
  cache_write_5m_per_mtok: 25.0
269
294
  cache_write_1h_per_mtok: 50.0
270
295
  source_url: https://developers.openai.com/api/docs/models/gpt-6-astra
296
+ - channel: azure-foundry-global-standard
297
+ region: global
298
+ effective_from: "2026-09-22"
299
+ input_per_mtok: 10.00
300
+ output_per_mtok: 50.00
301
+ cache_read_per_mtok: 1.00
302
+ rules:
303
+ input_includes_cache_read: true
304
+ input_includes_cache_write: true
305
+ long_context: {threshold: 272000, input_multiplier: 2, output_multiplier: 1.5}
306
+ source_url: https://azure.microsoft.com/en-us/blog/gpt-6-astra-sol-and-luna-for-production-agents-in-microsoft-foundry/
271
307
  - channel: vercel-ai-gateway
272
308
  region: global
273
309
  effective_from: "2026-09-23"
@@ -212,12 +212,12 @@ sources:
212
212
  fingerprint: null
213
213
  low_risk: {eligible: false, dimensions: []}
214
214
 
215
- # The catalog does not carry Azure Foundry yet. Prices depend on the
216
- # deployment type (Global, Data Zone, Regional) and region.
215
+ # Review Foundry prices by deployment type. Only verified Global Standard
216
+ # rows are cataloged; this page is not an automatic refresh source.
217
217
  - id: azure-foundry-pricing
218
218
  provider: azure
219
- channel: azure-foundry
220
- catalog_channel: false
219
+ channel: azure-foundry-global-standard
220
+ catalog_channel: true
221
221
  url: https://azure.microsoft.com/en-us/pricing/details/ai-foundry-models/aoai/
222
222
  parser: html-tables
223
223
  dimensions: [input_per_mtok, output_per_mtok, cache_read_per_mtok, batch_input_per_mtok, batch_output_per_mtok]
@@ -0,0 +1,43 @@
1
+ """Native Google model identity conventions."""
2
+
3
+ import re
4
+ from collections.abc import Mapping
5
+ from typing import Any
6
+
7
+ _VERTEX_MODEL = re.compile(
8
+ r'projects/[^/]+/locations/[^/]+/publishers/google/models/([^/]+)'
9
+ )
10
+
11
+
12
+ def model_identity(model: Any, channel: str | None) -> tuple[Any, str | None]:
13
+ """A Vertex resource name identifies both the model and its native channel."""
14
+ match = _VERTEX_MODEL.fullmatch(model) if isinstance(model, str) else None
15
+ return (match.group(1), 'google-vertex-ai') if match else (model, channel)
16
+
17
+
18
+ def rejected_without_usage(row: Mapping[str, Any], channel: str | None) -> bool:
19
+ # Vertex request rejections are free; timeout completions can still be charged.
20
+ # Do not transfer this policy to Developer API, batch downloads or client timeouts.
21
+ # https://cloud.google.com/model-garden/pricing
22
+ if channel != 'google-vertex-ai' or row.get('batch') is True:
23
+ return False
24
+ if row.get('endpoint') not in {'models.generate_content', 'models.generate_content.stream'}:
25
+ return False
26
+ if not (row.get('error') is True or row.get('status') in {'error', 'failed'}):
27
+ return False
28
+ status = row.get('http_status_code')
29
+ if type(status) is not int or status not in {400, 401, 403, 404, 413, 422, 429}:
30
+ return False
31
+ # tool_calls can contain request history, not usage from this attempt.
32
+ counters = [row.get(key) for key in (
33
+ 'input_tokens', 'output_tokens', 'cache_read_tokens', 'cache_write_tokens',
34
+ 'cache_write_5m_tokens', 'cache_write_1h_tokens', 'reasoning_tokens',
35
+ 'web_search_calls', 'grounding_queries', 'grounded_prompt', 'search_queries',
36
+ 'search_units', 'url_fetch_calls',
37
+ )]
38
+ native = row.get('server_tool_use')
39
+ if native is not None:
40
+ if not isinstance(native, Mapping):
41
+ return False
42
+ counters.extend(native.values())
43
+ return all(value is None or (type(value) is int and value == 0) for value in counters)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metergraph-core
3
- Version: 0.9.1
3
+ Version: 0.9.2
4
4
  Summary: Open, effective-dated LLM pricing catalog and deterministic cost calculator for popular models across major providers and gateways, including OpenAI, Anthropic, Google Gemini, AWS Bedrock, OpenRouter, Vercel AI Gateway, and more.
5
5
  Author: Metergraph
6
6
  License-Expression: Apache-2.0
@@ -61,6 +61,14 @@ The result identifies the applied model and price. Check `status` before using
61
61
  its cost as a complete total: missing usage or unsupported rates can make a
62
62
  result `partial` or `unpriced`.
63
63
 
64
+ Azure Foundry pricing requires the deployment's underlying model version, SKU,
65
+ and Azure resource region. Verified GPT-6 Astra, Sol, and Luna Global Standard
66
+ deployments use a versioned model such as `model="gpt-6-luna@2026-09-22"`,
67
+ `channel="azure-foundry-global-standard"`, and `region="eastus"` with
68
+ `calculate_cost()`. A generic `provider="azure"` call stays unpriced because its
69
+ deployment type is unknown. Batch and cache-write usage remain partial where
70
+ the catalog lacks a matching rate.
71
+
64
72
  Served OpenAI `priority`/`fast` and Vertex `priority` calls use model-specific
65
73
  catalog rates where verified. Priority coverage starts on November 22, 2026.
66
74
  Requested Priority that falls back to standard uses standard pricing. Search
@@ -1,14 +0,0 @@
1
- """Native Google model identity conventions."""
2
-
3
- import re
4
- from typing import Any
5
-
6
- _VERTEX_MODEL = re.compile(
7
- r'projects/[^/]+/locations/[^/]+/publishers/google/models/([^/]+)'
8
- )
9
-
10
-
11
- def model_identity(model: Any, channel: str | None) -> tuple[Any, str | None]:
12
- """A Vertex resource name identifies both the model and its native channel."""
13
- match = _VERTEX_MODEL.fullmatch(model) if isinstance(model, str) else None
14
- return (match.group(1), 'google-vertex-ai') if match else (model, channel)