Metadata-Version: 2.4
Name: agentrons
Version: 0.1.0
Summary: Agentron (Ag): a unit of agentic work volume — Ag = hours × Mtokens.
Project-URL: Homepage, https://github.com/gravitymir/agentron
Project-URL: Repository, https://github.com/gravitymir/agentron
Author: gravitymir
License: MIT
Keywords: agent,agentron,llm,metric,tokens,unit,usage
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# agentrons

**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).

> PyPI name is `agentrons` (the bare `agentron` is taken by an unrelated
> project). Import name is `agentrons`.

## Install

```bash
pip install agentrons
```

## Use

```python
from agentrons import agentron, agentron_total, format_ag

agentron(1_500_000, hours=2)      # 3.0   — a 2 h run over 1.5M tokens
agentron(316_887, seconds=960)    # 0.0845
agentron(1_000_000, ms=3_600_000) # 1.0

format_ag(0.0845)                 # "0.08 Ag"

# several agents at once: sum the inputs, THEN multiply
agentron_total([(1_000_000, 1), (1_000_000, 1)])   # 4.0, not 2.0
```

`compute_agentron(duration_ms, tokens)` mirrors the reference JS
`computeAgentron` in [`gravitymir/agent_web`](https://github.com/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>.
