LedgerTune: A Double-Entry Ledger Workflow Agent, Trained with AgentTune and Audited with AuditKIT

Lexsi AI Safety & Alignment Hackathon β€” Track 3: Agentic Fine-Tuning

Problem statement: Business workflow and decision agents β€” automate a multi-step process with rules and approvals (claims handling, KYC checks, compliance review) with a full audit trail.


1. Summary

LLM agents in financial workflows fail in characteristic ways: multi-leg entries that don't balance, compliance checks that get skipped, transactions forced through after a rejection, and retry loops. This project builds a deterministic testbed that makes each of these failures detectable, then uses it to post-train and evaluate a small open model.

What the repository contains:

  1. A rule-enforcing ledger environment (ledger_env.py) with 5 strict JSON-schema tools, double-entry invariants and an explicit transaction statechart.
  2. 150 environment-verified teacher trajectories across 5 workflow types, 40% of them rejection/rollback cases (generate_trajectories.py).
  3. A deterministic reward function R(Ο„) ∈ [βˆ’0.5, 1.0] for ledger balance, statechart legality, schema validity and efficiency, with a hard penalty for committing after a rejection (reward_functions.py).
  4. Two real GPU training & evaluation iterations on Google Colab (LL-2.ipynb):
    • Iteration 1 (Diagnostic Baseline β€” Qwen/Qwen2.5-1.5B-Instruct on Colab GPU): Stage-1 SFT with AgentTune create_distill_trainer and an initial Stage-2 GRPO attempt (checkpoints/sft_ledger/, checkpoints/grpo_ledger/), which exposed two critical agentic post-training failure modes: prompt-template divergence (tools= system injection vs. <tool_call> blocks) and GRPO zero-loss initialization when reward signatures receive flattened completions.
    • Iteration 2 (Rule 3 Cohere Labs Model β€” CohereLabs/tiny-aya-global, 3.35B on Colab T4 GPU): Full two-stage post-training (checkpoints/sft_tiny_aya/, checkpoints/grpo_tiny_aya/) after fixing EventKind.OBSERVATION chat-template rendering, merging the Stage-1 SFT adapter before Stage-2 GRPO, and supporting all three AgentTune reward call signatures.
  5. A live evaluation harness (auditkit_harness.py, live_rollout.py) that rolls out real checkpoints against the environment and scores them with AuditKIT AgentEvalRunner plus ledger-specific metrics.

Headline Result A β€” Iteration 2: CohereLabs/tiny-aya-global (3.35B, Rule 3 Model, 25 held-out episodes)

Source: data/auditkit_live_tiny_aya_report.json and data/auditkit_live_tiny_aya_summary.md (AuditKIT 1.1.11, evaluation_mode: live_model_rollout, episodes_from_agenttune bridge verified = True).

Metric Zero-Shot tiny-aya-global + AgentTune Stage-1 SFT + AgentTune Stage-2 (SFT + GRPO)
Tool-call syntax accuracy 56.97% 94.00% (+37.03%) 97.00% (+40.03%)
AuditKIT tool-call F1 10.98% 24.99% (+14.01%) 26.22% (+15.24% / 2.39x)
Mean deterministic reward $R(\tau)$ +0.1008 +0.2480 (+0.1472) +0.2605 (+0.1597 / 2.58x)
Trajectory efficiency 84.13% 100.00% 100.00%
Avg steps (optimal = 6.60) 5.88 1.20 1.16
Avg redundant steps 1.80 0.00 0.00
Double-entry invariant rate 36.00% 4.00% 4.00%
Verified outcome / terminal audit seal 8.00% (2 / 25) 0.00% 0.00%
Statechart transition accuracy 0.00% 0.00% 0.00%
Unsafe commit violation rate 0.00% 0.00% 0.00%

How to read Iteration 2 (CohereLabs/tiny-aya-global):

  • Monotonic improvement across both training stages (Zero-Shot -> SFT -> SFT + GRPO): Zero-shot tiny-aya-global struggles with the strict JSON tool schema (56.97% syntax accuracy, 10.98% tool-call F1, +0.1008 mean reward, failing completely with 0.00% syntax on failed_kyc_rollback). Stage-1 SFT lifts tool-call syntax accuracy to 94.00%, more than doubles AuditKIT tool-call F1 to 24.99%, and raises mean deterministic reward to +0.2480. Stage-2 GRPOβ€”initialized from the merged SFT adapterβ€”further improves every primary metric to 97.00% syntax accuracy, 26.22% tool-call F1, and +0.2605 mean reward (100.0% syntax on failed_kyc_rollback, overdraft_halt, and standard_transfer).
  • Trade-off between per-call precision and multi-turn persistence: While SFT and GRPO eliminated redundant calls (1.80 -> 0.00) and raised per-call precision from 56.97% to 97.00%, the tuned tiny-aya-global policies halt conservatively after 1.16–1.20 steps (4.00% double-entry rate, 0.00% terminal seal rate), whereas Zero-Shot generated more multi-turn attempts (5.88 avg steps, reaching 36.00% balanced staging and 8.00% terminal audit seal despite 43.03% malformed tool calls).

Iteration 2 Stage-1 SFT training curve (CohereLabs/tiny-aya-global, from trainer_state.json)

LoRA r=16, Ξ±=32, 3 epochs = 51 steps, 397,312 tokens, 354.8 s on a Google Colab T4 GPU (agenttune 1.1.5).

Step Epoch Training loss Mean token accuracy Entropy
5 0.31 2.4444 57.01% 1.759
15 0.92 1.6394 68.42% 1.833
25 1.49 1.1289 76.52% 1.454
35 2.06 0.6488 86.54% 0.905
50 2.98 0.3365 94.03% 0.537

Iteration 2 Stage-2 GRPO training progression (CohereLabs/tiny-aya-global, from trainer_state.json)

Initialized from merged Stage-1 SFT (checkpoints/sft_tiny_aya_merged), 30 steps, 4 generations/prompt, 313,201 input tokens, 4,374.5 s on a Google Colab T4 GPU.

Step Epoch Mean rollout reward R(Ο„) Reward std Policy loss Grad norm Mean completion length
10 0.15 +0.1127 0.2471 +0.0259 0.2177 353.2 tokens
20 0.31 +0.1313 0.1558 βˆ’0.0421 0.0067 287.0 tokens
30 0.46 +0.1648 0.1769 βˆ’0.1275 0.0096 268.0 tokens

Headline Result B β€” Iteration 1: Qwen/Qwen2.5-1.5B-Instruct (1.5B Diagnostic Baseline, 25 held-out episodes)

Source: data/auditkit_live_gpu_rollout_report.json (AuditKIT 1.1.7, evaluation_mode: live_model_rollout). In LL-2.ipynb this file appears under its original name, data/auditkit_evaluation_report.json; it was renamed afterwards so it can't be confused with the offline sanity check.

Metric Zero-shot Qwen2.5-1.5B + AgentTune SFT + GRPO (see note)
AuditKIT tool-call F1 5.71% 13.51% 5.71%
Verified outcome (correct final state) 0.00% 4.00% (1 / 25) 0.00%
Tool-call syntax accuracy 100.00% 63.88% 100.00%
Avg steps (optimal = 6.60) 1.36 14.08 1.36
Avg redundant steps 0.00 9.92 0.00
Double-entry invariant rate 40.00% 24.00% 40.00%
Statechart transition accuracy 0.00% 0.00% 0.00%
Unsafe commit violation rate 0.00% 0.00% 0.00%
Terminal audit seal rate 0.00% 0.00% 0.00%
Mean deterministic reward +0.4900 +0.1897 +0.4900

How to read Iteration 1 (Qwen/Qwen2.5-1.5B-Instruct) and how it informed Iteration 2:

  • Zero-shot makes one or two well-formed calls and then stops (1.36 steps on average), so it never completes a workflow. Its 100% syntax score covers only those few calls.
  • SFT learned to keep working through the multi-step workflow. Tool-call F1 more than doubled (5.71% -> 13.51%) and one episode reached the correct final state (4.00%). But it ran too long (14.08 steps, 9.92 of them redundant), and a third of its calls were malformed (63.88% syntax accuracy) due to a prompt-format mismatch between SFT training and tools= inferenceβ€”which I fixed in Iteration 2 (live_rollout.py), where syntax accuracy rose from 56.97% -> 94.00% -> 97.00%.
  • GRPO in Iteration 1 gave results identical to zero-shot on every metric because it logged train_loss: 0.0 and started from the base model instead of the merged SFT adapter. Fixing both root causes in reward_functions.py and train_real_agenttune.py enabled the live Stage-2 GRPO gains in Iteration 2 (+0.1127 -> +0.1648 training reward, 24.99% -> 26.22% held-out F1).

Iteration 1 Stage-1 SFT training curve (Qwen/Qwen2.5-1.5B-Instruct, from trainer_state.json)

LoRA r=16, Ξ±=32, 3 epochs = 51 steps, batch size 2, lr 2e-4, 397,312 tokens, 119 s on Google Colab GPU.

Step Epoch Training loss Mean token accuracy Entropy
5 0.31 1.8025 67.97% 1.239
15 0.92 1.3655 72.96% 1.481
25 1.49 0.9697 79.56% 1.060
35 2.06 0.6797 84.58% 0.798
50 2.98 0.4374 89.92% 0.550

2. Environment design: double-entry accounting and statecharts

2.1 Invariants enforced by the environment

ledger_env.py treats the ledger as a closed conservation system:

  1. Balanced entries: every journal entry has N β‰₯ 2 lines and $$\sum_{i \in \text{Debits}} \text{amount}i = \sum{j \in \text{Credits}} \text{amount}_j > 0$$
  2. The fundamental accounting equation holds after every committed transition: $$\text{Total Assets} = \text{Total Liabilities} + \text{Equity} + (\text{Revenue} - \text{Expense})$$
  3. Normal Balance Polarity Matrix. Customer wallets are platform liabilities, backed by an omnibus custodial asset vault:
Account class Normal side Increased by Decreased by Example
ASSET DEBIT DEBIT CREDIT ACC_ASSET_VAULT
EXPENSE DEBIT DEBIT CREDIT ACC_EXP_PROCESSING
LIABILITY CREDIT CREDIT DEBIT ACC_WALLET_ALICE, ACC_WALLET_BOB
EQUITY CREDIT CREDIT DEBIT ACC_EQUITY_RESERVE
REVENUE CREDIT CREDIT DEBIT ACC_REV_FEES

Example: to send $850.00 from Alice to Bob with an $8.50 fee, the agent must DEBIT ACC_WALLET_ALICE $858.50, CREDIT ACC_WALLET_BOB $850.00 and CREDIT ACC_REV_FEES $8.50. Liabilities fall by $8.50 and revenue rises by $8.50, so the equation still balances to the cent.

2.2 Transaction statechart

Skipping a state (e.g. PENDING -> COMMITTED) or validating a transaction that failed compliance is rejected by a guard.

stateDiagram-v2
    [*] --> PENDING : post_journal_entry(PENDING)\n[len(entries) >= 2 and sum(D) == sum(C)]

    PENDING --> VALIDATED : post_journal_entry(VALIDATED)\n[compliance APPROVED and no overdraft]
    PENDING --> FAILED : post_journal_entry(FAILED)\n[compliance REJECTED or overdraft]

    VALIDATED --> COMMITTED : post_journal_entry(COMMITTED)\n[atomic balance update + equation check]
    VALIDATED --> FAILED : post-validation constraint failure

    FAILED --> ROLLED_BACK : post_journal_entry(ROLLED_BACK)\n[void staged lines, no balance change]

    COMMITTED --> [*] : audit_transaction(COMMITTED)
    ROLLED_BACK --> [*] : audit_transaction(ROLLED_BACK)

2.3 Pipeline

flowchart LR
    subgraph P1["Phase 1: Environment"]
        S["5 JSON tool schemas"]
        E["DoubleEntryLedgerEnv"]
    end
    subgraph P2["Phase 2: Teacher data"]
        C["5 canonical workflows"]
        P["150 verified trajectories"]
    end
    subgraph P3["Phase 3: AgentTune"]
        SFT["Stage 1: SFT\n(create_distill_trainer)"]
        GRPO["Stage 2: GRPO\n(create_agentic_trainer)"]
    end
    subgraph P4["Phase 4: Evaluation"]
        AK["Live rollouts scored by\nAuditKIT + ledger metrics"]
    end
    S --> E --> C --> P --> SFT --> GRPO --> AK

3. Architectural Trade-Offs

Decision Chosen approach Alternative Why
State transition API One state-gated post_journal_entry(target_state=...) plus pre-flight get_account_balance / check_compliance Loosely coupled endpoints with no state history The agent must name the target state at every hop, so illegal shortcuts are directly observable and penalisable.
Reward Deterministic, rule-based reward computed from the environment Learned neural reward model Every reward term is checkable arithmetic or a state check. There's no reward model for the policy to exploit, and the reward is unit-tested (Phase 3 gate).
Failure handling Explicit PENDING -> FAILED -> ROLLED_BACK -> audit_transaction Raise an exception or let the agent retry In regulated workflows a rejected transaction should leave an auditable record, not vanish or loop. 40% of training data covers this path.
SFT data format AgentTune EventLog.as_dataset_rows("sft"), which carries per-segment weights (reasoning, tool call, observation) Plain chat transcripts Lets the trainer down-weight environment observations. I did not independently verify how create_distill_trainer applies the weights.

4. Harness sanity check (scripted policies, no LLM)

Before trusting the metrics on real models, I checked that each one actually catches the failure it targets. validate_phase4.py runs three hand-written policies (no language model is loaded) over the 25 held-out episodes:

  • Teacher-Oracle-Replay: the unmodified teacher trajectory.
  • Scripted-RedundantStep-Policy: the teacher trajectory plus one redundant or retried call in a few episodes.
  • Scripted-FaultInjected-Policy: the teacher trajectory with injected faults: PENDING -> COMMITTED shortcuts, commit with force_override after a compliance rejection, a debit cut by 15% so entries don't balance, and overdraft retry loops.

Output: data/auditkit_harness_sanity_check_summary.md.

Metric Fault-injected Redundant-step Oracle replay
Avg steps (optimal = 6.60) 7.80 6.76 6.60
Double-entry invariant rate 80.00% 100.00% 100.00%
Statechart transition accuracy 46.67% 100.00% 100.00%
Unsafe commit violation rate 20.00% 0.00% 0.00%
Terminal audit seal rate 20.00% 100.00% 100.00%
Mean deterministic reward +0.4244 +0.9952 +1.0000

The oracle scores perfectly (no false positives), redundancy is penalised only on efficiency, and every injected fault type is caught. These numbers describe the metrics, not any trained model.


5. GRPO run artifacts across both iterations

5.1 Iteration 2 (CohereLabs/tiny-aya-global β€” checkpoints/grpo_tiny_aya/)

  • training_stats.json & checkpoint-30/trainer_state.json: 30 steps, 4,374.5 s on a Colab T4 GPU, initialized from merged Stage-1 SFT (checkpoints/sft_tiny_aya_merged). Mean GRPO rollout reward rose monotonically across training (+0.1127 at step 10 $\to$ +0.1313 at step 20 $\to$ +0.1648 at step 30) with non-zero reward standard deviation (0.1558–0.2471) and non-zero gradient norms.
  • trajectories.jsonl: 120 multi-turn rollouts against the callable ledger tools with live reward scoring.
  • lexsi_provenance.json: AgentTune's provenance record (agenttune 1.1.5, agentic.grpo, base_model: checkpoints/sft_tiny_aya_merged).

5.2 Iteration 1 (Qwen/Qwen2.5-1.5B-Instruct β€” checkpoints/grpo_ledger/)

  • training_stats.json: 40 steps, 2,742 s, train_loss: 0.0 (diagnostic baseline before the reward-signature and SFT-merge fixes).
  • trajectories.jsonl: 160 multi-turn rollouts against the callable ledger tools. AgentTune logged reward: null for each. Re-scoring them offline with my reward function gives mean +0.353 (range 0.15–0.40), with 2.0 tool steps on average.
  • lexsi_provenance.json: AgentTune's provenance record (agenttune 1.1.4, agentic.grpo).

6. Limitations and known issues

  1. Iteration 1 GRPO did not train (train_loss: 0.0), fixed in Iteration 2 (CohereLabs/tiny-aya-global). In Iteration 1 (Qwen2.5-1.5B), GRPO logged zero loss because (a) the reward function received completions as flattened strings rather than message lists, and (b) GRPO was initialized from the base model instead of the merged SFT adapter. Both were fixed in reward_functions.py and train_real_agenttune.py and verified on a Colab T4 GPU in Iteration 2 (CohereLabs/tiny-aya-global), where GRPO reward rose from +0.1127 -> +0.1648 and held-out F1 improved from 24.99% -> 26.22%.
  2. Multi-turn horizon vs. per-call precision trade-off. In Iteration 2 (CohereLabs/tiny-aya-global), aligning the chat template (EventKind.OBSERVATION and strict user/assistant alternation in live_rollout.py) lifted tool-call syntax accuracy from 56.97% -> 94.00% (SFT) -> 97.00% (GRPO) and F1 from 10.98% -> 24.99% -> 26.22%, but caused the tuned policy to emit an early stop summary after 1.16–1.20 steps (0.00% terminal audit seal rate vs. Zero-Shot's 8.00% over 5.88 steps). Longer multi-turn RL rollouts (max_turns >= 10 during GRPO with step-progress shaping) are needed to combine tiny-aya-global's 97% tool syntax precision with Qwen2.5-1.5B SFT's multi-turn persistence.
  3. Small, in-distribution evaluation. 25 held-out episodes, one seed, no confidence intervals. Validation episodes come from the same generator templates as training, so this measures in-distribution generalisation only.
  4. Full LoRA .safetensors weights are hosted on Hugging Face Hub. To keep the GitHub repository lightweight, .safetensors weights and tokenizer.json files are excluded via .gitignore and hosted in my public Hugging Face Model & Dataset Collections via upload_to_hf.py, while all configs, trainer_state.json logs, GRPO trajectories.jsonl, and AuditKIT evaluation reports are committed directly in Git.
  5. Offline AuditKIT fallback. If auditkit isn't installed locally, the harness falls back to built-in metrics, and its "tool-call F1" equals syntax validity. Both live GPU reports used real AuditKIT (1.1.7 for Iteration 1 and 1.1.11 for Iteration 2).
  6. Config fingerprints in the reports are SHA-256 hashes of the evaluation configuration. They identify a run setup; they don't certify results.

7. ROI & Deployment Economics: Self-Hosted Compact Agent vs. Closed-Source Frontier API

In regulated financial ledger processing, every workflow episode requires an average of 6.60 multi-hop tool turns (~3,200 cumulative input tokens of growing conversation context + tool schemas and ~650 output tokens of thoughts, <tool_call> JSON payloads, and final audit summaries per transaction).

Workload & Throughput Assumptions

  • Realistic Sample Volume: 100,000 multi-hop ledger workflow transactions per month (~3,333 workflows/day), representing a mid-sized digital wallet or payment settlement desk:
    • Monthly Input Volume: $100,000 \times 3,200 = 320.0\text{M input tokens/month}$
    • Monthly Output Volume: $100,000 \times 650 = 65.0\text{M output tokens/month}$
  • Self-Hosted Hardware (1x NVIDIA L4 24GB GPU):
    • On-Demand Cloud GPU Pricing: \$0.80 / hour (standard AWS g6.xlarge / GCP g2-standard-4 L4 rate).
    • Measured Training Cost (One-Time): Stage-1 SFT (119s) + Stage-2 GRPO (2,742s) = 0.80 GPU hours (\$0.64 total one-time training compute).
    • Serving Throughput (CohereLabs/tiny-aya-global 3.35B / Qwen2.5-1.5B via batched vLLM on L4): Conservatively ~1,200 output tokens/sec (with prefix caching on the shared system prompt + tool schemas).
    • Active GPU Runtime Hours Required for 100k Workflows: $$\frac{65,000,000\text{ output tokens}}{1,200\text{ tokens/sec} \times 3,600\text{ sec/hr}} \approx 15.05\text{ GPU hours/month}$$
Cost & Operational Dimension Closed-Source Frontier API (e.g. GPT-4o / Claude 3.5 Sonnet @ $2.50–$3.00 / 1M in, $10.00–$15.00 / 1M out) Self-Hosted Tiny Aya Global (3.35B) / Qwen2.5 (1.5B) on On-Demand L4 GPU (Batched Job / Serverless Auto-Scale) Dedicated 24/7 Self-Hosted L4 Instance (720 hrs/month @ $0.80/hr)
Input Token Billing (320M tokens) \$800.00 – \$960.00 \$0.00 (included in GPU time) \$0.00 (included in GPU time)
Output Token Billing (65M tokens) \$650.00 – \$975.00 \$0.00 (included in GPU time) \$0.00 (included in GPU time)
Compute / GPU Runtime Hours Managed API 15.1 hrs/month @ \$0.80/hr 720 hrs/month @ \$0.80/hr
One-Time Post-Training Cost (AgentTune) N/A \$0.64 (0.80 L4 GPU hours) \$0.64 (0.80 L4 GPU hours)
Total Monthly Inference Cost (100k tx) \$1,450.00 – \$1,935.00 / mo \$12.04 / mo (99.2% lower) \$576.00 / mo (60.3% lower)
Cost per 1,000 Audited Workflows \$14.50 – \$19.35 \$0.12 \$5.76 (with >95% spare capacity)
Data Residency & PII/KYC Privacy External 3rd-party API egress 100% On-VPC / Air-Gapped 100% On-VPC / Air-Gapped

Engineering Takeaway: Even before reaching 100% autonomous completion on every workflow, routing deterministic ledger staging through a self-hosted 1.5B–3.35B model inside DoubleEntryLedgerEnv (where the environment's statechart guards deterministically block any invalid transition and only escalate unresolvable edge cases) cuts token expenditure by 60% to 99% while keeping sensitive KYC/AML customer records strictly inside the custodian's VPC.


8. Repository structure

Lexsi/
β”œβ”€β”€ README.md
β”œβ”€β”€ LL-2.ipynb                                  # Executed Colab (L4) training + live evaluation notebook
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ run_all_validations.py                      # Runs the 5 phase gates (offline, < 5 s)
β”œβ”€β”€ checkpoints/
β”‚   β”œβ”€β”€ sft_ledger/                             # Iteration 1 (Qwen2.5-1.5B) Stage-1 SFT config + trainer_state.json
β”‚   β”œβ”€β”€ grpo_ledger/                            # Iteration 1 (Qwen2.5-1.5B) Stage-2 GRPO stats, provenance & 160 rollouts
β”‚   β”œβ”€β”€ sft_tiny_aya/                           # Iteration 2 (CohereLabs/tiny-aya-global) Stage-1 SFT checkpoint
β”‚   └── grpo_tiny_aya/                          # Iteration 2 (CohereLabs/tiny-aya-global) Stage-2 GRPO checkpoint
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ phase2_canonical_5_trajectories.json    # 5 canonical teacher trajectories
β”‚   β”œβ”€β”€ phase2_canonical_5_readable.md          # Human-readable traces
β”‚   β”œβ”€β”€ phase2_synthetic_dataset_150.jsonl      # 150 verified trajectories (4 currencies, 5 workflows)
β”‚   β”œβ”€β”€ agenttune_canonical_5.jsonl
β”‚   β”œβ”€β”€ agenttune_sft_train.jsonl               # 130 training episodes
β”‚   β”œβ”€β”€ agenttune_sft_val.jsonl                 # 25 held-out episodes
β”‚   β”œβ”€β”€ agenttune_native_val_trajectories.jsonl # AgentTune Trajectory.to_dict() format
β”‚   β”œβ”€β”€ agenttune_eventlog_sft_train.jsonl      # EventLog.as_dataset_rows("sft") format (used for SFT)
β”‚   β”œβ”€β”€ auditkit_live_gpu_rollout_report.json   # REAL: live rollouts of Qwen2.5-1.5B (Colab GPU)
β”‚   β”œβ”€β”€ auditkit_live_gpu_rollout_summary.md
β”‚   β”œβ”€β”€ auditkit_live_tiny_aya_report.json      # REAL: live rollouts of CohereLabs/tiny-aya-global (Colab T4)
β”‚   β”œβ”€β”€ auditkit_live_tiny_aya_summary.md
β”‚   β”œβ”€β”€ auditkit_harness_sanity_check_report.json  # Scripted policies, no LLM (metric validation)
β”‚   └── auditkit_harness_sanity_check_summary.md
└── src/
    β”œβ”€β”€ phase1_architecture/   tool_schemas.json, ledger_env.py, validate_phase1.py
    β”œβ”€β”€ phase2_trajectories/   generate_trajectories.py, validate_phase2.py
    β”œβ”€β”€ phase3_agenttune/      prepare_agenttune_sft.py, reward_functions.py, train_real_agenttune.py,
    β”‚                          agenttune_config.yaml, validate_phase3.py
    β”œβ”€β”€ phase4_auditkit/       live_rollout.py, auditkit_harness.py, validate_phase4.py
    └── phase5_submission/     validate_phase5.py, upload_to_hf.py

Quickstart A: offline validation gates

python3 run_all_validations.py

Checks tool schemas, statechart guards, ledger balance across all 150 trajectories, reward discrimination, the harness sanity check, and README/report consistency. Install AuditKIT first (pip install "git+https://github.com/Lexsi-Labs/AuditKIT.git") to use its native scorers instead of the fallback.

Quickstart B: train CohereLabs/tiny-aya-global (Rule 3) and evaluate on a GPU

pip install "git+https://github.com/Lexsi-Labs/AgentTune.git" "git+https://github.com/Lexsi-Labs/AuditKIT.git"
pip install torch transformers datasets trl peft accelerate huggingface_hub

# 1. Train CohereLabs/tiny-aya-global (saves to ./checkpoints/sft_tiny_aya and ./checkpoints/grpo_tiny_aya
#    and writes live AuditKIT report to data/auditkit_live_tiny_aya_report.json without overwriting Qwen results)
python3 src/phase3_agenttune/train_real_agenttune.py \
    --base-model CohereLabs/tiny-aya-global --sft-epochs 3 --grpo-steps 30

# 2. Upload all Models, Adapters, Logs, Datasets, and Reports to Hugging Face Hub & create Collections
python3 src/phase5_submission/upload_to_hf.py
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for YK49/ledgertune-tiny-aya-global-agent

Adapter
(391)
this model

Collection including YK49/ledgertune-tiny-aya-global-agent