Load model capabilities configuration from JSON file. Uses LRU cache to avoid repeated file reads. Raises FileNotFoundError if config is missing.
()
| 27 | |
| 28 | @lru_cache(maxsize=1) |
| 29 | def _load_config() -> dict[str, Any]: |
| 30 | """ |
| 31 | Load model capabilities configuration from JSON file. |
| 32 | |
| 33 | Uses LRU cache to avoid repeated file reads. |
| 34 | Raises FileNotFoundError if config is missing. |
| 35 | """ |
| 36 | if not _CONFIG_PATH.exists(): |
| 37 | raise FileNotFoundError(f"Model capabilities config not found: {_CONFIG_PATH}") |
| 38 | |
| 39 | with open(_CONFIG_PATH, encoding="utf-8") as f: |
| 40 | return json.load(f) |
| 41 | |
| 42 | |
| 43 | def reload_config() -> None: |
no test coverage detected