# `GEPA.LLM.Tracking`
[🔗](https://github.com/nshkrdotcom/gepa_ex/blob/v0.3.0/lib/gepa/llm/tracking.ex#L1)

Wraps arbitrary callable LLMs with lightweight token/cost accounting.

Elixir values are immutable, so counters are kept in an Agent owned by the
wrapper. `GEPA.StopCondition.MaxReflectionCost` can read the live cost via
`total_cost/1`.

# `counters`

```elixir
@type counters() :: %{
  total_cost: float(),
  total_tokens_in: non_neg_integer(),
  total_tokens_out: non_neg_integer(),
  calls: non_neg_integer()
}
```

# `t`

```elixir
@type t() :: %GEPA.LLM.Tracking{callable: function(), counter: pid()}
```

# `calls`

```elixir
@spec calls(t()) :: non_neg_integer()
```

# `complete`

```elixir
@spec complete(t(), GEPA.LLM.prompt(), keyword()) ::
  {:ok, String.t()} | {:error, term()}
```

# `counters`

```elixir
@spec counters(t()) :: counters()
```

# `new`

```elixir
@spec new(function()) :: t()
```

# `total_cost`

```elixir
@spec total_cost(t()) :: float()
```

# `total_tokens_in`

```elixir
@spec total_tokens_in(t()) :: non_neg_integer()
```

# `total_tokens_out`

```elixir
@spec total_tokens_out(t()) :: non_neg_integer()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
