Instructions to use frankzhu94/ledgercall-tiny-aya-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use frankzhu94/ledgercall-tiny-aya-sft with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("CohereLabs/tiny-aya-global") model = PeftModel.from_pretrained(base_model, "frankzhu94/ledgercall-tiny-aya-sft") - Notebooks
- Google Colab
- Kaggle
LedgerCall: Tiny Aya Global LoRA for reliable finance tool calling
Rank-16 LoRA on CohereLabs/tiny-aya-global (3.35B, dense, open weights) that teaches the model to call four deterministic finance tools (convert_currency, compound_interest, percent_change, loan_payment) instead of guessing numbers. Lexsi AI Safety & Alignment Hackathon, Track 3 (Reliable tool calling, Efficient trajectories).
Method: trajectory SFT. Gold tool trajectories are replayed through AgentTune's own create_rollout_fn, so training prompts match evaluation prompts byte for byte; loss on assistant turns only. 960 tasks (600 base + 360 targeted augmentation) → 2,487 turn examples, 100 steps, 74 min on one Kaggle T4.
Results (greedy decoding, T4)
| Eval set | Base | LedgerCall |
|---|---|---|
| In-distribution held-out, 100 tasks: task success | 0% | 100% |
| In-distribution: malformed call rate | 71% | 0% |
| In-distribution: avg completion tokens | 308 | 99 |
| Blind OOD, 72 tasks (fr/de/ja/zh/es/en, symbols, new chains): task success | 0% | 84.7% |
| Blind OOD: malformed call rate | 58.3% | 0% |
| OOD #1, 84 tasks (guided the augmentation, not blind): task success | 1.2% | 89.3% |
Known limitations: number words ("four-year") and unseen chain shapes still fail; throughput drops with the unmerged LoRA (merge for deployment).
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("CohereLabs/tiny-aya-global", torch_dtype="auto", device_map="auto")
model = PeftModel.from_pretrained(base, "frankzhu94/ledgercall-tiny-aya-sft")
tok = AutoTokenizer.from_pretrained("frankzhu94/ledgercall-tiny-aya-sft")
Code, eval harness and write-up: https://github.com/Xuefeng-Zhu/Ledgercall · Data and trajectories: https://huggingface.co/datasets/frankzhu94/ledgercall-finance-toolbench · Demo: https://huggingface.co/spaces/frankzhu94/ledgercall-demo
License: CC BY-NC 4.0, inherited from the base model.
- Downloads last month
- 23