Package: open-interpreter-bmo
● Open InterpreterLet language models run code on your computer.An open-source, locally running implementation of OpenAI's Code Interpreter.Get early access to the desktop application.pipinstallopen-interpreterinterpreterOpen Interpreterlets 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$ interpreterafter 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 researchPlot, clean, and analyze large datasets...etc.⚠️ Note: You'll be asked to approve code before it's run.Demohttps://github.com/KillianLucas/open-interpreter/assets/63927363/37152071-680d-4423-9af3-64836a6f7b60An interactive demo is also available on Google Colab:Quick Startpipinstallopen-interpreterTerminalAfter installation, simply runinterpreter:interpreterPythonimportinterpreterinterpreter.chat("Plot AAPL and META's normalized stock prices")# Executes a single commandinterpreter.chat()# Starts an interactive chatComparison to ChatGPT's Code InterpreterOpenAI's release ofCode Interpreterwith 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.Limited set  of pre-installed packages.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.CommandsInteractive ChatTo start an interactive chat in your terminal, either runinterpreterfrom the command line:interpreterOrinterpreter.chat()from a .py file:interpreter.chat()Programmatic ChatFor more precise control, you can pass messages directly to.chat(message):interpreter.chat("Add subtitles to all videos in /videos.")# ... Streams output to your terminal, completes task ...interpreter.chat("These look great but can you make the subtitles bigger?")# ...Start a New ChatIn Python, Open Interpreter remembers conversation history. If you want to start fresh, you can reset it:interpreter.reset()Save and Restore Chatsinterpreter.chat()returns a List of messages when return_messages=True, which can be used to resume a conversation withinterpreter.load(messages):messages=interpreter.chat("My name is Killian.",return_messages=True)# Save messages to 'messages'interpreter.reset()# Reset interpreter ("Killian" will be forgotten)interpreter.load(messages)# Resume chat from 'messages' ("Killian" will be remembered)Customize System MessageYou can inspect and configure Open Interpreter's system message to extend its functionality, modify permissions, or give it more context.interpreter.system_message+="""Run shell commands with -y so the user doesn't have to confirm them."""print(interpreter.system_message)Change the ModelⓘIssues running locally?Read our newGPU setup guideandWindows setup guide.You can runinterpreterin local mode from the command line to useCode Llama:interpreter--localForgpt-3.5-turbo, use fast mode:interpreter--fastIn Python, you will need to set the model manually:interpreter.model="gpt-3.5-turbo"Azure SupportTo connect to an Azure deployment, the--use-azureflag will walk you through setting this up:interpreter --use-azureIn Python, set the following variables:interpreter.use_azure = True
interpreter.api_key = "your_openai_api_key"
interpreter.azure_api_base = "your_azure_api_base"
interpreter.azure_api_version = "your_azure_api_version"
interpreter.azure_deployment_name = "your_azure_deployment_name"
interpreter.azure_api_type = "azure"Debug modeTo help contributors inspect Open Interpreter,--debugmode is highly verbose.You can activate debug mode by using it's flag (interpreter --debug), or mid-chat:$ interpreter
...
> %debug # <- Turns on debug modeConfiguration with .envOpen Interpreter allows you to set default behaviors using a .env file. This provides a flexible way to configure the interpreter without changing command-line arguments every time.Here's a sample .env configuration:INTERPRETER_CLI_AUTO_RUN=False
INTERPRETER_CLI_FAST_MODE=False
INTERPRETER_CLI_LOCAL_RUN=False
INTERPRETER_CLI_DEBUG=False
INTERPRETER_CLI_USE_AZURE=FalseINTERPRETER_CLI_AUTO_RUN: If set to True, the interpreter will execute code without user confirmation.INTERPRETER_CLI_FAST_MODE: If set to True, the interpreter will use gpt-3.5-turbo instead of gpt-4.INTERPRETER_CLI_LOCAL_RUN: If set to True, the interpreter will run fully locally with Code Llama.INTERPRETER_CLI_DEBUG: If set to True, the interpreter will print extra debugging information.INTERPRETER_CLI_USE_AZURE: If set to True, the interpreter will use Azure OpenAI Services.You can modify these values in the .env file to change the default behavior of the Open Interpreter.Safety NoticeSince 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 runinterpreter -yor setinterpreter.auto_run = Trueto 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 afunction-calling language modelwith anexec()function, which accepts alanguage(like "python" or "javascript") andcodeto run.We then stream the model's messages, code, and your system's outputs to the terminal as Markdown.ContributingThank you for your interest in contributing! We welcome involvement from the community.Please see ourContributing Guidelinesfor more details on how to get involved.LicenseOpen 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.Having access to a junior programmer working at the speed of your fingertips ... can make new workflows effortless and efficient, as well as open the benefits of programming to new audiences.—OpenAI's Code Interpreter Release