Configuration

Mentat has a number of customizable settings. They can be changed globally by setting in ~/.mentat/.mentat_config.json or on a per project level by setting in .mentat_config.json. They can also be set as a command line flag, see Command Line Arguments, note underscores become dashes on the cli. Finally they can be changed mid-session with the /config command.

The following is a partial list of customizable settings.

Settings

model

The model used for making edits. We recommend sticking to gpt-4-1106-preview. For changing to non-openai models see πŸ¦™ Alternative Models.

maximum_context

The maximum number of tokens to put into context. When using an openai model this defaults to the model’s maximum context. Otherwise it defaults to 4096.

auto_context_tokens

When this is set to a positive integer that many tokens of additional context are selected with an embeddings system and put into context. For more see Auto Context.

theme

Currently only dark and light are supported.

temperature

The temperature used by the edit generating model. This defaults to 0.2.

no_parser_prompt

When this is set to true the model isn’t given a system prompt describing how to make edits. This should only be set for fine tuned models.

embedding_model

The model used for making embeddings.

file_exclude_glob_list

List of glob patterns to exclude files from being read/edited by Mentat. These take effect whenever you provide Mentat with a directory as an argument. Mentat will add all files in the directory that are not in your .gitignore and do not match these glob patterns. Glob patterns are interpreted from the git root location. If you wanted to exclude all files ending in .py, the pattern to use would be **/*.py rather than *.py. Here is an example that would exclude all hidden directories and files:

{
    "file-exclude-glob-list": ["**/.*, **/.*/**"]
}

parser

Mentat is able to edit files by parsing a specific format that the model is told to follow. We are always working to improve the format we use, and have multiple formats available. Although we expect the default format to perform the best, you can test out other formats using the configuration.

{
    "parser": "block"
}

Available formats: