How to Use YAML Configuration Profiles in Open Interpreter
Open Interpreter uses YAML configuration profiles stored in ~/.config/open-interpreter/profiles (Linux/macOS) or %APPDATA%\Open Interpreter\profiles (Windows) to define LLM settings, system messages, and startup scripts, which are loaded via the --profile CLI flag or programmatically through the profile() function.
Open Interpreter supports declarative configuration through YAML files that customize model parameters, enable specific computer API features, and execute startup scripts. These configuration profiles reside in the user's configuration directory and are processed by the profile loader in interpreter/terminal_interface/profiles/profiles.py. By creating custom YAML profiles, you can persist complex interpreter configurations and share them across sessions without manually setting options each time.
Where Open Interpreter Stores YAML Configuration Profiles
Open Interpreter discovers profiles in a dedicated directory inside your user configuration folder. According to the source code in interpreter/terminal_interface/profiles/profiles.py, the profile directory is defined at lines 19–20 as profile_dir = os.path.join(oi_dir, "profiles").
- Linux/macOS:
~/.config/open-interpreter/profiles/ - Windows:
%APPDATA%\Open Interpreter\profiles\
When you launch the interpreter with the --profile <name> argument, the CLI handler in interpreter/terminal_interface/start_terminal_interface.py (lines 471–476) passes your selection to the profile() function. This function resolves shortcuts (such as assistant or llama3) to actual filenames and calls get_profile() to parse the YAML content into a Python dictionary.
Anatomy of a YAML Configuration Profile
A valid YAML configuration profile contains up to four top-level keys that control different aspects of the interpreter runtime. The apply_profile_to_object() function in interpreter/terminal_interface/profiles/profiles.py (lines 62–71) recursively walks these keys and sets the corresponding attributes on the OpenInterpreter instance.
llm: Language Model Configuration
The llm key maps to settings for the language-model backend, including model name, temperature, API keys, and token limits.
llm:
model: gpt-4o
temperature: 0.2
max_tokens: 4096
computer: Computer API Settings
The computer key configures the built-in computer API, such as enabled languages and skill imports.
computer:
languages: [python, shell]
import_computer_api: true
system_message: Custom System Prompt
This key overrides the default system message defined in interpreter/core/default_system_message.py. Use multi-line YAML syntax for complex prompts.
system_message: |
You are an expert data-analysis assistant.
Always produce pandas DataFrames and plot with matplotlib.
start_script: Pre-Execution Python Code
The start_script key contains arbitrary Python code that executes before the interpreter begins processing user input. The apply_profile() function executes this via exec (lines 145–149 in profiles.py), allowing you to manipulate the interpreter object directly.
start_script: |
# Enable vision for supported models
interpreter.llm.supports_vision = True
interpreter.computer.languages.append("vision")
Loading Profiles via CLI and Programmatically
You can activate a YAML configuration profile either through the terminal interface or directly in Python code.
Command-Line Interface
Pass the profile name (with or without the .yaml extension) using the --profile flag:
interpreter --profile fast.yaml
Built-in shortcuts like assistant map to files in interpreter/terminal_interface/profiles/defaults/.
Programmatic Loading
Import the profile function to load a configuration file manually:
from interpreter import interpreter
from interpreter.terminal_interface.profiles import profile
# Load a YAML profile from the user config directory
interpreter = profile(interpreter, "my-custom.yaml")
# The interpreter now has the configured settings
interpreter.run("Analyze this dataset.")
Version Compatibility and Migration
Open Interpreter validates profile compatibility against the current version. The constant OI_VERSION = "0.2.5" is defined at lines 27–28 in interpreter/terminal_interface/profiles/profiles.py.
If your profile specifies a version key that does not match the installed interpreter version, the system triggers migrate_profile() or migrate_user_app_directory() (lines 216–258) to prompt you for schema migration. This prevents configuration errors caused by breaking changes between releases.
Complete YAML Configuration Profile Examples
Minimal Fast Profile
Create ~/.config/open-interpreter/profiles/fast.yaml for lightweight, quick runs:
# fast.yaml – optimized for speed and low cost
llm:
model: gpt-4o-mini
temperature: 0.0
max_tokens: 1024
computer:
import_computer_api: true
languages: [python]
auto_run: true
print: false
Run it with:
interpreter --profile fast.yaml
Data Analysis Specialist
Override the system message for consistent data processing behavior:
system_message: |
You are an expert data-science assistant.
All outputs must include descriptive statistics and visualization code.
llm:
model: gpt-4o
temperature: 0.1
computer:
languages: [python]
import_computer_api: true
Vision-Enabled Startup Script
Use start_script to dynamically configure the interpreter at runtime:
start_script: |
import os
interpreter.llm.supports_vision = True
interpreter.computer.languages.append("vision")
print(f"Vision support enabled. Working directory: {os.getcwd()}")
llm:
model: gpt-4o
Summary
- Open Interpreter stores YAML configuration profiles in platform-specific config directories (
~/.config/open-interpreter/profilesor%APPDATA%\Open Interpreter\profiles). - Profiles support four primary keys:
llmfor model settings,computerfor API configuration,system_messagefor custom prompts, andstart_scriptfor initialization code. - The
profile()function ininterpreter/terminal_interface/profiles/profiles.pyhandles loading, whileapply_profile()executes startup scripts and merges settings into the interpreter instance. - Use the
--profileCLI flag for terminal sessions or importprofile()programmatically to configure the interpreter in Python scripts. - Version checking ensures profile compatibility with the installed interpreter version (
OI_VERSION), triggering migration prompts when schemas differ.
Frequently Asked Questions
Where does Open Interpreter look for YAML configuration profiles?
Open Interpreter searches for profiles in ~/.config/open-interpreter/profiles on Linux and macOS, or %APPDATA%\Open Interpreter\profiles on Windows. You can reference built-in profiles by shortcuts (like assistant) which map to interpreter/terminal_interface/profiles/defaults/, or provide a full filename for custom profiles stored in your user config directory.
Can I use Python files instead of YAML for configuration profiles?
Yes. The get_profile() function in interpreter/terminal_interface/profiles/profiles.py supports YAML, JSON, and Python files. Python profiles (such as assistant.py in the defaults directory) allow complex logic and dynamic configuration that YAML cannot express, though YAML is preferred for static, declarative settings.
How do I override the default system message using a YAML profile?
Add a system_message key to your YAML file with your custom prompt as the value. This overrides the default message defined in interpreter/core/default_system_message.py. Use the pipe character (|) for multi-line strings to maintain formatting across line breaks.
What happens if my YAML profile version doesn't match the Open Interpreter version?
If your profile contains a version key that differs from the current OI_VERSION (currently "0.2.5"), the interpreter invokes migrate_profile() or migrate_user_app_directory() from interpreter/terminal_interface/profiles/profiles.py. You will be prompted to migrate the file to the new schema, preventing runtime errors from deprecated configuration keys.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →