# `Agentic.ModelRouter.Analyzer`

Analyzes a user request using a fast, ideally free model to determine
complexity, required capabilities (vision, audio, reasoning, etc.),
and context requirements.

The analysis result is then used by `Agentic.ModelRouter.Selector` to
pick the best model based on user preferences.

# `analysis`

```elixir
@type analysis() :: %{
  complexity: complexity(),
  required_capabilities: [atom()],
  needs_vision: boolean(),
  needs_audio: boolean(),
  needs_reasoning: boolean(),
  needs_large_context: boolean(),
  estimated_input_tokens: non_neg_integer(),
  explanation: String.t()
}
```

# `complexity`

```elixir
@type complexity() :: :simple | :moderate | :complex
```

# `analyze`

```elixir
@spec analyze(
  String.t(),
  keyword()
) :: {:ok, analysis()}
```

Analyze a user request for complexity and capability requirements.

Uses the cheapest available model (preferring free models) to classify
the request. Falls back to heuristic analysis if no model is available
or when the request is short enough that the LLM call isn't worth it.

# `analyze_heuristic`

```elixir
@spec analyze_heuristic(String.t()) :: {:ok, analysis()}
```

Pure heuristic analysis — no LLM call. Used as fallback when no
lightweight model is available or when the caller wants zero-latency analysis.

# `find_analysis_model`

Find the cheapest available model suitable for analysis.

---

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