Install & Compatibility
Where this runs
tested against v0.4.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.11
✕ build_error
4/8 runs
py 3.12
✕ build_error
4/8 runs
py 3.13
✕ build_error
✕ build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
interpreter
✓ from interpreter import interpreter
✗ from interpreter import interpreter
This quickstart demonstrates how to initialize Open Interpreter and start an interactive chat session. It includes a placeholder for setting the OpenAI API key, which is necessary when using hosted models. By default, Open Interpreter asks for user confirmation before executing any code for safety reasons. `auto_run = True` can bypass this, but should be used with extreme caution as code executes directly on your system.
import os
from interpreter import interpreter
# Configure API key for hosted models (e.g., OpenAI)
# For local models, this might not be needed or setup differently.
os.environ['OPENAI_API_KEY'] = os.environ.get('OPENAI_API_KEY', 'YOUR_OPENAI_API_KEY')
# Enable auto_run with caution, or let it prompt for confirmation
interpreter.auto_run = False # Set to True to bypass confirmation, use with extreme caution
print("Starting interactive Open Interpreter chat. Type 'quit' to exit.\n")
# Start an interactive chat
# The interpreter will ask for confirmation before executing code by default.
interpreter.chat()
interpreter --version
Debug
Known issues
breakingOpen Interpreter executes code directly on your local system, allowing it to modify files, install packages, and interact with system settings. While it prompts for confirmation by default, bypassing this with `interpreter.auto_run = True` or `interpreter -y` carries significant risk, including data loss or security vulnerabilities.fixAlways review the generated code carefully before approving execution. Avoid using `auto_run = True` or `-y` in production environments or with untrusted input. Consider running in a sandboxed environment (e.g., Docker, VM) for sensitive tasks.
affects: All versions
gotchaPython version compatibility can be strict, especially for optional dependencies like `llama-cpp-python`. While PyPI states `>=3.9, <4`, official documentation often recommends Python 3.10 or 3.11 and notes issues with Python 3.12 for some dependencies.fixUse Python 3.10 or 3.11. If encountering installation errors, verify your Python version and consider using a virtual environment (e.g., `conda`, `venv`) to manage dependencies.
affects: All versions, particularly with `llama-cpp-python`
gotchaWhen using hosted LLMs (e.g., OpenAI's GPT-4), an API key must be configured. For OpenAI, this is typically done by setting the `OPENAI_API_KEY` environment variable.fixSet the `OPENAI_API_KEY` environment variable before running the interpreter. For example, `export OPENAI_API_KEY="your_key_here"` on Linux/macOS or via code `os.environ['OPENAI_API_KEY'] = 'your_key'`.
affects: All versions
gotchaUsers often encounter `InvalidRequestError: The model gpt-4 does not exist or you do not have access to it` when trying to use GPT-4.fixEnsure your OpenAI account has access to the GPT-4 API. This may require having a paid account or sufficient usage history. Alternatively, select a different model available to your account (e.g., `gpt-3.5-turbo`) by setting `interpreter.llm.model = "gpt-3.5-turbo"`.
affects: All versions with OpenAI API
Upgrade
Version history
0.4.3latest on PyPI · released Oct 26, 2024
Audit
Dependencies
pythonrequiredRequired for running the library. Docs recommend Python 3.10 or 3.11.
openaioptionalRequired for using OpenAI models as the LLM backend.
llama-cpp-pythonoptionalRequired for using Llama-based local LLMs. Can be complex to install.
litellmrequiredUsed internally to connect to various language models.