Skip to content

Config

Configuration File

The hai configuration file is stored in two places:

  1. As an asset at .sys/hai.toml.
  2. Locally at ~/.hai/hai.toml where ~ is your home directory.

The two are merged key-by-key with values in ~/.hai/hai.toml overriding values from .sys/hai.toml.

The asset-backed configuration syncs automatically, making your settings available wherever you use hai. This requires a hai account.

Creation

You won't find the configuration file until you've launched hai at least once.

Default AI model

default_ai_model = "gpt-5.1-chat"

The /ai-default command is a REPL-command that updates this key-value.

Default editor

Some commands require an editor, for example, editing an asset. vim is the default editor, but you can change it to anything that takes a file path as argument including emacs, code, kate, and nano:

default_editor = "vim"

Some editors require additional arguments to prevent forking. For example, VSCode is best configured as follows:

default_editor = "code --new-window --disable-workspace-trust --wait"

Default shell

Programs are executed using a shell. By default, the shell is bash except on Windows where it's powershell.

default_shell = "bash"

Default empty toolbox

By default, the !hai tool is added to the toolbox at the start of a new conversation. While convenient, it comes with an input-token cost. To disable its automatic addition, use:

default_empty_toolbox = true

Check for updates

On start up, hai will check for two types of updates:

  1. Anonymously check for newer versions of hai.
  2. Check for a newer version of a user's asset-back config file.

To disable automatic update checks when hai is launched, set:

check_for_updates = false

Pro Privacy

By default (check_for_updates = true), these two checks are the only outgoing requests that hai makes automatically. All other requests occur solely as a result of explicit user actions. You can verify this with the hai/code task.

Tool confirmation

You can require confirmation before executing any tool:

tool_confirm = true

Use this if you're worried about your AI going rogue.

Temperature

By default, temperature is set to 0 across all AIs. That's hacker-friendly because it works uniformly across providers (minus some reasoning AIs) and optimizes for highest likelihood answers rather than whimsical exploration.

To use the default temperature set by AI providers, set:

default_ai_temperature_to_absolute_zero = false

Alternatively, you can use the /temperature command in the REPL.

OS keyring

By default, passwords for your asset encryption keys are stored in your OS keyring to persist between sessions:

use_os_keyring = true

Set this to false to disable OS keyring integration. You'll be prompted for passwords each session.

Asset cache size

Assets are cached locally to speed up repeated operations when there have been no server-side changes. The cache size is configured in bytes with the asset_blob_cache_size key. The default is 1 GiB. Set the value to 0 to disable the cache.

asset_blob_cache_size = 1073741824  # 1 GiB

When to disable

Consider disabling the cache if:

  • You need to conserve local disk space
  • You want to keep sensitive assets off your filesystem

Environment Variables

The following environment variables are recognized:

Environment variable Description
OPENAI_API_KEY API key for OpenAI.
GOOGLE_API_KEY API key for Google AI.
ANTHROPIC_API_KEY API key for Anthropic.
DEEPSEEK_API_KEY API key for DeepSeek.
XAI_API_KEY API key for xAI.
HAI_NO_PRETTY_IMAGES Disables high-resolution terminal image protocols (set to any value to enable).
HAI_IMAGE_HEIGHT Set height of images drawn in terminal with /read (default: 20).
HAI_USER Set the default account to use.
HAI_MODEL Set the default LLM model to use.