https://github.com/KillianLucas/open-interpreter Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} KillianLucas / open-interpreter Public * Notifications * Fork 2.8k * Star 32.6k OpenAI's Code Interpreter in your terminal, running locally openinterpreter.com/ License MIT license 32.6k stars 2.8k forks Activity Star Notifications * Code * Issues 115 * Pull requests 24 * Actions * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Wiki * Security * Insights KillianLucas/open-interpreter This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 8 branches 22 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/K] Use Git or checkout with SVN using the web URL. [gh repo clone Killia] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @KillianLucas KillianLucas vision for Windows ... a7b8dba Nov 12, 2023 `vision` for Windows a7b8dba Git stats * 901 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github Check for potential duplicates for Github issues November 1, 2023 00:26 docs Updated docs, removed errors in translated docs November 4, 2023 08:44 interpreter Expanded vision support November 11, 2023 02:26 tests Fixed file creation test November 5, 2023 00:14 .git-blame-ignore-revs chore: ignore second reformatting commit October 30, 2023 12:48 .gitignore Removed unecessary dependencies, moved yaspin to [safe], removed un... November 2, 2023 12:51 .pre-commit-config.yaml chore: add black, isort, and pre-commit October 30, 2023 12:38 CONTRIBUTING.md Merge pull request #699 from InterwebAlchemy/feature/ automated-format... October 31, 2023 21:46 LICENSE Generate. September 22, 2023 15:27 README.md vision for Windows November 12, 2023 13:25 poetry.lock Expanded vision support November 11, 2023 02:26 pyproject.toml Expanded vision support November 11, 2023 02:26 View code [ ] * Open Interpreter Demo An interactive demo is also available on Google Colab: Along with an example implementation of a voice interface (inspired by Her): Quick Start Terminal Python Comparison to ChatGPT's Code Interpreter Commands Interactive Chat Programmatic Chat Start a New Chat Save and Restore Chats Customize System Message Change your Language Model Running Open Interpreter locally Context Window, Max Tokens Debug mode Interactive Mode Commands Configuration Multiple Configuration Files CLI Example Python Example Sample FastAPI Server Safety Notice How Does it Work? Contributing License README.md * Open Interpreter Discord JA doc ZH doc IN doc License Let language models run code on your computer. An open-source, locally running implementation of OpenAI's Code Interpreter. Get early access to the desktop app | Read our new docs poster Update: * 0.1.12 supports --vision (experimental). pip install open-interpreter 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 Open.Interpreter.Demo.mp4 An interactive demo is also available on Google Colab: Open In Colab Along with an example implementation of a voice interface (inspired by Her): Open In Colab Quick Start pip install open-interpreter Terminal After installation, simply run interpreter: interpreter Python import interpreter interpreter.chat("Plot AAPL and META's normalized stock prices") # Executes a single command interpreter.chat() # Starts an interactive chat 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. * 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 in 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 Update: The Generator Update (0.1.5) introduced streaming: message = "What operating system are we on?" for chunk in interpreter.chat(message, display=False, stream=True): print(chunk) Interactive Chat To start an interactive chat in your terminal, either run interpreter from the command line: interpreter Or interpreter.chat() from a .py file: interpreter.chat() You can also stream each chunk: message = "What operating system are we on?" for chunk in interpreter.chat(message, display=False, stream=True): print(chunk) Programmatic Chat For 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 Chat In Python, Open Interpreter remembers conversation history. If you want to start fresh, you can reset it: interpreter.reset() Save and Restore Chats interpreter.chat() returns a List of messages, which can be used to resume a conversation with interpreter.messages = messages: messages = interpreter.chat("My name is Killian.") # Save messages to 'messages' interpreter.reset() # Reset interpreter ("Killian" will be forgotten) interpreter.messages = messages # Resume chat from 'messages' ("Killian" will be remembered) Customize System Message You 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 your Language Model Open Interpreter uses LiteLLM to connect to hosted language models. You can change the model by setting the model parameter: interpreter --model gpt-3.5-turbo interpreter --model claude-2 interpreter --model command-nightly In Python, set the model on the object: interpreter.model = "gpt-3.5-turbo" Find the appropriate "model" string for your language model here. Running Open Interpreter locally Open Interpreter uses LM Studio to connect to local language models (experimental). Simply run interpreter in local mode from the command line: interpreter --local You will need to run LM Studio in the background. 1. Download https://lmstudio.ai/ then start it. 2. Select a model then click | Download. 3. Click the -[?] button on the left (below ). 4. Select your model at the top, then click Start Server. Once the server is running, you can begin your conversation with Open Interpreter. (When you run the command interpreter --local, the steps above will be displayed.) Note: Local mode sets your context_window to 3000, and your max_tokens to 1000. If your model has different requirements, set these parameters manually (see below). Context Window, Max Tokens You can modify the max_tokens and context_window (in tokens) of locally running models. For local mode, smaller context windows will use less RAM, so we recommend trying a much shorter window (~1000) if it's is failing / if it's slow. Make sure max_tokens is less than context_window. interpreter --local --max_tokens 1000 --context_window 3000 Debug mode To help contributors inspect Open Interpreter, --debug mode is highly verbose. You can activate debug mode by using it's flag (interpreter --debug), or mid-chat: $ interpreter ... > %debug true <- Turns on debug mode > %debug false <- Turns off debug mode Interactive Mode Commands In the interactive mode, you can use the below commands to enhance your experience. Here's a list of available commands: Available Commands: * %debug [true/false]: Toggle debug mode. Without arguments or with true it enters debug mode. With false it exits debug mode. * %reset: Resets the current session's conversation. * %undo: Removes the previous user message and the AI's response from the message history. * %save_message [path]: Saves messages to a specified JSON path. If no path is provided, it defaults to messages.json. * %load_message [path]: Loads messages from a specified JSON path. If no path is provided, it defaults to messages.json. * %tokens [prompt]: (Experimental) Calculate the tokens that will be sent with the next prompt as context and estimate their cost. Optionally calculate the tokens and estimated cost of a prompt if one is provided. Relies on LiteLLM's cost_per_token() method for estimated costs. * %help: Show the help message. Configuration Open Interpreter allows you to set default behaviors using a config.yaml file. This provides a flexible way to configure the interpreter without changing command-line arguments every time. Run the following command to open the configuration file: interpreter --config Multiple Configuration Files Open Interpreter supports multiple config.yaml files, allowing you to easily switch between configurations via the --config_file argument. Note: --config_file accepts either a file name or a file path. File names will use the default configuration directory, while file paths will use the specified path. To create or edit a new configuration, run: interpreter --config --config_file $config_path To have Open Interpreter load a specific configuration file run: interpreter --config_file $config_path Note: Replace $config_path with the name of or path to your configuration file. CLI Example 1. Create a new config.turbo.yaml file interpreter --config --config_file config.turbo.yaml 2. Edit the config.turbo.yaml file to set model to gpt-3.5-turbo 3. Run Open Interpreter with the config.turbo.yaml configuration interpreter --config_file config.turbo.yaml Python Example You can also load configuration files when calling Open Interpreter from Python scripts: import os import interpreter currentPath = os.path.dirname(os.path.abspath(__file__)) config_path=os.path.join(currentPath, './config.test.yaml') interpreter.extend_config(config_path=config_path) message = "What operating system are we on?" for chunk in interpreter.chat(message, display=False, stream=True): print(chunk) Sample FastAPI Server The generator update enables Open Interpreter to be controlled via HTTP REST endpoints: # server.py from fastapi import FastAPI from fastapi.responses import StreamingResponse import interpreter app = FastAPI() @app.get("/chat") def chat_endpoint(message: str): def event_stream(): for result in interpreter.chat(message, stream=True): yield f"data: {result}\n\n" return StreamingResponse(event_stream(), media_type="text/event-stream") @app.get("/history") def history_endpoint(): return interpreter.messages pip install fastapi uvicorn uvicorn server:app --reload 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 of executing arbitrary code. There is experimental support for a safe mode to help mitigate some risks. 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 Thank you for your interest in contributing! We welcome involvement from the community. Please see our Contributing Guidelines for more details on how to get involved. 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. 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 About OpenAI's Code Interpreter in your terminal, running locally openinterpreter.com/ Topics python interpreter gpt-4 chatgpt llama2 codellama Resources Readme License MIT license Security policy Security policy Activity Stars 32.6k stars Watchers 253 watching Forks 2.8k forks Report repository Releases 22 tags Used by 111 * @supermario-ai * @supermario-ai * @ChatTutor * @Agora-X * @francescoai * @benjljohnson * @ryderwishart * @thaitran + 103 Contributors 58 * @KillianLucas * @ericrallen * @jordanbtucker * @Notnaton * @TanmayDoesAI * @oliverpalonkorp * @krrishdholakia * @thefazzer * @ihgalis * @codeacme17 * @CyanideByte + 47 contributors Languages * Python 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.