File size: 18,894 Bytes
3352b18 12a753e 3352b18 fbccbfc 12a753e 712b7f6 12a753e 712b7f6 12a753e 32a8720 12a753e b4bb154 8fc0d8b b4bb154 8fc0d8b ed67f17 b4bb154 befccd3 12a753e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 |
---
library_name: transformers
license: mit
task_categories:
- text-generation
language:
- en
tags:
- agent
- Agentic Learning
- tool use
- BFCL
---
[](https://huggingface.co/collections/prem-research/funcdex) [](https://huggingface.co/datasets/prem-research/Funcdex-MT-Function-Calling) [](https://github.com/prem-research/Funcdex-Synthesizer) [](https://www.premai.io/)
# Funcdex-1.7B
<div align="center">
<img src="assets/funcdex_hero.png" alt="Funcdex Hero" width="70%">
</div>
Funcdex-1.7B is a research preview model by Prem Labs. It has been trained on a mix of [Funcdex-MT-Function-Calling](https://huggingface.co/datasets/prem-research/Funcdex-MT-Function-Calling), Instruct-Following, Single-turn function datasets. It is a LoRA finetune of Qwen3-1.7B (with thinking disabled).
This model excels at Multi-turn Function Calling with tools from `gmail`, `jira`, `calendar`, `docs`, etc.
The code used to generate the dataset can be found [here](https://github.com/prem-research/Funcdex-Synthesizer).
# Evaluation
<div align="center">
<img src="assets/line_plot.png" alt="Line Plot" width="80%">
</div>
Notes:
- *Funcdex-0.6B is the average of performances of individual Funcdex-0.6B models.*
- For cost, we track the number of prompt/completion tokens for evaluating 300 conversations.
- e.g. If token cost is input=$1 and output=$10 per million tokens, and evaluation needed `0.5M` and `0.1M` input/output tokens, then cost is `1 * 0.5 + 0.1 * 10 = $1.5`.
- *Qwen3-0.6B and Qwen3-1.7B evaluation costs are estimated by extrapolating from Llama3.2-3B serverless costs. Other model's costs are sourced from Openrouter.*
## Results
### BFCL v3
- We filtered BFCLv3 examples relevant to the toolkits/bundles and report performance:
- The filtered set is only 83 examples. Further emphasizing the need for workflow/toolkit-specialized workflows.
<table border="1" class="dataframe">
<thead>
<tr style="text-align: center;">
<th>LLM</th>
<th>Acc %</th>
</tr>
</thead>
<tbody>
<tr style="text-align: center;">
<td>GPT-5 Mini<br>(medium)</td>
<td>0.71</td>
</tr>
<tr style="text-align: center;">
<td>Qwen3-1.7B</td>
<td>0.82</td>
</tr>
<tr style="text-align: center;">
<td><strong><a href="https://huggingface.co/prem-research/Funcdex-1.7B">Funcdex-1.7B</a><strong></td>
<td><strong>0.86</strong></td>
</tr>
</tbody>
</table>
### Funcdex-MT: Overall Performance
<table border="1" class="dataframe">
<thead>
<tr style="text-align: center;">
<th>LLM</th>
<th>Exact Match</th>
<th>String Ratio</th>
<th>Total Cost ($)</th>
</tr>
</thead>
<tbody>
<tr style="text-align: center;">
<td>GPT-OSS-120B<br>(medium)</td>
<td>0.35</td>
<td>0.51</td>
<td>9.32</td>
</tr>
<tr style="text-align: center;">
<td>GPT-5 Mini<br>(medium)</td>
<td>0.35</td>
<td>0.58</td>
<td>99.71</td>
</tr>
<tr style="text-align: center;">
<td>GPT-5<br>(minimal)</td>
<td>0.18</td>
<td>0.59</td>
<td>205.45</td>
</tr>
<tr style="text-align: center;">
<td>Qwen3-0.6B</td>
<td>0.27</td>
<td>0.59</td>
<td>2.83</td>
</tr>
<tr style="text-align: center;">
<td>Qwen3-1.7B</td>
<td>0.27</td>
<td>0.69</td>
<td>5.73</td>
</tr>
<tr style="text-align: center;">
<td><strong><a href="https://huggingface.co/collections/prem-research/funcdex">Funcdex-0.6B</a></strong></td>
<td><strong>0.39</strong></td>
<td><strong>0.70</strong></td>
<td><strong>0.19</strong></td>
</tr>
<tr style="text-align: center;">
<td><strong><a href="https://huggingface.co/prem-research/Funcdex-1.7B">Funcdex-1.7B</a></strong></td>
<td><strong>0.43</strong></td>
<td><strong>0.81</strong></td>
<td>5.64</td>
</tr>
</tbody>
</table>
### Funcdex-MT: Toolkit-Level Performance
<table border="1" class="dataframe">
<thead>
<tr style="text-align: center;">
<th rowspan="2">Toolkit</th>
<th colspan="2">GPT-OSS-120B<br>(medium)</th>
<th colspan="2">GPT-5<br>(minimal)</th>
<th colspan="2">GPT-5 Mini<br>(medium)</th>
<th colspan="2">Qwen3-0.6B</th>
<th colspan="3">Funcdex-0.6B</th>
<th colspan="2">Qwen3-1.7B</th>
<th colspan="3">Funcdex-1.7B</th>
</tr>
<tr style="text-align: center;">
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>LoRA Checkpoint</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>LoRA Checkpoint</th>
</tr>
</thead>
<tbody>
<tr style="text-align: center;">
<td><img src="assets/icons/asana.png" width="20" height="20" style="vertical-align: middle;"/> Asana</td>
<td>0.38</td>
<td>0.47</td>
<td>0.12</td>
<td>0.68</td>
<td>0.49</td>
<td>0.71</td>
<td>0.33</td>
<td>0.63</td>
<td>0.46</td>
<td>0.69</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-asana">π€</a></td>
<td>0.30</td>
<td>0.79</td>
<td>0.52</td>
<td>0.82</td>
<td rowspan="10"><a href="https://huggingface.co/prem-research/Funcdex-1.7B">π€</a></td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/calendly.png" width="20" height="20" style="vertical-align: middle;"/> Calendly</td>
<td>0.47</td>
<td>0.56</td>
<td>0.41</td>
<td>0.63</td>
<td>0.41</td>
<td>0.56</td>
<td>0.44</td>
<td>0.66</td>
<td>0.54</td>
<td>0.78</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-calendly">π€</a></td>
<td>0.47</td>
<td>0.74</td>
<td>0.54</td>
<td>0.86</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/gmail.png" width="20" height="20" style="vertical-align: middle;"/> Gmail</td>
<td>0.48</td>
<td>0.70</td>
<td>0.24</td>
<td>0.69</td>
<td>0.50</td>
<td>0.73</td>
<td>0.27</td>
<td>0.61</td>
<td>0.47</td>
<td>0.72</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-gmail">π€</a></td>
<td>0.31</td>
<td>0.73</td>
<td>0.53</td>
<td>0.83</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/google-calendar.png" width="20" height="20" style="vertical-align: middle;"/> Calendar</td>
<td>0.27</td>
<td>0.52</td>
<td>0.20</td>
<td>0.50</td>
<td>0.21</td>
<td>0.51</td>
<td>0.21</td>
<td>0.53</td>
<td>0.39</td>
<td>0.74</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-googlecalendar">π€</a></td>
<td>0.23</td>
<td>0.64</td>
<td>0.47</td>
<td>0.83</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/docs.png" width="20" height="20" style="vertical-align: middle;"/> Docs</td>
<td>0.19</td>
<td>0.38</td>
<td>0.07</td>
<td>0.49</td>
<td>0.18</td>
<td>0.46</td>
<td>0.07</td>
<td>0.58</td>
<td>0.13</td>
<td>0.64</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-googledocs">π€</a></td>
<td>0.11</td>
<td>0.62</td>
<td>0.18</td>
<td>0.79</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/google-drive.png" width="20" height="20" style="vertical-align: middle;"/> Drive</td>
<td>0.34</td>
<td>0.52</td>
<td>0.19</td>
<td>0.61</td>
<td>0.38</td>
<td>0.58</td>
<td>0.26</td>
<td>0.65</td>
<td>0.40</td>
<td>0.75</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-googledrive">π€</a></td>
<td>0.26</td>
<td>0.73</td>
<td>0.48</td>
<td>0.82</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/jira.png" width="20" height="20" style="vertical-align: middle;"/> Jira</td>
<td>0.47</td>
<td>0.53</td>
<td>0.17</td>
<td>0.65</td>
<td>0.47</td>
<td>0.66</td>
<td>0.51</td>
<td>0.69</td>
<td>0.58</td>
<td>0.76</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-jira">π€</a></td>
<td>0.47</td>
<td>0.76</td>
<td>0.59</td>
<td>0.83</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/stripe.png" width="20" height="20" style="vertical-align: middle;"/> Stripe</td>
<td>0.15</td>
<td>0.37</td>
<td>0.10</td>
<td>0.46</td>
<td>0.12</td>
<td>0.39</td>
<td>0.08</td>
<td>0.50</td>
<td>0.17</td>
<td>0.71</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-stripe">π€</a></td>
<td>0.09</td>
<td>0.56</td>
<td>0.16</td>
<td>0.80</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/to-do-list.png" width="20" height="20" style="vertical-align: middle;"/> Todoist</td>
<td>0.65</td>
<td>0.74</td>
<td>0.19</td>
<td>0.72</td>
<td>0.64</td>
<td>0.79</td>
<td>0.57</td>
<td>0.87</td>
<td>0.65</td>
<td>0.88</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-todoist">π€</a></td>
<td>0.55</td>
<td>0.91</td>
<td>0.72</td>
<td>0.94</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/whatsapp.png" width="20" height="20" style="vertical-align: middle;"/> Whatsapp</td>
<td>0.23</td>
<td>0.39</td>
<td>0.13</td>
<td>0.47</td>
<td>0.24</td>
<td>0.43</td>
<td>0.20</td>
<td>0.43</td>
<td>0.28</td>
<td>0.64</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-whatsapp">π€</a></td>
<td>0.26</td>
<td>0.55</td>
<td>0.31</td>
<td>0.71</td>
</tr>
</tbody>
</table>
- Funcdex-0.6B are specialized models. Reported number is the average performance of each specific model in their respective subset.
### Funcdex-MT: Bundle/Multi-toolkit Performance:
<table border="1" class="dataframe">
<thead>
<tr style="text-align: center;">
<th rowspan="2">Bundle</th>
<th colspan="2">GPT-OSS-120B<br>(medium)</th>
<th colspan="2">GPT-5<br>(minimal)</th>
<th colspan="2">GPT-5 Mini<br>(medium)</th>
<th colspan="2">Qwen3-0.6B</th>
<th colspan="3">Funcdex-0.6B</th>
<th colspan="2">Qwen3-1.7B</th>
<th colspan="3">Funcdex-1.7B</th>
</tr>
<tr style="text-align: center;">
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>LoRA Checkpoint</th>
<th>EM</th>
<th>SR</th>
<th>EM</th>
<th>SR</th>
<th>LoRA Checkpoint</th>
</tr>
</thead>
<tbody>
<tr style="text-align: center;">
<td><img src="assets/icons/gmail.png" width="20" height="20" style="vertical-align: middle;"/>Gmail<img src="assets/icons/google-calendar.png" width="20" height="20" style="vertical-align: middle;"/>Calendar</td>
<td>0.28</td>
<td>0.53</td>
<td>0.15</td>
<td>0.54</td>
<td>0.22</td>
<td>0.56</td>
<td>0.19</td>
<td>0.51</td>
<td>0.26</td>
<td>0.54</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-gmail_googlecalendar">π€</a></td>
<td>0.17</td>
<td>0.61</td>
<td>0.32</td>
<td>0.71</td>
<td rowspan="5"><a href="https://huggingface.co/prem-research/Funcdex-1.7B">π€</a></td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/google-drive.png" width="20" height="20" style="vertical-align: middle;"/>Drive <img src="assets/icons/calendly.png" width="20" height="20" style="vertical-align: middle;"/> Calendly <img src="assets/icons/google-calendar.png" width="20" height="20" style="vertical-align: middle;"/> Calendar</td>
<td>0.32</td>
<td>0.45</td>
<td>0.17</td>
<td>0.52</td>
<td>0.35</td>
<td>0.47</td>
<td>0.19</td>
<td>0.49</td>
<td>0.35</td>
<td>0.60</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-googledrive_calendly_googlecalendar">π€</a></td>
<td>0.15</td>
<td>0.66</td>
<td>0.40</td>
<td>0.78</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/google-drive.png" width="20" height="20" style="vertical-align: middle;"/>Drive <img src="assets/icons/docs.png" width="20" height="20" style="vertical-align: middle;"/> Docs</td>
<td>0.28</td>
<td>0.37</td>
<td>0.12</td>
<td>0.50</td>
<td>0.33</td>
<td>0.47</td>
<td>0.18</td>
<td>0.54</td>
<td>0.34</td>
<td>0.70</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-googledrive_googledocs">π€</a></td>
<td>0.19</td>
<td>0.68</td>
<td>0.43</td>
<td>0.76</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/jira.png" width="20" height="20" style="vertical-align: middle;"/>Jira <img src="assets/icons/gmail.png" width="20" height="20" style="vertical-align: middle;"/> Gmail</td>
<td>0.42</td>
<td>0.60</td>
<td>0.18</td>
<td>0.66</td>
<td>0.36</td>
<td>0.66</td>
<td>0.29</td>
<td>0.61</td>
<td>0.39</td>
<td>0.71</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-jira_gmail">π€</a></td>
<td>0.28</td>
<td>0.72</td>
<td>0.44</td>
<td>0.82</td>
</tr>
<tr style="text-align: center;">
<td><img src="assets/icons/whatsapp.png" width="20" height="20" style="vertical-align: middle;"/>Whatsapp <img src="assets/icons/to-do-list.png" width="20" height="20" style="vertical-align: middle;"/> Todoist</td>
<td>0.32</td>
<td>0.58</td>
<td>0.19</td>
<td>0.66</td>
<td>0.35</td>
<td>0.69</td>
<td>0.26</td>
<td>0.50</td>
<td>0.41</td>
<td>0.70</td>
<td><a href="https://huggingface.co/prem-research/Funcdex-0.6B-whatsapp_todoist">π€</a></td>
<td>0.27</td>
<td>0.68</td>
<td>0.39</td>
<td>0.77</td>
</tr>
</tbody>
</table>
## Inference
- Given a conversation, we extract all tuples `(context_messages, function_calls)` and use it to generate predictions. We ignore the `content` field and only evaluate `function_calls` generated by an LLM.
- We use vLLM deployment with `tool_choice="auto"`.
## Metrics
Given a list of predicted and reference function calls, we report two metrics:
- **Function Call String Match (SR)**: We perform greedy match and report best-matched string ratio using `difflib.SequenceMatcher.ratio`. The number reported is average string ratio.
- **Exact Match (EM)**: Same as above, but we perform exact string match instead. The number reported is EM F1 Score.
EM is a strict metric, and penalizes string arguments in function calls that may be "okay", e.g. `"email_content": "This is an example."` v/s `"email_content": "This is an Example."`, both only differ by one letter.
## Deployment with vLLM
`vllm serve ojus1/Qwen3-1.7B-Instruct --enable-lora --lora-modules prem-research/Funcdex-1.7B=prem-research/Funcdex-1.7B --enable-auto-tool-choice --tool-call-parser hermes`
# Quickstart
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import json
# Load model and tokenizer
base_model_name = "ojus1/Qwen3-1.7B-Instruct"
model_name = "prem-research/Funcdex-1.7B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype="auto",
device_map="auto"
)
model = PeftModel.from_pretrained(
base_model,
model_name,
torch_dtype="auto",
device_map="auto"
)
# Define tools (supports all toolkits)
tools = [
{
"type": "function",
"function": {
"name": "CREATE_SHARED_DRIVE",
"description": "Create a new shared drive in Google Drive",
"parameters": {
"type": "object",
"properties": {
"name": {"type": "string", "description": "Name of the shared drive"},
"requestId": {"type": "string", "description": "Unique request ID"}
},
"required": ["name", "requestId"]
}
}
},
{
"type": "function",
"function": {
"name": "CREATE_A_FOLDER",
"description": "Create a folder in Google Drive",
"parameters": {
"type": "object",
"properties": {
"folder_name": {"type": "string", "description": "Name of the folder"},
"parent_id": {"type": "string", "description": "Parent drive or folder ID"}
},
"required": ["folder_name", "parent_id"]
}
}
}
]
# Define conversation
messages = [
{"role": "system", "content": "You are a helpful assistant that can help with tasks by using tools."},
{"role": "user", "content": "Create a shared drive named 'Partner-Alpha-Integration' with request ID 'req-12345'."}
]
# Apply chat template with tools
formatted_input = tokenizer.apply_chat_template(
messages,
tools=tools,
tokenize=False,
add_generation_prompt=True
)
# Tokenize and generate
input_tokens = tokenizer(formatted_input, return_tensors="pt").to(model.device)
output = model.generate(**input_tokens, max_new_tokens=256, do_sample=False)
response = tokenizer.decode(output[0][input_tokens['input_ids'].shape[1]:], skip_special_tokens=True)
print("Response:", response)
# Expected output includes: <tool_call>{"name": "CREATE_SHARED_DRIVE", "arguments": {"name": "Partner-Alpha-Integration", "requestId": "req-12345"}}</tool_call>
```
For best results, provide detailed system-prompt to steer the tool-use behaviour.
# License
The models, code and the dataset are licensed under MIT License. |