Customizing behavior
talon-ai-tools can be configured by changing settings in any .talon
file. You can copy any of the following settings, uncomment them, and change the values to customize which model you use or its runtime behavior.
# This is an example settings file.# To make changes, copy this into your user directory and remove the .example extension
settings(): # Set the endpoint that the model requests should go to. # Works with any API with the same schema as OpenAI's (i.e. Azure, llamafiles, etc.) # Set to "llm" to use the local llm cli tool as a helper for routing all your model requests # user.model_endpoint = "https://api.openai.com/v1/chat/completions"
# If using user.model_endpoint = "llm" and the llm binary is not found on Talon's PATH, you can # specify it directly: # user.model_llm_path = "/path/to/llm"
# user.model_system_prompt = "You are an assistant helping an office worker to be more productive."
# Change to the model of your choice # user.model_default = 'gpt-4o'
# Increase the window width. # user.model_window_char_width = 120
# Disable notifications for nominal behavior. Useful on Windows where notifications are # throttled. # user.model_verbose_notifications = false
# Use codeium instead of Github Copilot# tag(): user.codeium
Adding custom prompts
You do not need to fork the repository to add your own custom prompts. Copy the file below, place it anywhere inside your talon user/
directory and follow the pattern of the key value mapping.
# Copy this file into your user directory and add your own custom prompts# Any prompts in this list are automatically added into the <user.modelPrompt> capture# and thus can be used like normal alongside all of the other model commands
list: user.customPrompt-
# Example of a custom prompt that is unique to a user's personal workflow
check language: I am learning a new foreign language. Check the grammar of what I have written and return feedback in English with references to what I wrote.
Advanced Customization
Model-Specific Configuration with models.json
For advanced configuration of specific models, you can create a models.json
file in the root directory of the repository. Here’s an example of what this file can contain:
// This is an example model configuration file.// To use: copy settings into models.json in the same directory. Remove any comments.[ { // The name used in user.model_default or the right-hand-side of model.talon-list. "name": "gpt-4o-mini", // Additional JSON merged into the OpenAI Chat Completions API request if user.model_endpoint is not "llm". "api_options": { // The temperature of the model. Higher values make the model more creative. "temperature": 0.7 } }, { "name": "gemini-2.0-flash-search", // The model ID used in the LLM CLI tool or the API. If unspecified, defaults to the name. "model_id": "gemini-2.0-flash", // Model-specific system prompt (overrides user.model_system_prompt). "system_prompt": "You are a sassy but helpful assistant.", // Options passed to the LLM CLI tool if user.model_endpoint = "llm". Run `llm models --options` to see all options for each model. "llm_options": { // Enables a model-specific setting, namely, the Gemini search feature, which allows the model to search the web for information. "google_search": true } }]
The configuration is automatically reloaded when the file changes, so you don’t need to restart Talon after making changes.
Configuring Model Name
The word model
is the default prefix before all LLM commands to prevent collisions with other Talon commands. However, you can change or override it. To do so just create another talon list with the same name and a higher specificity. Here is an example that you can copy and past into your own configuration files
list: user.model-
# Whatever you say that matches the value on the left will be mapped to the word `model`# and thus allow any model commands to work as normal, but with a new prefix keyword
my custom model name: model
Providing Custom User Context
In case you want to provide additional context to the LLM, there is a hook that you can override in your own python code and anything that is returned will be sent with every request. Here is an example:
from talon import Context, Module, actions
mod = Module()
ctx = Context()
@ctx.action_class("user")class UserActions: def gpt_additional_user_context(): """This is an override function that can be used to add additional context to the prompt""" result = actions.user.talon_get_active_context() return [ f"The following describes the currently focused application:\n\n{result}" ]