Environment
- FLM version: latest (tested via Jan 0.7.9 as OpenAI-compatible client)
- OS: Windows 11
- Hardware: ASUS ProArt PX13, AMD Ryzen AI 9 HX 370 (XDNA2 NPU)
- Model: Qwen3.5 (2B / 9B)
Describe the bug
When FLM generates a tool call response, integer-typed parameters declared in the JSON schema are serialized as strings in the resulting JSON.
Example — tool schema declares start_order and end_order as integer, but FLM outputs:
{"end_order": "5", "file_id": "13c3b21d-...", "start_order": "0"}
Same issue with top_k / limit parameters:
This causes downstream consumers that enforce strict JSON types to fail:
invalid type: string "0", expected i64
invalid type: string "6", expected usize
Expected behavior
Tool call arguments should respect the JSON schema types declared by the tool definition:
{"end_order": 5, "file_id": "13c3b21d-...", "start_order": 0}
{"limit": 6}
Impact
Any application that uses FLM with tools expecting integer parameters will silently fail if the receiving end enforces strict types (Rust, typed APIs, etc.). Makes FLM incompatible with Jan's built-in RAG engine and likely other tools.
Steps to reproduce
- Configure a tool with integer-typed parameters in the JSON schema
- Send a prompt that triggers a tool call via FLM serve (port 52625)
- Inspect the raw tool call arguments in the response
- Observe that integer values are wrapped in quotes
Note
I've reported the same issue to Jan (janhq/jan) as it affects their RAG integration, but the root cause is in FLM's serialization of tool call arguments.
Environment
Describe the bug
When FLM generates a tool call response, integer-typed parameters declared in the JSON schema are serialized as strings in the resulting JSON.
Example — tool schema declares
start_orderandend_orderasinteger, but FLM outputs:{"end_order": "5", "file_id": "13c3b21d-...", "start_order": "0"}Same issue with
top_k/limitparameters:{"limit": "6"}This causes downstream consumers that enforce strict JSON types to fail:
Expected behavior
Tool call arguments should respect the JSON schema types declared by the tool definition:
{"end_order": 5, "file_id": "13c3b21d-...", "start_order": 0} {"limit": 6}Impact
Any application that uses FLM with tools expecting integer parameters will silently fail if the receiving end enforces strict types (Rust, typed APIs, etc.). Makes FLM incompatible with Jan's built-in RAG engine and likely other tools.
Steps to reproduce
Note
I've reported the same issue to Jan (janhq/jan) as it affects their RAG integration, but the root cause is in FLM's serialization of tool call arguments.