Skip to content

Trellis v0.2.0

Latest

Choose a tag to compare

@xtong629 xtong629 released this 19 Nov 19:21
9978862

What it is

Trellis is a small Python agent framework built around measurement: versioned, content-hashed task sets, rule and LLM-judge scorers, a regression gate, and cost accounting with hard budgets. It is a research prototype, not a production library. Everything runs offline with mock models; the experiments ran on one real model (glm-5.3-flash, reasoning_effort=low) with fictional data.

What's new in 0.2.0

  • Reflection (trellis_agent.reflect): ReflectingAgent wraps an Agent. After a final answer, a checker reviews it against the task and the tool results. If the checker rejects it, the agent retries once with the reason. Every check and retry is counted in usage, cost and trace. It is opt-in; the default Agent is unchanged. See examples/06_reflection.py.
  • Judge calibration statistics (trellis_agent.eval.calibrate): 2x2 counts, agreement rate, Cohen's kappa and a seeded bootstrap interval.
  • Three pre-registered experiments (C1, C2, C4). For each, the hypothesis and decision rule were merged before any real model call. Each runs on a new frozen task set or answer set, and the trial reports are kept. The v0.1.0 task sets and results are unchanged.
  • A recorded terminal demo (docs/demo/), made with mock models.

Results at a glance

Full method, tables and limits: docs/EXPERIMENTS_V02.md. Costs are CNY list-price reference values, not actual spend.

  • C1, reflection: not run as designed.
    • The baseline hit the ceiling: 1.000±0.000 on benefit tasks. As pre-registered, the hypothesis was not decided.
    • The reflection arm scored 0.978±0.030, at a cost of 0.3133 vs 0.2538 CNY (about 1.23x). The checker made 2 fixes and 2 harms.
    • Both harms trace to an ambiguous wording in the frozen tasks. The ambiguity is disclosed, and the tasks were not changed.
  • C2, planner under simulated tool latency: supported, only at 10 s.
    • At 10 s the planner's median was 34.50 vs 48.87 s per task (ratio 0.71). It was not faster at 1 s (1.47) or 4 s (0.95).
    • There were 3 repeats per cell, and the planner cost 2.2-3.1x as much.
    • With 30% transient tool failures, neither system was clearly better.
  • C4, LLM judge vs rule scorers: supported, within narrow bounds.
    • The judge and the rules agreed on 839 of 840 answers (kappa 0.992, CI 0.974-1.000).
    • There are no human labels, and the judge is the same model as the one under test.
    • The answers come from simple tasks that rules can decide.

Known limitations

  • One model, one reasoning level, fictional tasks and small samples; no significance tests.
  • Reflection's benefit was not shown. The checker can reject right answers, and a PlannedAgent cannot be wrapped.
  • C2's latency is a simulated asyncio.sleep, not real tools. Latencies between 4 and 10 s were not tested.
  • Not implemented: hooks, guardrails, agent handoff, token streaming, persistent sessions, MCP, a real embedding client, and calls to forgetting from the agent loop. See docs/ARCHITECTURE.md and the CHANGELOG.