metergraph-core 0.7.5__tar.gz → 0.8.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.
Files changed (24) hide show
  1. {metergraph_core-0.7.5/src/metergraph_core.egg-info → metergraph_core-0.8.0}/PKG-INFO +1 -1
  2. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/pyproject.toml +1 -1
  3. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/data/models.yaml +46 -1
  4. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/data/prices.yaml +34 -0
  5. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/data/sources.yaml +10 -0
  6. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/extractors.py +26 -2
  7. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/models.py +10 -1
  8. {metergraph_core-0.7.5 → metergraph_core-0.8.0/src/metergraph_core.egg-info}/PKG-INFO +1 -1
  9. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/MANIFEST.in +0 -0
  10. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/README.md +0 -0
  11. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/setup.cfg +0 -0
  12. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/__init__.py +0 -0
  13. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/billing.py +0 -0
  14. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/catalog.py +0 -0
  15. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/catalog_delta.py +0 -0
  16. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/loader.py +0 -0
  17. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/refresh.py +0 -0
  18. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/responses.py +0 -0
  19. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/retrieval.py +0 -0
  20. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core/sources.py +0 -0
  21. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core.egg-info/SOURCES.txt +0 -0
  22. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core.egg-info/dependency_links.txt +0 -0
  23. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/src/metergraph_core.egg-info/requires.txt +0 -0
  24. {metergraph_core-0.7.5 → metergraph_core-0.8.0}/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.7.5
3
+ Version: 0.8.0
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.7.5"
3
+ version = "0.8.0"
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"
@@ -1,4 +1,4 @@
1
- version: '2026-10-19'
1
+ version: '2026-10-27'
2
2
  models:
3
3
  - canonical_id: openai/gpt-5.6-sol
4
4
  display_name: GPT-5.6 Sol
@@ -852,6 +852,42 @@ models:
852
852
  pricing_channel: vercel-ai-gateway
853
853
  execution_profiles:
854
854
  - default
855
+ - canonical_id: openai/gpt-6.1-terra
856
+ display_name: GPT-6.1 Terra
857
+ publisher: openai
858
+ routes:
859
+ - key: default:openai:gpt-6.1-terra
860
+ id: openai:gpt-6.1-terra
861
+ provider: openai
862
+ model_id: gpt-6.1-terra
863
+ pricing_channel: openai-api
864
+ execution_profiles:
865
+ - default
866
+ display_name: GPT-6.1 Terra
867
+ - canonical_id: moonshotai/kimi-k3.1-pro
868
+ display_name: Kimi K3.1 Pro
869
+ publisher: moonshotai
870
+ routes:
871
+ - key: default:moonshotai:kimi-k3.1-pro
872
+ id: moonshotai:kimi-k3.1-pro
873
+ provider: moonshotai
874
+ model_id: kimi-k3.1-pro
875
+ pricing_channel: moonshot-api
876
+ execution_profiles:
877
+ - default
878
+ display_name: Kimi K3.1 Pro (direct)
879
+ - canonical_id: moonshotai/kimi-k3.1-pro-highspeed
880
+ display_name: Kimi K3.1 Pro Highspeed
881
+ publisher: moonshotai
882
+ routes:
883
+ - key: default:moonshotai:kimi-k3.1-pro-highspeed
884
+ id: moonshotai:kimi-k3.1-pro-highspeed
885
+ provider: moonshotai
886
+ model_id: kimi-k3.1-pro-highspeed
887
+ pricing_channel: moonshot-api
888
+ execution_profiles:
889
+ - default
890
+ display_name: Kimi K3.1 Pro Highspeed (direct)
855
891
  execution_profiles:
856
892
  - id: default
857
893
  routes:
@@ -924,6 +960,9 @@ execution_profiles:
924
960
  - default:openai:gpt-6.1-sol
925
961
  - default:anthropic:claude-sonnet-5-5
926
962
  - default:anthropic:claude-haiku-5-5
963
+ - default:openai:gpt-6.1-terra
964
+ - default:moonshotai:kimi-k3.1-pro
965
+ - default:moonshotai:kimi-k3.1-pro-highspeed
927
966
  - id: bedrock
928
967
  routes:
929
968
  - bedrock:anthropic/claude-sonnet-5
@@ -1005,6 +1044,7 @@ offer_groups:
1005
1044
  - default:openai:gpt-5.4-mini
1006
1045
  - default:openai:gpt-5.4-nano
1007
1046
  - default:openai:gpt-6.1-sol
1047
+ - default:openai:gpt-6.1-terra
1008
1048
  - id: anthropic-direct
1009
1049
  credential: ANTHROPIC_API_KEY
1010
1050
  routes:
@@ -1014,6 +1054,11 @@ offer_groups:
1014
1054
  - default:anthropic:claude-haiku-4-5
1015
1055
  - default:anthropic:claude-sonnet-5-5
1016
1056
  - default:anthropic:claude-haiku-5-5
1057
+ - id: moonshot-direct
1058
+ credential: MOONSHOT_API_KEY
1059
+ routes:
1060
+ - default:moonshotai:kimi-k3.1-pro
1061
+ - default:moonshotai:kimi-k3.1-pro-highspeed
1017
1062
  - id: bedrock
1018
1063
  credential: null
1019
1064
  routes:
@@ -3188,6 +3188,40 @@ models:
3188
3188
  rules:
3189
3189
  varies_by_provider: true
3190
3190
  source_url: https://openrouter.ai/api/v1/models
3191
+ - canonical_id: moonshotai/kimi-k3.1-pro
3192
+ publisher: moonshotai
3193
+ aliases:
3194
+ - {provider: moonshotai, alias: kimi-k3.1-pro, channel: moonshot-api}
3195
+ - {provider: unknown, alias: kimi-k3.1-pro, channel: moonshot-api}
3196
+ - {provider: litellm, alias: kimi-k3.1-pro, channel: moonshot-api}
3197
+ prices:
3198
+ - channel: moonshot-api
3199
+ region: global
3200
+ effective_from: "2026-10-24"
3201
+ input_per_mtok: 2.00
3202
+ output_per_mtok: 10.00
3203
+ cache_read_per_mtok: 0.20
3204
+ cache_write_5m_per_mtok: 2.00
3205
+ rules: {input_includes_cache_read: true, input_includes_cache_write: true}
3206
+ source_url: https://platform.kimi.ai/
3207
+
3208
+ - canonical_id: moonshotai/kimi-k3.1-pro-highspeed
3209
+ publisher: moonshotai
3210
+ aliases:
3211
+ - {provider: moonshotai, alias: kimi-k3.1-pro-highspeed, channel: moonshot-api}
3212
+ - {provider: unknown, alias: kimi-k3.1-pro-highspeed, channel: moonshot-api}
3213
+ - {provider: litellm, alias: kimi-k3.1-pro-highspeed, channel: moonshot-api}
3214
+ prices:
3215
+ - channel: moonshot-api
3216
+ region: global
3217
+ effective_from: "2026-10-24"
3218
+ input_per_mtok: 4.00
3219
+ output_per_mtok: 20.00
3220
+ cache_read_per_mtok: 0.20
3221
+ cache_write_5m_per_mtok: 4.00
3222
+ rules: {input_includes_cache_read: true, input_includes_cache_write: true}
3223
+ source_url: https://platform.kimi.ai/
3224
+
3191
3225
  - canonical_id: moonshotai/kimi-k3
3192
3226
  publisher: moonshotai
3193
3227
  aliases:
@@ -152,6 +152,16 @@ sources:
152
152
  fingerprint: null
153
153
  low_risk: {eligible: false, dimensions: []}
154
154
 
155
+ - id: moonshot-api-pricing
156
+ provider: moonshotai
157
+ channel: moonshot-api
158
+ catalog_channel: true
159
+ url: https://platform.kimi.ai/
160
+ parser: html-price-prose
161
+ dimensions: [input_per_mtok, output_per_mtok, cache_read_per_mtok, cache_write_5m_per_mtok]
162
+ fingerprint: null
163
+ low_risk: {eligible: false, dimensions: []}
164
+
155
165
  # Gemini and partner models on Vertex AI. Prices vary by model, context
156
166
  # length, tier and processing mode; reviewed discovery only. The URL is the
157
167
  # current destination of Google's Vertex AI generative pricing page
@@ -7,8 +7,8 @@ the parser id a source registry entry names.
7
7
  Official parsers (OpenAI, Anthropic, Google, DeepSeek, Mistral, xAI and
8
8
  Perplexity) turn a page into ``{model name: {field: Decimal}}`` tables keyed
9
9
  by the page's own model spelling; :func:`extract` maps those to catalog
10
- price columns. The two generic discovery parsers, ``html-tables`` and
11
- ``gpu-license-prose``, record normalized evidence from any page for a
10
+ price columns. The generic discovery parsers, ``html-tables``,
11
+ ``html-price-prose``, and ``gpu-license-prose`` record normalized evidence for a
12
12
  reviewer and never produce applicable price rows; the license parser's
13
13
  evidence is GPU or license pricing, never token rates.
14
14
 
@@ -886,6 +886,23 @@ def _table_features(content: str) -> Any:
886
886
  return {"headers": sorted(list(row) for row in headers)}
887
887
 
888
888
 
889
+ def _price_prose_evidence(content: str) -> dict[str, Any]:
890
+ text = page_text(content)
891
+ mentions = []
892
+ amounts = []
893
+ for match in _AMOUNT.finditer(text):
894
+ amounts.append(match.group()[1:].replace(",", ""))
895
+ excerpt = text[max(0, match.start() - 300):match.end() + 100].strip(" |")
896
+ if excerpt not in mentions:
897
+ mentions.append(excerpt)
898
+ return {"kind": "price_mentions", "mentions": mentions[:100], "amounts": amounts[:100]}
899
+
900
+
901
+ def _price_prose_features(content: str) -> Any:
902
+ text = _AMOUNT.sub("$#", page_text(content))
903
+ return {"has_prices": "$#" in text, "has_model": "model" in text.lower()}
904
+
905
+
889
906
  _LICENSE_CANDIDATES = {
890
907
  "license_per_gpu_year_usd": re.compile(r"\$([0-9][0-9,]*(?:\.[0-9]+)?) per GPU per year"),
891
908
  "gpu_hour_usd": re.compile(r"\$([0-9][0-9,]*(?:\.[0-9]+)?) per GPU per hour"),
@@ -964,6 +981,12 @@ def redact_evidence(evidence: Mapping[str, Any]) -> dict[str, Any]:
964
981
  "statement_count": len(evidence.get("statements") or []),
965
982
  "candidates": dict(evidence.get("candidates") or {}),
966
983
  }
984
+ if kind == "price_mentions":
985
+ return {
986
+ "kind": kind,
987
+ "redacted": True,
988
+ "amounts": list(evidence.get("amounts") or []),
989
+ }
967
990
  return {"kind": kind, "redacted": True}
968
991
 
969
992
 
@@ -1006,6 +1029,7 @@ PARSERS: Mapping[str, ParserSpec] = MappingProxyType(
1006
1029
  # Generic discovery parsers: any page's tables, or GPU and license
1007
1030
  # pricing stated in prose. They describe no provider's layout.
1008
1031
  "html-tables": ParserSpec(False, _table_features, evidence=_table_evidence),
1032
+ "html-price-prose": ParserSpec(False, _price_prose_features, evidence=_price_prose_evidence),
1009
1033
  "gpu-license-prose": ParserSpec(False, _license_features, evidence=_license_evidence),
1010
1034
  }
1011
1035
  )
@@ -15,12 +15,18 @@ from .loader import LoadedCatalog
15
15
 
16
16
 
17
17
  EXECUTION_PROFILES = frozenset({"default", "bedrock"})
18
- ROUTE_PROVIDERS = frozenset({"anthropic", "bedrock", "fireworks", "openai", "vercel"})
18
+ # Route providers use the catalog's normalized provider names: Moonshot is
19
+ # "moonshotai", the name its catalog aliases carry ("moonshot" is only an
20
+ # input alias the catalog normalizes).
21
+ ROUTE_PROVIDERS = frozenset(
22
+ {"anthropic", "bedrock", "fireworks", "moonshotai", "openai", "vercel"}
23
+ )
19
24
  ROUTE_PROVIDER_CHANNELS = MappingProxyType(
20
25
  {
21
26
  "anthropic": "anthropic-api",
22
27
  "bedrock": "aws-bedrock",
23
28
  "fireworks": "fireworks-api",
29
+ "moonshotai": "moonshot-api",
24
30
  "openai": "openai-api",
25
31
  "vercel": "vercel-ai-gateway",
26
32
  }
@@ -31,6 +37,7 @@ OFFER_GROUP_PROFILES = MappingProxyType(
31
37
  "fireworks": "default",
32
38
  "openai-direct": "default",
33
39
  "anthropic-direct": "default",
40
+ "moonshot-direct": "default",
34
41
  "bedrock": "bedrock",
35
42
  }
36
43
  )
@@ -40,6 +47,7 @@ OFFER_GROUP_CREDENTIALS = MappingProxyType(
40
47
  "fireworks": "FIREWORKS_API_KEY",
41
48
  "openai-direct": "OPENAI_API_KEY",
42
49
  "anthropic-direct": "ANTHROPIC_API_KEY",
50
+ "moonshot-direct": "MOONSHOT_API_KEY",
43
51
  "bedrock": None,
44
52
  }
45
53
  )
@@ -49,6 +57,7 @@ OFFER_GROUP_PROVIDERS = MappingProxyType(
49
57
  "fireworks": "fireworks",
50
58
  "openai-direct": "openai",
51
59
  "anthropic-direct": "anthropic",
60
+ "moonshot-direct": "moonshotai",
52
61
  "bedrock": "bedrock",
53
62
  }
54
63
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metergraph-core
3
- Version: 0.7.5
3
+ Version: 0.8.0
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