# `Tune.ModelConfig`
[🔗](https://github.com/mikehostetler/tune/blob/v0.5.0/lib/tune/model_config.ex#L1)

One explicit, fixed model configuration: a ReqLLM model, a prompt adapter,
adapter options, and ReqLLM request options.

    {:ok, config} =
      Tune.ModelConfig.new(
        model: "openai:gpt-4o-mini",
        adapter: Tune.Adapter.Chat,
        request_options: [temperature: 0.0]
      )

The adapter is always explicit. Request options pass through to ReqLLM,
except options that would replace the prepared output contract, change the
prompt, add tools, stream, or repair output. Managed requests always send
`json_repair: false`.

Request options can hold credentials. They are never copied into prepared
requests, steps, results, or artifacts.

# `t`

```elixir
@type t() :: %Tune.ModelConfig{
  adapter: module(),
  adapter_options: keyword(),
  model: term(),
  model_id: String.t(),
  request_options: keyword()
}
```

# `describe`

```elixir
@spec describe(t()) :: map()
```

Returns non-secret identifiers for provenance and reports.

# `new`

```elixir
@spec new(t() | keyword()) :: {:ok, t()} | {:error, Exception.t()}
```

Builds a model configuration.

Options:

  * `:model` - required ReqLLM model input, resolved through `ReqLLM.model/1`
  * `:adapter` - required module implementing `Tune.Adapter`
  * `:adapter_options` - options validated by the adapter
  * `:request_options` - ReqLLM generation options

# `request_options`

```elixir
@spec request_options(t(), ReqLLM.Output.t(), non_neg_integer() | nil) :: keyword()
```

Returns ReqLLM options for one managed request.

`output` is the prepared output descriptor. `remaining_ms`, when given, caps
`:total_timeout` so the request cannot outlive the run deadline.

---

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