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
7 changes: 5 additions & 2 deletions docs/user_doc/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -1192,14 +1192,17 @@ Attributes:
of the loaded lightspeed-stack.yaml.
native_override: Raw OGX schema deep-merged last (maps merge
recursively, lists and scalars replace). The escape hatch for
anything the high-level sections do not express.
anything the high-level sections do not express. Note:
`registered_resources.models` is a list, so a native_override
that sets it replaces — not merges with — any LLM models LCORE
auto-registered from `inference.providers[].allowed_models`.


| Field | Type | Description |
|-----------------|--------|-------------- |
| 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. |
| profile | string | Path to a run.yaml-shaped baseline file. Relative paths resolve against the directory of the loaded lightspeed-stack.yaml. |
| native_override | object | Raw OGX schema deep-merged last (maps merge recursively; lists and scalars replace). |
| 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. |


## UserDataCollection
Expand Down
39 changes: 37 additions & 2 deletions src/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,10 @@ class UnifiedOgxConfig(ConfigurationBase):
of the loaded lightspeed-stack.yaml.
native_override: Raw OGX schema deep-merged last (maps merge
recursively, lists and scalars replace). The escape hatch for
anything the high-level sections do not express.
anything the high-level sections do not express. Note:
`registered_resources.models` is a list, so a native_override
that sets it replaces — not merges with — any LLM models LCORE
auto-registered from `inference.providers[].allowed_models`.
"""

baseline: Literal["default", "empty", "byo-llm"] = Field(
Expand All @@ -839,7 +842,10 @@ class UnifiedOgxConfig(ConfigurationBase):
default_factory=dict,
title="Native override",
description="Raw OGX schema deep-merged last (maps "
"merge recursively; lists and scalars replace).",
"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.",
)


Expand Down Expand Up @@ -1868,6 +1874,35 @@ def check_default_model_and_provider(self) -> Self:
)
return self

@model_validator(mode="after")
def check_unique_provider_ids(self) -> Self:
"""Reject two high-level providers that resolve to the same provider_id.

The synthesizer emits each provider under its explicit ``id`` when set,
otherwise the ``type`` with underscores hyphenated. Two entries
resolving to the same emitted id would collide in the synthesized
``providers.inference`` list (the later one silently overwriting the
earlier), so reject the ambiguity here rather than resolving it as
last-wins at synthesis time.

Raises:
ValueError: If two providers resolve to the same emitted id.

Returns:
self (Self): The validated configuration instance.
"""
seen: set[str] = set()
for provider in self.providers:
emitted_id = provider.id or provider.type.replace("_", "-")
if emitted_id in seen:
raise ValueError(
f"duplicate inference provider id {emitted_id!r}: two "
"inference.providers entries resolve to the same "
"provider_id; set a distinct 'id' on one of them"
)
seen.add(emitted_id)
return self


class CompactionConfiguration(ConfigurationBase):
"""Configuration for conversation history compaction.
Expand Down
Loading
Loading