Skip to content

Commit d2aa236

Browse files
authored
Merge pull request #2401 from omkarjoshi0304/fix/synthesis-gaps
LCORE-3520 Close two synthesis-mode gaps: LLM model registration and CLI access
2 parents 87cdf9e + b33a3e6 commit d2aa236

4 files changed

Lines changed: 592 additions & 68 deletions

File tree

‎docs/user_doc/config.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,14 +1192,17 @@ Attributes:
11921192
of the loaded lightspeed-stack.yaml.
11931193
native_override: Raw OGX schema deep-merged last (maps merge
11941194
recursively, lists and scalars replace). The escape hatch for
1195-
anything the high-level sections do not express.
1195+
anything the high-level sections do not express. Note:
1196+
`registered_resources.models` is a list, so a native_override
1197+
that sets it replaces — not merges with — any LLM models LCORE
1198+
auto-registered from `inference.providers[].allowed_models`.
11961199

11971200

11981201
| Field | Type | Description |
11991202
|-----------------|--------|-------------- |
12001203
| baseline | string | Synthesis starting point: 'default' uses LCORE's built-in baseline including the conditional OpenAI provider, 'byo-llm' uses the same baseline without that OpenAI row, 'empty' starts from {}. Ignored when 'profile' is set. |
12011204
| profile | string | Path to a run.yaml-shaped baseline file. Relative paths resolve against the directory of the loaded lightspeed-stack.yaml. |
1202-
| native_override | object | Raw OGX schema deep-merged last (maps merge recursively; lists and scalars replace). |
1205+
| native_override | object | Raw OGX schema deep-merged last (maps merge recursively; lists and scalars replace). Note: setting registered_resources.models here replaces, not merges with, any LLM models LCORE auto-registered from inference.providers[].allowed_models. |
12031206

12041207

12051208
## UserDataCollection

‎src/models/config.py‎

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,10 @@ class UnifiedOgxConfig(ConfigurationBase):
816816
of the loaded lightspeed-stack.yaml.
817817
native_override: Raw OGX schema deep-merged last (maps merge
818818
recursively, lists and scalars replace). The escape hatch for
819-
anything the high-level sections do not express.
819+
anything the high-level sections do not express. Note:
820+
`registered_resources.models` is a list, so a native_override
821+
that sets it replaces — not merges with — any LLM models LCORE
822+
auto-registered from `inference.providers[].allowed_models`.
820823
"""
821824

822825
baseline: Literal["default", "empty", "byo-llm"] = Field(
@@ -839,7 +842,10 @@ class UnifiedOgxConfig(ConfigurationBase):
839842
default_factory=dict,
840843
title="Native override",
841844
description="Raw OGX schema deep-merged last (maps "
842-
"merge recursively; lists and scalars replace).",
845+
"merge recursively; lists and scalars replace). Note: setting "
846+
"registered_resources.models here replaces, not merges with, any "
847+
"LLM models LCORE auto-registered from "
848+
"inference.providers[].allowed_models.",
843849
)
844850

845851

@@ -1868,6 +1874,35 @@ def check_default_model_and_provider(self) -> Self:
18681874
)
18691875
return self
18701876

1877+
@model_validator(mode="after")
1878+
def check_unique_provider_ids(self) -> Self:
1879+
"""Reject two high-level providers that resolve to the same provider_id.
1880+
1881+
The synthesizer emits each provider under its explicit ``id`` when set,
1882+
otherwise the ``type`` with underscores hyphenated. Two entries
1883+
resolving to the same emitted id would collide in the synthesized
1884+
``providers.inference`` list (the later one silently overwriting the
1885+
earlier), so reject the ambiguity here rather than resolving it as
1886+
last-wins at synthesis time.
1887+
1888+
Raises:
1889+
ValueError: If two providers resolve to the same emitted id.
1890+
1891+
Returns:
1892+
self (Self): The validated configuration instance.
1893+
"""
1894+
seen: set[str] = set()
1895+
for provider in self.providers:
1896+
emitted_id = provider.id or provider.type.replace("_", "-")
1897+
if emitted_id in seen:
1898+
raise ValueError(
1899+
f"duplicate inference provider id {emitted_id!r}: two "
1900+
"inference.providers entries resolve to the same "
1901+
"provider_id; set a distinct 'id' on one of them"
1902+
)
1903+
seen.add(emitted_id)
1904+
return self
1905+
18711906

18721907
class CompactionConfiguration(ConfigurationBase):
18731908
"""Configuration for conversation history compaction.

0 commit comments

Comments
 (0)