Tool calling
Routify supports OpenAI-style tools parameter on capable models.
Capable models
| Model | Supported | Quality |
|---|---|---|
kimi-k2.5 | ✅ | Excellent |
glm-4.6 | ✅ | Excellent (most agent-tuned in CN) |
qwen3-max | ✅ | Good |
deepseek-v3.2 | ✅ | OK (slightly flaky) |
claude-sonnet-4-6 / opus-4-7 | ✅ | Excellent |
gpt-4o | ✅ | Excellent |
o1 | ❌ | Not yet supported by OpenAI |
Example
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
},
"required": ["location"]
}
}
}]
resp = client.chat.completions.create(
model="kimi-k2.5",
messages=[{"role": "user", "content": "Weather in Shanghai?"}],
tools=tools,
)
# Check if model wants to call a tool
if resp.choices[0].finish_reason == "tool_calls":
tool_call = resp.choices[0].message.tool_calls[0]
# tool_call.function.name == "get_weather"
# tool_call.function.arguments == '{"location": "Shanghai", "unit": "celsius"}'
passForcing a specific tool
tool_choice={"type": "function", "function": {"name": "get_weather"}}Forcing JSON mode (no tools, just structured output)
response_format={"type": "json_object"}