What if you could describe a task in plain English and have your computer carry it out — running scripts, browsing files, editing spreadsheets, and calling APIs — without you writing a single line of code? That is the premise behind Open Interpreter, the open-source project that gives a large language model a persistent terminal session on your machine. This guide covers installation, running it fully locally via Ollama, the safety mechanisms you need to understand before handing the model a shell, and how it compares to Anthropic’s Claude Computer Use.
What Open Interpreter Actually Does
Open Interpreter spins up a REPL-style loop where you type natural language and the model responds with executable code — Python, shell commands, JavaScript, whatever suits the task. It runs that code in a real process on your machine, captures the output, feeds it back to the model, and continues until the task is done or it needs your input.
This is fundamentally different from ChatGPT’s code interpreter, which runs sandboxed Python in a cloud container with no access to your file system, network, or local applications. Open Interpreter runs on your hardware, with your permissions, in your environment.
Installation
Python 3.10 or newer is required.
pip install open-interpreter
That is it. The package pulls in LiteLLM under the hood, which handles model routing to OpenAI, Anthropic, local Ollama servers, and dozens of other providers.
Launch it:
interpreter
By default it tries to use GPT-4o via the OPENAI_API_KEY environment variable. To use a local model, read the next section.
Running Locally with Ollama
Ollama is the easiest way to serve local LLMs with an OpenAI-compatible API. Install it from ollama.com, then pull a capable model:
ollama pull llama3:8b
ollama pull mistral:7b-instruct
For coding-heavy tasks, the Qwen2.5-Coder models tend to outperform general-purpose models:
ollama pull qwen2.5-coder:7b
Now point Open Interpreter at your local Ollama server:
interpreter --model ollama/qwen2.5-coder:7b
Or set it persistently in your profile:
interpreter --model ollama/llama3:8b --profile
This writes a config file to ~/.openinterpreter/profile.yaml. Subsequent interpreter invocations will use it without flags.
Config File Example
model: ollama/qwen2.5-coder:7b
api_base: http://localhost:11434
auto_run: false
safe_mode: ask
Safe Mode and Code Execution Control
This is the part most tutorials gloss over, and it is the most important part to understand before you let a language model run shell commands.
The Three Safe Mode Options
| Mode | Behavior |
|---|---|
off | Executes all generated code immediately, no prompts |
ask | Prompts you to approve each code block before running |
auto | Runs safe operations (read-only), asks for destructive ones |
Always start with ask mode until you trust how the model behaves on your specific tasks. The off mode is genuinely dangerous with an under-instructed model. A confused model asked to “clean up my downloads folder” could misinterpret the task scope.
Set safe mode via flag:
interpreter --safe-mode ask
Or in the YAML profile as shown above.
What Gets Executed
Open Interpreter runs code in whatever languages are available on your PATH. Python via the embedded interpreter, shell commands via subprocess, and optionally JavaScript via Node. You can restrict languages:
# In a Python script using the Open Interpreter library
import interpreter
interpreter.computer.languages = ["python"]
Sandboxing Strategies
If you want to experiment with auto_run: true without risking your actual system, run Open Interpreter inside a Docker container:
docker run -it --rm \
-e OPENAI_API_KEY=$OPENAI_API_KEY \
-v $(pwd)/workspace:/workspace \
python:3.11-slim bash -c \
"pip install open-interpreter && interpreter"
Map a dedicated workspace directory so the model has a real file system to work with but cannot reach your home directory. This is the recommended setup for automated pipeline use cases where auto_run is required.
Practical Use Cases
File and data processing:
> "Find all PDF files in ~/Downloads modified this week, extract their text, and create a summary CSV with filename, page count, and first 200 characters"
Code generation and execution:
> "Write a Python script that monitors my CPU temperature every 5 seconds and alerts me if it exceeds 85°C, then run it"
System administration:
> "Show me the 10 largest directories under /var, then identify which ones I haven't accessed in over 90 days"
In each case the model writes code, shows it to you (in ask mode), runs it when approved, reads the output, and continues. The experience is closer to pair programming with an unusually productive colleague than to a chatbot.
Comparing Open Interpreter to Claude Computer Use
Claude Computer Use is Anthropic’s approach to the same problem: give an AI the ability to control a computer. The architectures differ significantly.
| Feature | Open Interpreter | Claude Computer Use |
|---|---|---|
| Interface | Terminal / code REPL | Screenshots + mouse/keyboard |
| Model | Any LLM (local or cloud) | Claude 3.5 Sonnet+ only |
| Cost | Free if using local model | API usage billed per token |
| Privacy | Fully local possible | Sends screenshots to Anthropic |
| GUI interaction | No (code only) | Yes (clicks, types in any app) |
| Setup complexity | pip install | Docker + VNC setup |
| Reliability | High for code tasks | High for GUI tasks |
The key distinction: Open Interpreter is a code execution agent. It controls your computer by writing and running programs. Claude Computer Use is a GUI automation agent — it literally looks at your screen and moves the mouse. They are complementary tools. Use Open Interpreter for data processing, file manipulation, and API calls. Use Computer Use for tasks that require navigating graphical applications with no API alternative.
Tips for Best Results
- Be specific about scope. “Organize my photos” is dangerous. “Move all .jpg files in ~/Desktop into subdirectories named by year-month using EXIF data” is safe and executable.
- Use a capable model. 7B models can handle simple tasks. Complex multi-step workflows benefit from 13B+ or a cloud model like GPT-4o.
- Review the code before approving. Even in
askmode, actually read what the model generates. This is how you learn what it is capable of and catch mistakes before they run. - Keep a workspace directory. Give the model a dedicated working directory rather than letting it roam your home folder.
Open Interpreter is one of the most genuinely useful AI tools available to technically-minded users. It handles real work, runs locally, and respects the boundary between AI suggestion and human approval — as long as you configure it correctly.