Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions templates/consumer-repo/tools/llm_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def configured_model_for_provider(
tier: str | None = None,
registry: list[ModelRegistryEntry] | None = None,
) -> str:
# Preserve the compatibility keyword while selection remains profile-based.
del tier
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment thread
stranske marked this conversation as resolved.
normalized_provider = normalize_provider(provider)
entries = registry if registry is not None else load_model_registry()
# An explicit slot config is an execution allowlist, including when its
Expand Down
21 changes: 21 additions & 0 deletions tests/tools/test_llm_registry_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ def test_profile_selection_normalizes_whitespace(
)


def test_configured_model_ignores_legacy_tier_when_profile_is_explicit(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
registry_path = tmp_path / "registry.json"
_write_registry(registry_path)
monkeypatch.setenv(registry.ENV_MODEL_REGISTRY_CONFIG, str(registry_path))

assert (
registry.configured_model_for_provider(
"openai", profile="verifier-balanced", tier="legacy-low"
)
== "model-balanced"
)
assert (
registry.configured_model_for_provider(
"openai", profile="verifier-balanced", tier="legacy-high"
)
== "model-balanced"
)


def test_loaded_registry_entries_leave_compatibility_quality_unset(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
) -> None:
Expand Down
2 changes: 2 additions & 0 deletions tools/llm_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ def configured_model_for_provider(
tier: str | None = None,
registry: list[ModelRegistryEntry] | None = None,
) -> str:
# Preserve the compatibility keyword while selection remains profile-based.
del tier
normalized_provider = normalize_provider(provider)
entries = registry if registry is not None else load_model_registry()
# An explicit slot config is an execution allowlist, including when its
Expand Down
Loading