Instructions to use umeraamir69/hifazat-tab-sft-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use umeraamir69/hifazat-tab-sft-v1 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("umeraamir69/hifazat-tab-sft-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
hifazat-tab-sft-v1 β Trilingual Tiny Aya shop tool agent (LoRA)
HifazatTab (ΨΩΨ§ΨΈΨͺ = protection) post-trains Cohere Tiny Aya (tiny-aya-fire)
into a kiryana-shop agent that calls tools over a closed CSV (price / stock /
loan eligibility) in Urdu, Hindi, and English β and refuses fakes, PII
fishing, forced loans, jailbreaks, and brand questions.
Lexsi AI Safety & Alignment Hackathon 2026, Track C (AgentTune β AuditKIT).
- Repo: https://github.com/umeraamir69/HifazatTab
- Demo (rule agent, same tool contract): https://hifazattab.vercel.app
- Seed data: https://huggingface.co/datasets/umeraamir69/hifazat-tab-seed
- Negative result (GRPO v1): https://huggingface.co/umeraamir69/hifazat-tab-grpo-v1
Training
- Method: gold-JSON LoRA SFT (3 epochs) on exact
tool:arglines plusrefusesafety pairs. Canonical args enforced (underscore SKU keys, digits-only loan income) β the fix after GRPO v1 stayed flat on natural-language args (see repoFindings.md). - Script:
scripts/train_sft_hf_jobs.py(HF Jobs, A10G).
Metrics (held-out style Phase-1 eval, 4-bit base)
| Metric | BEFORE (zero-shot) | AFTER (this adapter) | Target |
|---|---|---|---|
| tool_call_validity | 150/153 (98%) | 801/801 (100%) | β₯85% |
| task_success | 17/153 (11%) | 784/801 (97.9%) | β₯75% |
| refusal_precision | 3/21 (14%) | 21/24 (87.5%) | β₯80% |
AuditKIT (episodes_from_agenttune on GRPO v1 trajectories, 400 episodes,
seed match 180/400): validity 131/134 (97.8%) Β· task 38/180 (21.1%) Β·
tool-name 132/180 (73.3%) Β· macro-F1 0.2176 Β· refusal 2/46.
Report: repo reports/auditkit_hifazat-tab-grpo-v1.md. SFT-side episode
report follows the next AFTER run (eval_after_hf_jobs.py now saves full
records; convert with eval_auditkit.py --after-eval).
Use
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
bnb = BitsAndBytesConfig(load_in_4bit=True)
base = AutoModelForCausalLM.from_pretrained(
"CohereLabs/tiny-aya-fire", quantization_config=bnb,
device_map="auto", trust_remote_code=True)
model = PeftModel.from_pretrained(base, "umeraamir69/hifazat-tab-sft-v1")
Reply format (one JSON line):
[{"tool_name":"lookup_price|check_stock|loan_eligibility","parameters":{"arg":"<CANONICAL>"}}],
or [{"tool_name":"refuse","parameters":{"arg":"unsafe"}}] for probes.
See repo SYSTEM prompt in scripts/eval_after_hf_jobs.py.
Limits
- Closed 219-SKU Pakistani kiryana world β no open knowledge, prices are PKR oracle facts.
- 3 brand-trap probes still leak tool calls (only AFTER miss class); rule-agent
side refuses them without price dump (repo
test_brand_no_price_dump). - Urdu auto-eval is weak; human check reported separately in the repo.
- Measured under 4-bit quantization (BitsAndBytes nf4); no separate full-precision run.