agentron 0.1.0

Agentron (Ag): a unit of agentic work volume — Ag = hours × Mtokens.
Documentation
  • Coverage
  • 72.73%
    8 out of 11 items documented3 out of 7 items with examples
  • Size
  • Source code size: 6.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 92.7 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • gravitymir/agentron
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • gravitymir

agentron

Agentron (Ag) — a unit of agentic work volume:

Ag = hours × Mtokens        // Mtokens = tokens / 1_000_000

It fuses the two things that actually cost during an agent run — wall-clock time and tokens — into one comparable number (think kWh, not km/h).

Install

[dependencies]

agentron = "0.1"

Use

use agentron::{agentron, agentron_total, compute_agentron, format_ag, Time};

agentron(1_500_000.0, Time::Hours(2.0));        // 3.0  — a 2 h run over 1.5M tokens
agentron(316_887.0, Time::Seconds(960.0));      // 0.0845
compute_agentron(3_600_000.0, 1_000_000.0);     // 1.0  (durationMs, tokens)

format_ag(0.0845);                              // "0.08 Ag"

// several agents at once: sum the inputs, THEN multiply
agentron_total(&[(1_000_000.0, 1.0), (1_000_000.0, 1.0)]); // 4.0, not 2.0

compute_agentron(duration_ms, tokens) mirrors the reference JS implementation in gravitymir/agent_web.

Why multiply for multi-agent?

Parallel agents share the same real-time window, so their combined volume multiplies rather than adds: two agents, each 1 h over 1M tokens, give (1+1) × (1+1) = 4 Ag, not 2 Ag.

License

MIT. Part of https://github.com/gravitymir/agentron.