Close local release-quality gaps and reconcile workplan status
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a0e332-3365-77c0-8491-084e9ea33ac1
This commit is contained in:
parent
37436bb562
commit
7cd633986e
56 changed files with 462 additions and 237 deletions
|
|
@ -7,7 +7,6 @@ from dataclasses import dataclass
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
DEFAULT_RATE_SOURCE_URL = "https://openrouter.ai/models"
|
||||
DEFAULT_RATE_CAPTURED_AT = "2026-05-17"
|
||||
DEFAULT_RATE_CURRENCY = "USD"
|
||||
|
|
@ -60,12 +59,12 @@ class ModelRateRegistry:
|
|||
return dict(self._rates)
|
||||
|
||||
@classmethod
|
||||
def default(cls) -> "ModelRateRegistry":
|
||||
def default(cls) -> ModelRateRegistry:
|
||||
"""Return the bundled OpenRouter list-price snapshot."""
|
||||
return cls(_default_rate_payload())
|
||||
|
||||
@classmethod
|
||||
def from_yaml(cls, path: Path | str) -> "ModelRateRegistry":
|
||||
def from_yaml(cls, path: Path | str) -> ModelRateRegistry:
|
||||
"""Load rates from a YAML file.
|
||||
|
||||
The expected shape matches the historic infospace-bench table::
|
||||
|
|
@ -84,7 +83,7 @@ class ModelRateRegistry:
|
|||
payload = _load_yaml_mapping(Path(path))
|
||||
return cls(_rates_from_payload(payload))
|
||||
|
||||
def merged_with(self, override: "ModelRateRegistry") -> "ModelRateRegistry":
|
||||
def merged_with(self, override: ModelRateRegistry) -> ModelRateRegistry:
|
||||
"""Return a new registry where *override* entries win by model id."""
|
||||
merged = self.all()
|
||||
merged.update(override.all())
|
||||
|
|
@ -111,9 +110,9 @@ def _default_rate_payload() -> dict[str, ModelRate]:
|
|||
rates: dict[str, ModelRate] = {}
|
||||
for model_id, values in _DEFAULT_RATES.items():
|
||||
if len(values) == 3:
|
||||
prompt_rate, completion_rate, captured_at = values # type: ignore[misc]
|
||||
prompt_rate, completion_rate, captured_at = values
|
||||
else:
|
||||
prompt_rate, completion_rate = values # type: ignore[misc]
|
||||
prompt_rate, completion_rate = values
|
||||
captured_at = DEFAULT_RATE_CAPTURED_AT
|
||||
rates[model_id] = ModelRate(
|
||||
model_id=model_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue