# `Rho.Config`
[🔗](https://github.com/GenericJam/rho/blob/v0.1.0/lib/rho/config.ex#L1)

The host's settings for rho, `config :rho, ...`, each with a default that
works on a computer. `:data_dir`, `:default_model` and `:system_prompt`
may be given as `{module, function, args}` (or a 0-arity function),
called each time the value is read, so a host can keep them in its own
settings and change them at run time.

  * `:data_dir`: where rho keeps sessions, artifacts, todo lists, the
    cost ledger, `usage.json`, `settings.json`, the trimmed model catalog
    and (with the default credential store) the sign-ins. Default:
    `MOB_DATA_DIR` when set (a mob app's private files dir), else the
    OS's per-user data dir for `"rho"` (`:filename.basedir/2`). Created
    on first read.
  * `:credential_store`: a `Rho.CredentialStore` module. Default
    `Rho.CredentialStore.File` (0600 files under the data dir); a phone
    app plugs in the platform's secure store (Keystore / Keychain).
  * `:settings`: a `Rho.Settings` module (fallback model, daily cost
    cap). Default `Rho.Settings.File` (`settings.json` in the data dir).
  * `:default_model`: a req_llm spec, default
    `"anthropic:claude-haiku-4-5"`.
  * `:system_prompt`: the loop's system prompt when a loop isn't given
    one. Default `Rho.default_system_prompt/0`.
  * `:namespace`: the prefix of the `customType` of the loop's notices
    in a session (`"<namespace>.notice"`, `.error`, `.aside`). Default
    `"rho"`; Operator's sessions use `"operator"`.
  * `:open_url`: how `Rho.Auth.Login` opens the provider's sign-in page,
    `fn url -> :ok end` or an MFA taking the URL last. Default
    `Rho.Auth.Login.open_in_browser/1` (`open` / `xdg-open` / `start`);
    a mob app sets `{Mob.Device, :open_url, []}`.
  * `:app_name`: what the sign-in pages call the app ("Switch back to
    … to finish signing in"). Default `"the app"`.
  * `:hints`: where the user fixes a failed call, as `Rho.LLM.describe/1`
    and `Rho.Auth.Login` say it: `sign_in:` (default
    `"from the app's settings"`, as in "sign in again from …") and
    `switch_model:` (default `"in the app's settings"`); and, for Dyn
    (`Rho.Dyn.agent_guide/0`, `dyn_propose`), `approve:`, how the human
    approves a proposed generation (default `"on the phone with the screen
    lock (fingerprint, face, PIN, pattern, password or passcode)"`, as
    `Rho.Dyn.Approval.Biometric` behind an approve control).
  * `:tools`, `:tool_sources`: `Rho.ToolRegistry`'s core tools and
    registry sources, when `Rho.Supervisor` isn't given them.
  * `:dyn`: the Dyn layer (agent-written code, `Rho.Dyn`), off by
    default; its keys are `Rho.Dyn.Config`'s.

# `app_name`

```elixir
@spec app_name() :: String.t()
```

The `:app_name` the sign-in pages show.

# `credential_store`

```elixir
@spec credential_store() :: module()
```

The `:credential_store` module in effect.

# `data_dir`

```elixir
@spec data_dir() :: String.t()
```

The data dir (created if missing).

# `default_model`

```elixir
@spec default_model() :: String.t()
```

The `:default_model` spec, resolved: what `Rho.start_loop/1` uses without a `:model`.

# `hint`

```elixir
@spec hint(:sign_in | :switch_model | :approve) :: String.t()
```

The `:hints` entry `key` (`:sign_in`, `:switch_model` or `:approve`).

# `namespace`

```elixir
@spec namespace() :: String.t()
```

The `:namespace` prefix of the loop's notice `customType`s.

# `open_url`

```elixir
@spec open_url(String.t()) :: term()
```

Opens `url` for the user with the configured `:open_url`.

# `resolve`

```elixir
@spec resolve(term(), [term()]) :: term()
```

A config value: a function or `{m, f, a}` is called (with `extra` args
appended), anything else is returned as it is.

# `settings`

```elixir
@spec settings() :: module()
```

The `:settings` module in effect.

# `system_prompt`

```elixir
@spec system_prompt() :: String.t()
```

The `:system_prompt`, resolved (`Rho.default_system_prompt/0` when unset).

---

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