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
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
# limit; it outranks the legacy DYN_ENGINE_REQUEST_LIMIT alias.
_ENGINE_REQUEST_LIMIT_ENV = "DYN_BACKEND_ADMISSION_ENGINE_REQUEST_LIMIT"
_FPM_TRACE_VALUES = {"1", "0", "true", "false", "on", "off", "yes", "no"}

# Parser selectors that still work but are scheduled for removal, mapped to the
# name to configure instead. `muse` predates Muse Spark Open and selects only
# Muse Glimmer; the frontend emits the matching warning at model registration.
_DEPRECATED_PARSER_ALIASES: dict[str, str] = {"muse": "muse_glimmer"}
_fpm_trace_invalid_warning_emitted = False


Expand Down Expand Up @@ -115,6 +120,21 @@ class DynamoRuntimeConfig(ConfigBase):
def validate(self) -> None:
self.namespace = get_worker_namespace(self.namespace)
self.structural_tag = resolve_structural_tag_config(self)
for flag, value in (
("--dyn-tool-call-parser", self.dyn_tool_call_parser),
("--dyn-reasoning-parser", self.dyn_reasoning_parser),
):
replacement = _DEPRECATED_PARSER_ALIASES.get(value or "")
if replacement is not None:
logger.warning(
"%s=%s is a deprecated alias of %s and will be removed in a "
"future release; configure %s instead. Muse Spark Open is a "
"different parser: muse_spark_open.",
flag,
value,
replacement,
replacement,
)

# The Rust FPM sink reads this setting from the process environment.
# Canonicalize the resolved CLI/env value before the runtime or backend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,35 @@ def test_invalid_allow_remote_urls_fails_at_startup(monkeypatch):

with pytest.raises(ValueError, match="DYN_MM_ALLOW_REMOTE_URLS"):
_parse_runtime_args([])


def test_muse_parser_alias_warns_per_flag(monkeypatch, caplog):
_clear_structural_tag_env(monkeypatch)
# validate() exports DYN_RESPONSE_PLANE; track it so monkeypatch restores it.
monkeypatch.delenv("DYN_RESPONSE_PLANE", raising=False)
with caplog.at_level(logging.WARNING, logger=runtime_args.__name__):
config, _ = _parse_runtime_args(
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
["--dyn-tool-call-parser", "muse", "--dyn-reasoning-parser", "muse"]
)
# The alias keeps working until the removal release.
assert config.dyn_tool_call_parser == "muse"
assert config.dyn_reasoning_parser == "muse"
assert caplog.text.count("deprecated alias of muse_glimmer") == 2
assert "--dyn-tool-call-parser=muse" in caplog.text
assert "--dyn-reasoning-parser=muse" in caplog.text
assert "muse_spark_open" in caplog.text


def test_canonical_muse_parsers_do_not_warn(monkeypatch, caplog):
_clear_structural_tag_env(monkeypatch)
monkeypatch.delenv("DYN_RESPONSE_PLANE", raising=False)
with caplog.at_level(logging.WARNING, logger=runtime_args.__name__):
_parse_runtime_args(
[
"--dyn-tool-call-parser",
"muse_glimmer",
"--dyn-reasoning-parser",
"muse_spark_open",
]
)
assert "deprecated alias" not in caplog.text
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ Parsers marked **Force-reasoning: Yes** start reasoning without an opening tag.
</Accordion>

<Accordion title="Muse Glimmer">
**Parser:** `muse_glimmer` (Dynamo alias `muse`)
**Parser:** `muse_glimmer`. `muse` is a deprecated alias of `muse_glimmer` and will be removed in a future release.

**Notes:** Unified recipient-routed channels; `to=self` carries reasoning. No V1 reasoning parser exists.
</Accordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ The **Upstream name** field shows where the vLLM or SGLang parser name differs f
<Accordion title="Muse">
<AccordionGroup>
<Accordion title="Muse Glimmer">
**Parser:** `muse_glimmer` (Dynamo alias `muse`)
**Parser:** `muse_glimmer`. `muse` is a deprecated alias of `muse_glimmer` and will be removed in a future release.

**Upstream name:** Check your engine version's `--help`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ V2 uses one family grammar for reasoning, text, and tools. Either selector can u
| Kimi K3 | `kimi_k3`, `kimi-k3` |
| MiniMax M3 | `minimax_m3`, `minimax-m3` |
| Qwen3 Coder | `qwen3`, `qwen3_coder` |
| Muse Glimmer | `muse_glimmer`, `muse` |
| Muse Glimmer | `muse_glimmer`; `muse` is a deprecated alias of `muse_glimmer` |
| Muse Spark | `muse_spark`, `muse_spark_open` |
| Nemotron V3 | `nemotron_v3`, `nemotron3` |
| Beam | `beam` |
Expand Down
13 changes: 13 additions & 0 deletions lib/llm/src/preprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2967,6 +2967,19 @@ impl OpenAIPreprocessor {
reasoning_parser = ?mdc.runtime_config.reasoning_parser,
"Selected model parser route"
);
for (slot, parser) in [
("tool_call_parser", tool_call_parser.as_deref()),
(
"reasoning_parser",
mdc.runtime_config.reasoning_parser.as_deref(),
),
] {
if let Some(warning) = parser.and_then(
crate::protocols::openai::chat_completions::unified_parser::deprecated_alias_warning,
) {
tracing::warn!(model = %mdc.display_name, slot, "{warning}");
}
}
}
let parser_requires_special_tokens = mdc.model_type.supports_chat()
&& Self::parser_requires_special_tokens(
Expand Down
40 changes: 40 additions & 0 deletions lib/llm/src/protocols/openai/chat_completions/unified_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,28 @@ pub(crate) fn canonical_family(parser: &str) -> Option<&'static str> {
dynamo_parsers_v2::canonical_unified_family(parser)
}

/// Aliases that still route but are scheduled for removal, paired with the family
/// to configure instead. `muse` predates Muse Spark Open and now reads as "any Muse
/// model" while it selects only Muse Glimmer; a Spark deployment configured with it
/// starts without complaint and runs the wrong parser.
/// TODO(next minor): remove these from `DYNAMO_FAMILY_ALIASES` and `FAMILY_NAMES` so
/// the alias becomes a startup error.
pub(crate) const DEPRECATED_FAMILY_ALIASES: &[(&str, &str)] = &[("muse", MUSE_UNIFIED_FAMILY)];

/// The startup warning for a deprecated alias, or `None` for any other selector.
pub(crate) fn deprecated_alias_warning(parser: &str) -> Option<String> {
DEPRECATED_FAMILY_ALIASES
.iter()
.find(|(alias, _)| *alias == parser)
.map(|(alias, family)| {
format!(
"parser `{alias}` is a deprecated alias of `{family}` and will be removed in a \
future release; configure `{family}` instead. Muse Spark Open is a different \
parser: `muse_spark_open`"
)
})
}

pub(crate) static FAMILY_NAMES: LazyLock<Vec<&'static str>> = LazyLock::new(|| {
let mut names = dynamo_parsers_v2::REGISTERED_UNIFIED_FAMILIES.to_vec();
names.extend(DYNAMO_FAMILY_ALIASES.iter().map(|(alias, _)| *alias));
Expand Down Expand Up @@ -12245,6 +12267,24 @@ pub(crate) mod tests {
}]
}

#[test]
fn muse_alias_is_deprecated_but_still_routes() {
let warning = deprecated_alias_warning("muse").expect("muse is a deprecated alias");
assert!(warning.contains("`muse_glimmer`"), "{warning}");
assert!(warning.contains("`muse_spark_open`"), "{warning}");
for parser in [
"muse_glimmer",
"muse_spark",
"muse_spark_open",
"qwen3_coder",
"gemma-4",
] {
assert_eq!(deprecated_alias_warning(parser), None, "{parser}");
}
assert_eq!(canonical_family("muse"), Some(MUSE_UNIFIED_FAMILY));
assert!(FAMILY_NAMES.contains(&"muse"));
}

#[test]
fn eight_family_routing_all_modes() {
for (tool, reason, family) in [
Expand Down
Loading