Implement LLM-WP-0007: Kimi K3 default and EUR spend reporting
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Has been cancelled

Add moonshotai/kimi-k3 as OpenRouter basemodel default after live smoke,
USD→EUR cost conversion, append-only usage ledger, and CLI run/cost/spend
week commands with token and euro reporting.
This commit is contained in:
tegwick 2026-08-03 22:00:34 +02:00
parent f3121c3f1f
commit 09aa1f3604
21 changed files with 1396 additions and 103 deletions

View file

@ -45,6 +45,7 @@ from llm_connect.exceptions import (
)
from llm_connect.models import LLMResponse, RunConfig
from llm_connect.profiles import ProfiledLLMAdapter, default_runtime_profiles
from llm_connect.usage import maybe_record_usage, suppress_auto_usage_record
class _Handler(BaseHTTPRequestHandler):
@ -101,8 +102,19 @@ class _Handler(BaseHTTPRequestHandler):
"Adapter rejected RunConfig",
context={"model_name": config.model_name},
)
response = adapter.execute_prompt(prompt, config)
with suppress_auto_usage_record():
response = adapter.execute_prompt(prompt, config)
latency = time.time() - start
provider = (
(response.metadata or {}).get("provider")
or getattr(adapter, "provider_id", None)
or type(adapter).__name__
)
maybe_record_usage(
response,
provider=str(provider),
source="server",
)
body = response.to_dict()
debug = diagnostics.to_dict() if diagnostics is not None else None
if debug_enabled and debug is not None: