https://www.boundaryml.com logo
Kimi-K2.5 Structured Output Issues with BAML
# help
v
When using Kimi-K2.5 model via OpenAI-compatible API with BAML (Boundary ML) for structured output, the model fails to follow the specified JSON schema and instead outputs its internal tool-calling formats. Environment - Model: Kimi-K2.5 - API Endpoint: https://www.sophnet.com/api/open-apis/v1 - Provider: openai-generic
Issue 1: XML-style Tool Call Output Expected: JSON output following BAML schema (e.g., ToolCall[] with specific fields) Actual Output: <tool_call id="call_4" description="Recreating the daily 17:40 scheduled task..." invoke='{"tool_id": "platform:create_scheduled_job", "tool_params": {"instruction": "Summarize today's test conversations with the user and send an email to Manager Jia", "hour": 17, "minute": 40, "frequency": "daily", "title": "Daily Test Summary - Send to Manager Jia", "job_type": "custom"}}'> The model outputs XML-style tags instead of the requested JSON structure.
I have tested multiple rounds in the agent scenario, and the recurrence frequency is quite high
{{ ctx.output_format }} {# ========== Message History ========== #} {%- for msg in messages %} {%- if msg.role == "user" %} {{ _.role("user") }} {%- if msg.metadata %} [{{ msg.metadata.sender_name }}] {%- endif %} {{ msg.content }} {%- elif msg.role == "assistant" %} {%- if msg.tool_calls %} {{ _.role("assistant") }} {%- for tc in msg.tool_calls %} {{ tc.fn_info.arguments }} {%- for result_msg in messages %} {%- if result_msg.role == "tool" and result_msg.tool_call_id == tc.id %} {{ result_msg.content }} {%- endif %} {%- endfor %} {%- endfor %} {%- else %} {{ _.role("assistant") }} {{ msg.content }} {%- endif %} {%- elif msg.role == "tool" %} {%- endif %} {%- endfor %} "#
If I add more JSON call examples in the prompt, it can reduce non-compliance, but it always feels off because selecting appropriate examples is too difficult
g
Ahh, thanks for the report! We have native tool calling API on our roadmap, and hopefully that fixes this.
3 Views