# `Ollixir.Options`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L1)

Model inference options.

Provides typed, validated options for controlling model behavior.
All options are optional - only set what you need to change from defaults.

# `t`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L46)

```elixir
@type t() :: %Ollixir.Options{
  embedding_only: boolean() | nil,
  extra: map(),
  f16_kv: boolean() | nil,
  frequency_penalty: float() | nil,
  logits_all: boolean() | nil,
  low_vram: boolean() | nil,
  main_gpu: non_neg_integer() | nil,
  mirostat: 0 | 1 | 2 | nil,
  mirostat_eta: float() | nil,
  mirostat_tau: float() | nil,
  num_batch: pos_integer() | nil,
  num_ctx: pos_integer() | nil,
  num_gpu: integer() | nil,
  num_keep: integer() | nil,
  num_predict: integer() | nil,
  num_thread: pos_integer() | nil,
  numa: boolean() | nil,
  penalize_newline: boolean() | nil,
  presence_penalty: float() | nil,
  repeat_last_n: integer() | nil,
  repeat_penalty: float() | nil,
  seed: integer() | nil,
  stop: [String.t()] | nil,
  temperature: float() | nil,
  tfs_z: float() | nil,
  top_k: non_neg_integer() | nil,
  top_p: float() | nil,
  typical_p: float() | nil,
  use_mlock: boolean() | nil,
  use_mmap: boolean() | nil,
  vocab_only: boolean() | nil
}
```

# `build`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L94)

```elixir
@spec build(keyword()) :: {:ok, t()} | {:error, term()}
```

Build options from keyword list with validation.

# `build!`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L113)

```elixir
@spec build!(keyword()) :: t()
```

Build options, raising on validation error.

# `frequency_penalty`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L229)

```elixir
@spec frequency_penalty(t(), float()) :: t()
```

Set frequency penalty (0.0-2.0).

# `from_map`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L252)

```elixir
@spec from_map(map()) :: {:ok, t()} | {:error, term()}
```

Create options from a map.

# `mirostat`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L213)

```elixir
@spec mirostat(t(), 0 | 1 | 2) :: t()
```

Set mirostat mode (0 = disabled, 1 = v1, 2 = v2).

# `new`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L88)

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

Create a new empty options struct.

# `num_ctx`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L165)

```elixir
@spec num_ctx(t(), pos_integer()) :: t()
```

Set context window size.

# `num_gpu`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L189)

```elixir
@spec num_gpu(t(), integer()) :: t()
```

Set number of GPU layers (-1 = all, 0 = CPU only).

# `num_predict`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L157)

```elixir
@spec num_predict(t(), integer()) :: t()
```

Set max tokens to generate (-1 = unlimited).

# `numa`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L197)

```elixir
@spec numa(t(), boolean()) :: t()
```

Enable/disable NUMA.

# `presence_penalty`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L221)

```elixir
@spec presence_penalty(t(), float()) :: t()
```

Set presence penalty (0.0-2.0).

# `repeat_penalty`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L173)

```elixir
@spec repeat_penalty(t(), float()) :: t()
```

Set repeat penalty (1.0 = no penalty).

# `seed`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L149)

```elixir
@spec seed(t(), integer()) :: t()
```

Set random seed for reproducibility.

# `stop`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L181)

```elixir
@spec stop(t(), [String.t()]) :: t()
```

Set stop sequences.

# `temperature`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L124)

```elixir
@spec temperature(t(), float()) :: t()
```

Set temperature (>= 0.0).

# `to_map`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L239)

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

Convert options struct to map for API request.

Excludes nil values and merges custom keys.

# `top_k`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L132)

```elixir
@spec top_k(t(), non_neg_integer()) :: t()
```

Set top_k sampling (0 = disabled).

# `top_p`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L140)

```elixir
@spec top_p(t(), float()) :: t()
```

Set top_p/nucleus sampling (0.0-1.0).

# `use_mmap`
[🔗](https://github.com/nshkrdotcom/ollixir/blob/main/lib/ollixir/options.ex#L205)

```elixir
@spec use_mmap(t(), boolean()) :: t()
```

Enable/disable memory mapping.

---

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