OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.
Python
fix: exclude both luna generations and their dated snapshots (#2444)
Rico Furtadoe036eccaff6a
diff --git a/docs/docs/reference/configuration.mdx b/docs/docs/reference/configuration.mdxindex 88049184e..e1bdc350c 100644--- a/docs/docs/reference/configuration.mdx+++ b/docs/docs/reference/configuration.mdx@@ -149,6 +149,16 @@ matching is against the id as the picker shows it — `gpt-3.5-turbo`, notname also covers Azure's regional listings (`eu/gpt-5.6-luna`,`us/gpt-5.6-luna`); write `eu/*` to reach one region on its own.+A pattern without a wildcard matches that id and nothing else, so it does **not**+cover the provider's dated snapshots — `gpt-5.6-luna` leaves+`gpt-5.6-luna-2026-07-09` in the picker. To suppress a model and every snapshot+of it, end the pattern with `*`.++Excluding an id hides it from the pickers and from the live+`/models/{provider}` lists. It does not unroute it: an operator who types the+id by hand still reaches the model. Exclusion is a curation tool, not an access+control.+Exclusions are per provider row. Azure OpenAI serves the same models asOpenAI, so a model you want gone from both needs the pattern on both rows.diff --git a/src/config/model_providers.yaml b/src/config/model_providers.yamlindex 6d7e760d1..0e9db29eb 100644--- a/src/config/model_providers.yaml+++ b/src/config/model_providers.yaml@@ -40,7 +40,19 @@ providers:saas: trueexclude_models:- gpt-3.5-* # a whole generation, superseded and near retirement- - gpt-5.6-luna # refuses function tools on /v1/chat/completions+ # Refuses function tools on /v1/chat/completions. Both generations, and+ # the trailing `*` for the dated snapshots (`gpt-5.6-luna-2026-07-09`):+ # an exact pattern matches the undated id only, so a snapshot released+ # later reappears in the picker on its own.+ #+ # LiteLLM's table reports `supports_function_calling: true` for every+ # luna row, including the 5.6 that does not — which is why the exclusion+ # is hand-maintained here rather than read off the catalogue. Treat a new+ # luna generation as defective until someone proves otherwise with a real+ # tool call: an id excluded here can still be typed by hand, so hiding a+ # working model costs less than offering a broken one.+ - gpt-5.6-luna*+ - gpt-6-luna*- name: ollamadisplay_name: Ollama@@ -168,10 +180,12 @@ providers:on_prem: truesaas: true# Azure serves the same OpenAI models, so it needs the same exclusions.- # The plain name covers the regional ids (`eu/`, `us/`, `global/`) too.+ # The plain name covers the regional ids (`eu/`, `us/`, `global/`) too;+ # see the openai row above for why both luna generations are wildcarded.exclude_models:- gpt-3.5-*- - gpt-5.6-luna+ - gpt-5.6-luna*+ - gpt-6-luna*# Azure lets you name a deployment anything, so LiteLLM's table cannot know# yours. Declare them here and they appear in the pickers for everyone;# otherwise each user has to type the name into the model box by hand.diff --git a/tests/unit/known_failures.txt b/tests/unit/known_failures.txtindex 3d3cc8964..5d4b6c522 100644--- a/tests/unit/known_failures.txt+++ b/tests/unit/known_failures.txt@@ -22,7 +22,6 @@ tests/unit/config/test_model_providers_config.py::test_shipped_defaults_keep_olltests/unit/config/test_model_providers_config.py::test_both_azure_providers_ship_in_every_modetests/unit/services/test_model_catalog.py::test_catalog_publishes_azure_ai_where_the_config_enables_ittests/unit/services/test_model_catalog.py::test_azure_openai_is_the_row_that_carries_the_gpt_41_family-tests/unit/services/test_model_catalog.py::test_the_shipped_config_excludes_on_azure_as_well_as_openaitests/unit/services/test_skip_os_security_setup_startup.py::test_setup_runs_when_flag_falsetests/unit/services/test_skip_os_security_setup_startup.py::test_setup_skipped_when_flag_truetests/unit/test_agent_sources_fence_stripped.py::test_fence_untrusted_text_escapes_embedded_end_delimiterdiff --git a/tests/unit/services/test_model_catalog.py b/tests/unit/services/test_model_catalog.pyindex 67f8ee302..6d7186446 100644--- a/tests/unit/services/test_model_catalog.py+++ b/tests/unit/services/test_model_catalog.py@@ -495,6 +495,40 @@ def test_the_shipped_config_excludes_on_azure_as_well_as_openai(monkeypatch) ->assert not [model_id for model_id in ids if "gpt-3.5" in model_id or "luna" in model_id]+def test_an_exclusion_without_a_wildcard_leaves_the_dated_snapshots(monkeypatch) -> None:+ """Why the shipped luna patterns end in `*`.++ A pattern with no wildcard matches that id alone, so the provider's dated+ snapshot of the same model stays in the picker — which is how+ `gpt-5.6-luna-2026-07-09` survived an exclusion of `gpt-5.6-luna`. Pinned+ because the fix is a single character in a YAML file and reads like a typo.+ """+ monkeypatch.setenv("OPENRAG_RUN_MODE", "oss")+ exact = model_catalog._excluded("gpt-5.6-luna-2026-07-09", ("gpt-5.6-luna",))+ wildcard = model_catalog._excluded("gpt-5.6-luna-2026-07-09", ("gpt-5.6-luna*",))++ assert not exact+ assert wildcard+ # The wildcard keeps covering the regional forms the bare name covered.+ assert model_catalog._excluded("us/gpt-5.6-luna", ("gpt-5.6-luna*",))+++def test_both_luna_generations_are_excluded_from_both_rows(monkeypatch) -> None:+ """LiteLLM's table cannot be trusted for this, so the config carries it.++ Every luna row reports `supports_function_calling: true`, including the 5.6+ that refuses them in practice — which is why the exclusion is+ hand-maintained. A new generation is treated as defective until proven+ otherwise, since an excluded id can still be typed by hand but a broken one+ offered in the picker fails at agent runtime.+ """+ monkeypatch.setenv("OPENRAG_RUN_MODE", "oss")+ for provider in ("openai", "azure"):+ patterns = model_catalog.exclusions_for(provider)+ assert any(pattern.startswith("gpt-5.6-luna") for pattern in patterns), provider+ assert any(pattern.startswith("gpt-6-luna") for pattern in patterns), provider++@pytest.mark.asyncioasync def test_live_model_failure_does_not_block_other_provider_refreshes(monkeypatch):calls: list[str] = []