- Keep local
models.jsonas the default pricing source. - Allow user overrides to take highest priority.
- Add an opt-in remote fallback (models.dev) with caching and explicit merge rules.
- Provide a
--no-remoteoption to force local-only behavior.
- User override file (highest priority; optional).
- Repo default
ocmonitor/models.json. - Remote fallback (opt-in, only fills missing data; never overwrites user/local values).
models.remote_fallback = false(default)models.remote_url = "https://models.dev"(or a specific endpoint if needed)models.remote_cache_ttl_hours = 24models.remote_cache_path = "~/.cache/ocmonitor/models.remote.json"models.user_file = "~/.config/ocmonitor/models.json"(optional override)
--no-remoteflag to disable remote fetch for the current run (overrides config).
- Add config fields in
/Users/shelli/Documents/apps/ocmonitor-share/ocmonitor/config.pyand update default config in/Users/shelli/Documents/apps/ocmonitor-share/ocmonitor/config.toml. - Create remote fetcher
services/price_fetcher.py:- Fetch JSON from
models.remote_url. - Validate schema (must include model name and required fields).
- Store to cache path with timestamp metadata.
- Fetch JSON from
- Cache logic:
- If cache exists and is fresh (TTL), use cache.
- If stale or missing, fetch and refresh cache.
- If fetch fails, fall back to local sources and log a warning.
- Merge rules in a single function (e.g.
merge_model_prices()):- Start with repo defaults.
- Overlay user override file (per-field override).
- If remote enabled, only fill missing models or missing fields.
- Do not overwrite fields already defined locally.
- Wire into pricing load path in
/Users/shelli/Documents/apps/ocmonitor-share/ocmonitor/services/session_analyzer.pyor wherever pricing is loaded today. - Add
--no-remoteflag to CLI in/Users/shelli/Documents/apps/ocmonitor-share/ocmonitor/cli.pyand pass through to pricing loader. - Logging:
- Log when remote data is used.
- Log warnings on fetch/parse failures, but do not fail commands.
- Tests in
/Users/shelli/Documents/apps/ocmonitor-share/tests/:- Merge precedence tests (user > local > remote).
- Cache TTL behavior.
--no-remotedisables fetch.- Remote failure fallback.
- Docs updates:
/Users/shelli/Documents/apps/ocmonitor-share/README.md/Users/shelli/Documents/apps/ocmonitor-share/DOCUMENTATION.md