Skip to content

Commit 71e0b58

Browse files
committed
remove deprecation warning from byo-llm
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent a63c816 commit 71e0b58

3 files changed

Lines changed: 24 additions & 82 deletions

File tree

docs/design/llama-stack-config-merge/llama-stack-config-merge.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ Key shape:
3636
- `llama_stack.config.baseline: default | byo-llm | empty` — pick
3737
LCORE's built-in baseline (includes a conditional OpenAI provider),
3838
the same baseline without that OpenAI row, or an empty dict (used by
39-
the migration tool for exact round-trip). `default` emits a deprecation
40-
WARN naming `byo-llm`.
39+
the migration tool for exact round-trip).
4140
- Legacy two-file mode (`llama_stack.library_client_config_path` +
4241
external `run.yaml`) is preserved during a deprecation window;
4342
mutually exclusive with the unified *synthesis inputs* (a non-empty
@@ -459,8 +458,7 @@ September 2026.
459458
Else if `unified` and `unified.baseline == "empty"` → `{}`. Else →
460459
`default_baseline` arg or `load_default_baseline()`. If the selector
461460
is `byo-llm`, strip the built-in conditional OpenAI inference row.
462-
If the selector is `default` or omitted, emit a deprecation WARN
463-
naming `byo-llm`. `empty` and `profile:` are unchanged.
461+
`empty` and `profile:` are unchanged.
464462
3. Run `dedupe_providers_vector_io` on the baseline.
465463
4. Apply existing enrichment: `enrich_byok_rag`, `enrich_solr` (Azure
466464
Entra ID intentionally stays separate because it's a `.env`
@@ -558,7 +556,7 @@ reference.
558556
|---|---|---|
559557
| 2026-04-23 | Initial version | Spike completion |
560558
| 2026-08-20 | Default baseline openai provider is conditional on `OPENAI_API_KEY` | LCORE-3607: `baseline: default` must load when the key is unset |
561-
| 2026-08-21 | Add `baseline: byo-llm` (default_run.yaml minus the OpenAI row); WARN on `default`/omitted | LCORE-3654: opt-in openai-free baseline |
559+
| 2026-08-21 | Add `baseline: byo-llm` (default_run.yaml minus the OpenAI row) | LCORE-3654: opt-in openai-free baseline |
562560

563561
## Appendix A — Worked example: legacy → unified migration
564562

src/llama_stack_configuration.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,19 +1252,9 @@ def synthesize_configuration( # pylint: disable=too-many-locals
12521252
ls_config: dict[str, Any] = copy.deepcopy(baseline)
12531253

12541254
# Profile and empty are unchanged. The shipped file either keeps OpenAI
1255-
# (default/omitted, with a deprecation WARN) or drops it (byo-llm).
1256-
if loaded_shipped_baseline:
1257-
if unified and unified.get("baseline") == "byo-llm":
1258-
_strip_default_openai_inference(ls_config)
1259-
else:
1260-
logger.warning(
1261-
"DEPRECATED: llama_stack.config.baseline 'default' includes a "
1262-
"built-in conditional OpenAI inference provider (%s). Set "
1263-
"baseline to 'byo-llm' to start without that provider and "
1264-
"declare LLMs under inference.providers. 'byo-llm' will "
1265-
"become the default in a future release.",
1266-
CONDITIONAL_OPENAI_PROVIDER_ID,
1267-
)
1255+
# (default/omitted) or drops it (byo-llm).
1256+
if loaded_shipped_baseline and unified and unified.get("baseline") == "byo-llm":
1257+
_strip_default_openai_inference(ls_config)
12681258

12691259
# 3. Normalize duplicated vector_io providers in the baseline.
12701260
dedupe_providers_vector_io(ls_config)

tests/unit/test_llama_stack_synthesize.py

Lines changed: 18 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
# pylint: disable=too-many-lines
1010

11-
import logging
1211
import os
1312
import stat
1413
from pathlib import Path
@@ -741,15 +740,6 @@ def test_synthesize_vllm_appends_and_keeps_conditional_openai(
741740
assert any(entry["provider_id"] == "vllm" for entry in _inference_entries(resolved))
742741

743742

744-
def _byo_llm_deprecation_warnings(caplog: pytest.LogCaptureFixture) -> list[str]:
745-
"""Return WARN records that name the byo-llm baseline replacement."""
746-
return [
747-
record.getMessage()
748-
for record in caplog.records
749-
if record.levelno == logging.WARNING and "byo-llm" in record.getMessage()
750-
]
751-
752-
753743
@pytest.mark.parametrize(
754744
"lcs",
755745
[
@@ -758,43 +748,29 @@ def _byo_llm_deprecation_warnings(caplog: pytest.LogCaptureFixture) -> list[str]
758748
{},
759749
],
760750
)
761-
def test_synthesize_default_path_warns_and_keeps_conditional_openai(
762-
caplog: pytest.LogCaptureFixture, lcs: dict[str, Any]
751+
def test_synthesize_default_path_keeps_conditional_openai(
752+
lcs: dict[str, Any],
763753
) -> None:
764-
"""default or omitted baseline keeps the OpenAI row and warns naming byo-llm."""
765-
with caplog.at_level(
766-
"WARNING", logger="lightspeed_stack.llama_stack_configuration"
767-
):
768-
result = synthesize_configuration(lcs)
754+
"""default or omitted baseline keeps the OpenAI row."""
755+
result = synthesize_configuration(lcs)
769756
openai_entries = _openai_inference_entries(result)
770757
assert len(openai_entries) == 1
771758
assert openai_entries[0]["provider_id"] == OPENAI_CONDITIONAL_PROVIDER_ID
772759
ids = [entry["provider_id"] for entry in _inference_entries(result)]
773760
assert "sentence-transformers" in ids
774-
warnings = _byo_llm_deprecation_warnings(caplog)
775-
assert len(warnings) == 1
776-
assert "byo-llm" in warnings[0]
777761

778762

779-
def test_synthesize_byo_llm_strips_openai_without_warn(
780-
caplog: pytest.LogCaptureFixture,
781-
) -> None:
782-
"""byo-llm drops the built-in OpenAI row, keeps the embedder, and does not warn."""
763+
def test_synthesize_byo_llm_strips_openai() -> None:
764+
"""byo-llm drops the built-in OpenAI row and keeps the embedder."""
783765
lcs = {"llama_stack": {"config": {"baseline": "byo-llm"}}}
784-
with caplog.at_level(
785-
"WARNING", logger="lightspeed_stack.llama_stack_configuration"
786-
):
787-
result = synthesize_configuration(lcs)
766+
result = synthesize_configuration(lcs)
788767
assert _openai_inference_entries(result) == []
789768
ids = [entry["provider_id"] for entry in _inference_entries(result)]
790769
assert ids == ["sentence-transformers"]
791770
assert "model-context-protocol" in _tool_runtime_ids(result)
792-
assert _byo_llm_deprecation_warnings(caplog) == []
793771

794772

795-
def test_synthesize_byo_llm_with_vllm_appends_without_openai(
796-
caplog: pytest.LogCaptureFixture,
797-
) -> None:
773+
def test_synthesize_byo_llm_with_vllm_appends_without_openai() -> None:
798774
"""byo-llm + high-level vLLM appends vLLM and does not restore OpenAI."""
799775
lcs = {
800776
"llama_stack": {"config": {"baseline": "byo-llm"}},
@@ -808,10 +784,7 @@ def test_synthesize_byo_llm_with_vllm_appends_without_openai(
808784
]
809785
},
810786
}
811-
with caplog.at_level(
812-
"WARNING", logger="lightspeed_stack.llama_stack_configuration"
813-
):
814-
result = synthesize_configuration(lcs)
787+
result = synthesize_configuration(lcs)
815788
assert _openai_inference_entries(result) == []
816789
vllm = next(
817790
entry for entry in _inference_entries(result) if entry["provider_id"] == "vllm"
@@ -820,34 +793,25 @@ def test_synthesize_byo_llm_with_vllm_appends_without_openai(
820793
assert "sentence-transformers" in [
821794
entry["provider_id"] for entry in _inference_entries(result)
822795
]
823-
assert _byo_llm_deprecation_warnings(caplog) == []
824796

825797

826-
def test_synthesize_byo_llm_with_openai_appends_one_row(
827-
caplog: pytest.LogCaptureFixture,
828-
) -> None:
829-
"""byo-llm + high-level openai appends a single openai row and does not warn."""
798+
def test_synthesize_byo_llm_with_openai_appends_one_row() -> None:
799+
"""byo-llm + high-level openai appends a single openai row."""
830800
lcs = {
831801
"llama_stack": {"config": {"baseline": "byo-llm"}},
832802
"inference": {
833803
"providers": [{"type": "openai", "api_key_env": "OPENAI_API_KEY"}]
834804
},
835805
}
836-
with caplog.at_level(
837-
"WARNING", logger="lightspeed_stack.llama_stack_configuration"
838-
):
839-
result = synthesize_configuration(lcs)
806+
result = synthesize_configuration(lcs)
840807
openai_entries = _openai_inference_entries(result)
841808
assert len(openai_entries) == 1
842809
assert openai_entries[0]["provider_id"] == "openai"
843810
assert openai_entries[0]["config"]["api_key"] == "${env.OPENAI_API_KEY}"
844-
assert _byo_llm_deprecation_warnings(caplog) == []
845811

846812

847-
def test_synthesize_empty_baseline_does_not_warn_byo_llm(
848-
caplog: pytest.LogCaptureFixture,
849-
) -> None:
850-
"""baseline: empty is unchanged: no strip, no byo-llm WARN."""
813+
def test_synthesize_empty_baseline_does_not_strip_openai() -> None:
814+
"""baseline: empty is unchanged: no OpenAI strip."""
851815
lcs = {
852816
"llama_stack": {
853817
"config": {
@@ -856,18 +820,12 @@ def test_synthesize_empty_baseline_does_not_warn_byo_llm(
856820
}
857821
}
858822
}
859-
with caplog.at_level(
860-
"WARNING", logger="lightspeed_stack.llama_stack_configuration"
861-
):
862-
result = synthesize_configuration(lcs)
823+
result = synthesize_configuration(lcs)
863824
assert result == {"version": 2, "apis": ["inference"]}
864-
assert _byo_llm_deprecation_warnings(caplog) == []
865825

866826

867-
def test_synthesize_profile_ignores_byo_llm_and_does_not_warn(
868-
tmp_path: Path, caplog: pytest.LogCaptureFixture
869-
) -> None:
870-
"""profile: wins over baseline: byo-llm; no strip and no deprecation WARN."""
827+
def test_synthesize_profile_ignores_byo_llm(tmp_path: Path) -> None:
828+
"""profile: wins over baseline: byo-llm; no OpenAI strip."""
871829
profile = {
872830
"version": 2,
873831
"apis": ["inference"],
@@ -891,15 +849,11 @@ def test_synthesize_profile_ignores_byo_llm_and_does_not_warn(
891849
}
892850
}
893851
}
894-
with caplog.at_level(
895-
"WARNING", logger="lightspeed_stack.llama_stack_configuration"
896-
):
897-
result = synthesize_configuration(lcs, config_file_dir=str(tmp_path))
852+
result = synthesize_configuration(lcs, config_file_dir=str(tmp_path))
898853
assert result["marker"] == "from-profile"
899854
openai_entries = _openai_inference_entries(result)
900855
assert len(openai_entries) == 1
901856
assert openai_entries[0]["provider_id"] == "openai"
902-
assert _byo_llm_deprecation_warnings(caplog) == []
903857

904858

905859
def test_synthesize_loads_profile_relative_to_config_dir(tmp_path: Path) -> None:

0 commit comments

Comments
 (0)