Instructions to use Alogotron/a0-toolcall-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Alogotron/a0-toolcall-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "Alogotron/a0-toolcall-lora") - Notebooks
- Google Colab
- Kaggle
docs: model card with measured base-vs-tuned numbers
Browse files
README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Qwen/Qwen2.5-7B-Instruct
|
| 4 |
+
tags:
|
| 5 |
+
- agent-zero
|
| 6 |
+
- tool-calling
|
| 7 |
+
- qlora
|
| 8 |
+
- lora
|
| 9 |
+
- function-calling
|
| 10 |
+
- sft
|
| 11 |
+
library_name: peft
|
| 12 |
+
datasets:
|
| 13 |
+
- Alogotron/a0-toolcall-sft
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
pretty_name: A0 Tool-Call Adapter (Qwen2.5-7B)
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# a0-toolcall-lora (Qwen2.5-7B-Instruct)
|
| 20 |
+
|
| 21 |
+
QLoRA adapter teaching a 7B open model to reliably emit **Agent Zero tool-call JSON** — one object with `thoughts`, `headline`, `tool_name`, `tool_args` — instead of stalling in plain text. Motivated by two real stall incidents (2026-10-02/03) of a local 27B agent model.
|
| 22 |
+
|
| 23 |
+
Trained on [Alogotron/a0-toolcall-sft](https://huggingface.co/datasets/Alogotron/a0-toolcall-sft) (v2): 887 SFT records of real agent conversations (brain + arm instances), chat-level split so the 59 eval records come from 4 fully held-out chats.
|
| 24 |
+
|
| 25 |
+
## Training
|
| 26 |
+
|
| 27 |
+
- QLoRA NF4 4-bit base + bf16 LoRA (r=16, alpha=32, dropout 0.05; all attention+MLP projections)
|
| 28 |
+
- 3 epochs, effective batch 8 (1×8 accum), lr 1e-4 cosine, warmup 5%, seq 1536, seed 42
|
| 29 |
+
- Prompt-masked loss (labels −100 on system+user context; loss only on target JSON)
|
| 30 |
+
- Single RTX 3090 24GB slot; runs alongside resident Ollama (no eviction; ~12GB/GPU free)
|
| 31 |
+
|
| 32 |
+
## Eval: tool-call validity & stall rate (held-out chats)
|
| 33 |
+
|
| 34 |
+
Deterministic (greedy) generation, 512 new tokens, judged: `valid` = parses as JSON dict with all four keys, known tool name, dict tool_args; `invalid` = parses but violates shape; `stall` = no parseable JSON object.
|
| 35 |
+
|
| 36 |
+
| model | validity | invalid | stall | n |
|
| 37 |
+
|---|---|---|---|---|
|
| 38 |
+
| Qwen2.5-7B-Instruct base | 1.7% (1) | 98.3% (58) | 0% (0) | 59 |
|
| 39 |
+
| + this adapter | **84.7% (50)** | 0% (0) | 15.3% (9)* | 59 |
|
| 40 |
+
|
| 41 |
+
*All 9 tuned stalls are 512-token-cap truncations in a single held-out chat with unusually long tool_args (valid JSON starts, cut mid-object) - harness cap, not model failure. Base emitted 58 near-miss JSONs (invalid) and only 1 fully valid call. Full protocol + per-record details in eval report / eval-*.json.
|
| 42 |
+
|
| 43 |
+
## Usage
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
from peft import PeftModel
|
| 47 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 48 |
+
base = AutoModelForCausalLM.from_pretrained('Qwen/Qwen2.5-7B-Instruct', device_map='auto')
|
| 49 |
+
model = PeftModel.from_pretrained(base, 'Alogotron/a0-toolcall-lora')
|
| 50 |
+
# system prompt: instruct EXACTLY ONE JSON object with thoughts/headline/tool_name/tool_args
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## Intended use & limits
|
| 54 |
+
|
| 55 |
+
Use to harden small agent models against tool-call format stalls in Agent Zero-style loops. Trained on one agent household's conversations — tool distribution skews to code_execution (66%); JSON arguments generalize but niche tool semantics may not. Not a general-instruct tune.
|