● Open Interpreter
Let language models run code on your computer.
An open-source, locally running implementation of OpenAI's Code Interpreter.

Open Interpreter lets LLMs run code (Python, Javascript, Shell, and more) locally. You can chat with Open Interpreter through a ChatGPT-like interface in your terminal by running
$ interpreter
after installing.This provides a natural-language interface to your computer's general-purpose capabilities:
- Create and edit photos, videos, PDFs, etc.
- Control a Chrome browser to perform research
- Plot, clean, and analyze large datasets
- ...etc.
⚠️ Note: You'll be asked to approve code before it's run.
Demo
Details
Open.Interpreter.Demo.mp4
An interactive demo is also avaliable on Google Colab:
Quick Start
Terminal
After installation, simply run
interpreter
:Python
Comparison to ChatGPT's Code Interpreter
OpenAI's release of Code Interpreter with GPT-4 presents a fantastic opportunity to accomplish real-world tasks with ChatGPT.
However, OpenAI's service is hosted, closed-source, and heavily restricted:
- No internet access.
- 100 MB maximum upload, 120.0 second runtime limit.
- State is cleared (along with any generated files or links) when the environment dies.
Open Interpreter overcomes these limitations by running on your local environment. It has full access to the internet, isn't restricted by time or file size, and can utilize any package or library.
This combines the power of GPT-4's Code Interpreter with the flexibility of your local development environment.
Commands
Interactive Chat
To start an interactive chat in your terminal, either run
interpreter
from the command line:Or
interpreter.chat()
from a .py file:Programmatic Chat
For more precise control, you can pass messages directly to
.chat(message)
:Start a New Chat
In Python, Open Interpreter remembers conversation history. If you want to start fresh, you can reset it:
Save and Restore Chats
interpreter.chat()
returns a List of messages when return_messages=True, which can be used to resume a conversation with interpreter.load(messages)
:Customize System Message
You can inspect and configure Open Interpreter's system message to extend its functionality, modify permissions, or give it more context.
Change the Model
You can run
interpreter
in local mode from the command line to use Code Llama
:For
gpt-3.5-turbo
, use fast mode:Or, in Python, set the model manually:
Safety Notice
Since generated code is executed in your local environment, it can interact with your files and system settings, potentially leading to unexpected outcomes like data loss or security risks.
⚠️ Open Interpreter will ask for user confirmation before executing code.
You can run
interpreter -y
or set interpreter.auto_run = True
to bypass this confirmation, in which case:- Be cautious when requesting commands that modify files or system settings.
- Watch Open Interpreter like a self-driving car, and be prepared to end the process by closing your terminal.
- Consider running Open Interpreter in a restricted environment like Google Colab or Replit. These environments are more isolated, reducing the risks associated with executing arbitrary code.
How Does it Work?
Open Interpreter equips a function-calling language model with an
exec()
function, which accepts a language
(like "python" or "javascript") and code
to run.We then stream the model's messages, code, and your system's outputs to the terminal as Markdown.
Contributing
This is a community-made project. If it looks exciting to you, please don't hesitate to contribute!
License
Open Interpreter is licensed under the MIT License. You are permitted to use, copy, modify, distribute, sublicense and sell copies of the software.
Note: This software is not affiliated with OpenAI.