Skip to content

smelt.config

Tier: UiHost - Requires a terminal UI; calling these from headless mode raises.

Visibility: Public - Stable Lua API intended for user config and plugins.

Resolved application configuration introspection. All fields are read-only snapshots of the active config. UiHost-only.

smelt.config.api_base

fun(): string?

Active API base URL.

smelt.config.api_key_env

fun(): string?

Name of the environment variable that supplies the API key for the active provider.

smelt.config.context_window

fun(): integer?

Configured context-window size in tokens for the active model, or nil when not declared.

smelt.config.model_config

fun(): table?

Resolved model-level sampling, capability, and cost overrides as a table. Fields are nil when not explicitly set: name, temperature, top_p, top_k, min_p, repeat_penalty, tool_calling, max_tokens, context_window, supports_reasoning, input_modalities, thinking_budgets ({ low, medium, high, max }), input_cost, output_cost, cache_read_cost, cache_write_cost.

smelt.config.provider_type

fun(): string?

Active provider type string, e.g. "openai", "anthropic", "openai-compatible".

smelt.config.runtime_status

fun(): table

Return sanitized runtime and reload diagnostics: committed Lua/runtime revisions, pending reload and last failure location, model selection, managed-provider freshness, and MCP/LSP/watcher/context controller convergence. No credential values or Lua source contents are included.