Fork for thermals request add-json-schema-dpeq
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #127 from osaurus-ai/fix/zaya-tool-template-arch-fallback

Activate ZAYA tool-aware template from source_model.architecture

+16 -5
+16 -5
Libraries/MLXLMCommon/JangLoader.swift
··· 1167 1167 } 1168 1168 1169 1169 let family = config.capabilities?.family?.lowercased() ?? "" 1170 + // Fall back to `source_model.architecture` when `capabilities.family` is 1171 + // absent. Some ZAYA bundles (e.g. ZAYA1-VL JANGTQ) stamp only 1172 + // `source_model.architecture = zaya1_vl` and omit `capabilities.family`; 1173 + // without this fallback the tool-aware template never materializes, the 1174 + // bare role-only template is used, and the model leaks raw `<tool_call>` 1175 + // XML as visible text. The contract stays data-driven (parser + 1176 + // think_in_template + supports_tools), just not family-name-only. 1177 + let arch = config.sourceModel.architecture.lowercased() 1170 1178 let parser = config.capabilities?.toolParser?.lowercased() ?? "" 1171 1179 let supportsTools = config.capabilities?.supportsTools 1172 - let isZayaText = family == "zaya" 1173 - || family == "zaya1" 1174 - || family.hasPrefix("zaya1_") 1175 - || family.hasPrefix("zaya1-") 1180 + func isZayaIdent(_ s: String) -> Bool { 1181 + s == "zaya" || s == "zaya1" || s.hasPrefix("zaya1_") || s.hasPrefix("zaya1-") 1182 + } 1183 + let isZayaText = isZayaIdent(family) || isZayaIdent(arch) 1176 1184 return isZayaText 1177 1185 && ["zaya", "zaya_xml", "zyphra", "zyphra_xml"].contains(parser) 1178 1186 && config.capabilities?.thinkInTemplate == false ··· 1185 1193 } 1186 1194 1187 1195 let family = config.capabilities?.family?.lowercased() ?? "" 1196 + // Same architecture fallback as the text gate: ZAYA1-VL JANGTQ bundles 1197 + // stamp `source_model.architecture = zaya1_vl` without a `capabilities.family`. 1198 + let arch = config.sourceModel.architecture.lowercased() 1188 1199 let parser = config.capabilities?.toolParser?.lowercased() ?? "" 1189 1200 let supportsTools = config.capabilities?.supportsTools 1190 - return family.contains("zaya1_vl") 1201 + return (family.contains("zaya1_vl") || arch.contains("zaya1_vl")) 1191 1202 && ["zaya", "zaya_xml", "zyphra", "zyphra_xml"].contains(parser) 1192 1203 && config.capabilities?.thinkInTemplate == false 1193 1204 && supportsTools != false