# `LLMProxy.Providers.Routing.Performance`
[🔗](https://github.com/elixir-vibe/llm_proxy/blob/v0.3.1/lib/llm_proxy/providers/routing/performance.ex#L1)

Keeps bounded, per-deployment performance observations for latency-aware routing.

State is intentionally node-local and ephemeral. Durable request accounting remains
in storage, while this process only serves the routing hot path.

# `stats`

```elixir
@type stats() :: %{
  success_count: non_neg_integer(),
  ttft_count: non_neg_integer(),
  error_count: non_neg_integer(),
  median_duration_ms: number() | nil,
  median_ttft_ms: number() | nil,
  updated_at: integer() | nil
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `observe`

```elixir
@spec observe(
  LLMProxy.Providers.Attempt.t(),
  LLMProxy.Providers.Routing.Sample.t(),
  atom() | nil
) ::
  :ok
```

# `order`

```elixir
@spec order(
  String.t(),
  [LLMProxy.Catalog.Deployment.t()],
  LLMProxy.Protocol.Request.t()
) :: [
  LLMProxy.Catalog.Deployment.t()
]
```

# `reset`

```elixir
@spec reset() :: :ok
```

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

# `stats`

```elixir
@spec stats(LLMProxy.Providers.Attempt.t(), LLMProxy.Protocol.Request.t()) :: stats()
```

---

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