Breaking change: openrouter_models.json -> custom_models.json

* Support for Custom URLs and custom models, including locally hosted models such as ollama
* Support for native + openrouter + local models (i.e. dozens of models) means you can start delegating sub-tasks to particular models or work to local models such as localizations or other boring work etc.
* Several tests added
* precommit to also include untracked (new) files
* Logfile auto rollover
* Improved logging
This commit is contained in:
Fahad
2025-06-13 15:22:09 +04:00
parent f5fdf7b2ed
commit f44ca326ef
27 changed files with 1692 additions and 351 deletions

View File

@@ -50,8 +50,8 @@ class TestOpenRouterModelRegistry:
try:
# Set environment variable
original_env = os.environ.get("OPENROUTER_MODELS_PATH")
os.environ["OPENROUTER_MODELS_PATH"] = temp_path
original_env = os.environ.get("CUSTOM_MODELS_CONFIG_PATH")
os.environ["CUSTOM_MODELS_CONFIG_PATH"] = temp_path
# Create registry without explicit path
registry = OpenRouterModelRegistry()
@@ -63,9 +63,9 @@ class TestOpenRouterModelRegistry:
finally:
# Restore environment
if original_env is not None:
os.environ["OPENROUTER_MODELS_PATH"] = original_env
os.environ["CUSTOM_MODELS_CONFIG_PATH"] = original_env
else:
del os.environ["OPENROUTER_MODELS_PATH"]
del os.environ["CUSTOM_MODELS_CONFIG_PATH"]
os.unlink(temp_path)
def test_alias_resolution(self):