metergraph-core 0.5.1__tar.gz → 0.5.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 (23) hide show
  1. {metergraph_core-0.5.1/src/metergraph_core.egg-info → metergraph_core-0.5.2}/PKG-INFO +1 -1
  2. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/pyproject.toml +1 -1
  3. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/data/prices.yaml +10 -2
  4. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/extractors.py +23 -6
  5. {metergraph_core-0.5.1 → metergraph_core-0.5.2/src/metergraph_core.egg-info}/PKG-INFO +1 -1
  6. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/MANIFEST.in +0 -0
  7. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/README.md +0 -0
  8. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/setup.cfg +0 -0
  9. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/__init__.py +0 -0
  10. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/billing.py +0 -0
  11. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/catalog.py +0 -0
  12. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/catalog_delta.py +0 -0
  13. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/data/models.yaml +0 -0
  14. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/data/sources.yaml +0 -0
  15. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/loader.py +0 -0
  16. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/models.py +0 -0
  17. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/refresh.py +0 -0
  18. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/retrieval.py +0 -0
  19. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core/sources.py +0 -0
  20. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core.egg-info/SOURCES.txt +0 -0
  21. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core.egg-info/dependency_links.txt +0 -0
  22. {metergraph_core-0.5.1 → metergraph_core-0.5.2}/src/metergraph_core.egg-info/requires.txt +0 -0
  23. {metergraph_core-0.5.1 → metergraph_core-0.5.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.5.1
3
+ Version: 0.5.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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "metergraph-core"
3
- version = "0.5.1"
3
+ version = "0.5.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"
@@ -6,9 +6,9 @@
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-10-20"
9
+ version: "2026-10-21"
10
10
  currency: USD
11
- pricing_verified_at: "2026-10-20"
11
+ pricing_verified_at: "2026-10-21"
12
12
  models:
13
13
  - canonical_id: openai/gpt-6-sol
14
14
  publisher: openai
@@ -2980,6 +2980,7 @@ models:
2980
2980
  channel: vercel-ai-gateway
2981
2981
  rules:
2982
2982
  input_includes_cache_read: true
2983
+ - {provider: meta, alias: muse-spark-1.3, channel: meta-api, rules: {input_includes_cache_read: true}}
2983
2984
  prices:
2984
2985
  - channel: vercel-ai-gateway
2985
2986
  region: global
@@ -2988,6 +2989,13 @@ models:
2988
2989
  output_per_mtok: 4.25
2989
2990
  cache_read_per_mtok: 0.15
2990
2991
  source_url: https://ai-gateway.vercel.sh/v1/models
2992
+ - channel: meta-api
2993
+ region: global
2994
+ effective_from: "2026-09-11"
2995
+ input_per_mtok: 1.25
2996
+ output_per_mtok: 4.25
2997
+ cache_read_per_mtok: 0.15
2998
+ source_url: https://vercel.com/ai-gateway/models/muse-spark-1.3
2991
2999
 
2992
3000
  - canonical_id: thinkingmachines/inkling
2993
3001
  publisher: thinkingmachines
@@ -192,27 +192,44 @@ def parse_anthropic(html_text: str, *, duplicates: list[str] | None = None) -> T
192
192
 
193
193
 
194
194
  _GOOGLE_LABELS = ("Input price", "Output price", "Context caching price")
195
+ _GOOGLE_ID = re.compile(r"[a-z0-9][a-z0-9.-]*")
196
+
197
+
198
+ def _google_ids(cells: list[str]) -> list[str]:
199
+ """The model ids ending a block's heading: one id, or several joined by
200
+ "and" when a variant shares the model's prices. A lowercase cell not
201
+ joined by "and" is not an id."""
202
+ ids: list[str] = []
203
+ end = len(cells)
204
+ while end and cells[end - 1] != "and" and _GOOGLE_ID.fullmatch(cells[end - 1]):
205
+ ids.insert(0, cells[end - 1])
206
+ if end < 2 or cells[end - 2] != "and":
207
+ break
208
+ end -= 2
209
+ return ids
195
210
 
196
211
 
197
212
  def parse_google(html_text: str, *, duplicates: list[str] | None = None) -> Table:
198
213
  """The Gemini API page: each model's id precedes its "Try it" link, and
199
214
  its paid-tier prices follow. Where a price is dated the first amount is
200
- the one in effect; per-image output is not a token rate."""
215
+ the one in effect; per-image output is not a token rate. A label may name
216
+ the media it covers, as in "Input price (text, image, video)"."""
201
217
  parts = page_text(html_text).split("Try it in Google AI Studio")
202
218
  tier = r"(?:Free of charge \| |Not available \| )?([^|]*\$[^|]*)"
203
219
  table: Table = {}
204
220
  for before, block in zip(parts, parts[1:]):
205
- cells = [c.strip() for c in before.split("|") if c.strip()]
206
- if not cells or not re.fullmatch(r"[a-z0-9][a-z0-9.-]*", cells[-1]):
221
+ ids = _google_ids([c.strip() for c in before.split("|") if c.strip()])
222
+ if not ids:
207
223
  continue
208
- inp = re.search(r"Input price \| " + tier, block)
224
+ inp = re.search(r"Input price[^|]*\| " + tier, block)
209
225
  out = re.search(r"Output price[^|]*\| " + tier, block)
210
226
  if not (inp and out):
211
227
  continue
212
- cache = re.search(r"Context caching price \| " + tier, block)
228
+ cache = re.search(r"Context caching price[^|]*\| " + tier, block)
213
229
  output = None if "per image" in out.group(1) else dollars(out.group(1))
214
230
  rates = {"input": dollars(inp.group(1)), "output": output, "cache_read": dollars(cache.group(1)) if cache else None}
215
- _keep_first(table, cells[-1], {k: v for k, v in rates.items() if v is not None}, duplicates)
231
+ for model_id in ids:
232
+ _keep_first(table, model_id, {k: v for k, v in rates.items() if v is not None}, duplicates)
216
233
  return table
217
234
 
218
235
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metergraph-core
3
- Version: 0.5.1
3
+ Version: 0.5.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