Configuration

The Ditana Assistant configuration is stored in a YAML file located at:

  • Linux: ~/.config/ditana-assistant/config.yaml
  • macOS: ~/Library/Application Support/ditana-assistant/config.yaml
  • Windows: C:\Users\<username>\AppData\Local\ditana-assistant\config.yaml

Available Configuration Options:

assume_english: false
enable_experimental_features: false
generate_terminal_cmd: true
koboldcpp_base_url: http://localhost:5001  # when using Gemma
model_cache_size: 20
model_cache_start_lifetime_sec: 604800
model_type: gemma # or 'openai'
offer_cmd_execution: true
openai_model: gpt-4o-mini  # when using OpenAI
show_debug_messages: false
wolfram_alpha_cache_size: 1
wolfram_alpha_cache_start_lifetime_sec: 675
wolfram_alpha_error_cache_size: 1
wolfram_alpha_error_cache_start_lifetime_sec: 604800
wolfram_alpha_short_answers_app_id: '' # https://developer.wolframalpha.com

Configuration Option Details

Core Functionality Settings

  • model_type: Specifies the AI model to use. Currently, gemma for KoboldCpp and openai for OpenAI models are supported. Also see Using OpenAI. Default: gemma (requires local KoboldCpp server)

  • koboldcpp_base_url: The base URL of the KoboldCpp server, used when model_type is set to gemma. Default: http://localhost:5001

  • openai_model: The specific OpenAI model to use when model_type is set to openai, see Using OpenAI. Default: gpt-4o-mini

  • wolfram_alpha_short_answers_app_id: The App ID for Wolfram|Alpha’s Short Answers API, see Using Wolfram|Alpha. Default: '''

  • generate_terminal_cmd: If enabled, the wizard will analyse the user’s input to see if it relates to their computer and can be solved by a terminal command. The terminal command is only offered for execution if offer_cmd_execution is also enabled. Default: true.

  • offer_cmd_execution: If enabled, the assistant will offer to execute detected terminal commands based on the output. This usually happens together with generate_terminal_cmd, but not necessarily. Default: true.

Advanced Configuration

  • assume_english: If set to true, the assistant will assume all text is in English without performing language detection. Language detection is only used for specific use cases such as Wolfram|Alpha or internal meta-requests that need to be combined with the user prompt. Default: false.

  • enable_experimental_features: Activates experimental features for development and testing purposes. This is intended for internal use to systematically test new functionalities. Use with caution as features are still in development. Default: false.

  • model_cache_size: Maximum size (in MiB) of the cache used for model responses. Note that the actual cache file size will be approximately 1/3 larger due to JSON formatting overhead. Default: 20 MiB.

  • model_cache_start_lifetime_sec: The initial lifetime (in seconds) for model cache entries. When this period expires, the cache entry is re-evaluated; if a new response matches the cached one, the lifetime is extended, otherwise, it is shortened. Default: 604800 seconds (1 week).

  • show_debug_messages: Controls whether debug messages are displayed during the assistant’s operation. Useful for troubleshooting. Default: false.

  • wolfram_alpha_cache_size: Maximum size (in MiB) of the cache used for storing responses from the Wolfram|Alpha API. The actual file size will be approximately 1/3 larger due to JSON syntax. Default: 1 MiB.

  • wolfram_alpha_cache_start_lifetime_sec: The initial lifetime (in seconds) for Wolfram|Alpha cache entries. The lifetime is adjusted based on whether subsequent API responses remain consistent or change. Default: 675 seconds.

  • wolfram_alpha_error_cache_size: Maximum size (in MiB) of the cache used for failed Wolfram|Alpha API requests. This helps avoid repeated requests for errors. Default: 1 MiB.

  • wolfram_alpha_error_cache_start_lifetime_sec: The initial lifetime (in seconds) for entries in the error cache. Lifetimes are adjusted based on whether the error persists. Default: 604800 seconds (1 week).

Using OpenAI

Set the OPENAI_API_KEY environment variable with your OpenAI API key when configuring OpenAI models (see below config entries model_type and openai_model). As of October 2024, gpt-4o-mini is a factor of 20 cheaper than gpt-3.5-turbo: $0.150 / 1M input tokens. According to https://platform.openai.com/docs/models/gpt-3-5-turbo:

“As of July 2024, gpt-4o-mini should be used in place of gpt-3.5-turbo, as it is cheaper, more capable, multimodal, and just as fast. gpt-3.5-turbo is still available for use in the API.”

Note that the number of API accesses is reduced by Ditana Assistant’s sophisticated caching algorithm.

Using Wolfram|Alpha

Obtain an App ID by creating a “Short Answers API Key” on https://developer.wolframalpha.com and set the config entry wolfram_alpha_short_answers_app_id to its value. Make sure to select Short Answers API in the dialog:

Wolfram Alpha Short Answers API Key

Currently, 2000 accesses per month are free. Note that the number of API accesses is reduced by Ditana Assistant’s sophisticated caching algorithm.