{"id":13410384,"url":"https://github.com/OpenInterpreter/open-interpreter","last_synced_at":"2025-03-14T16:32:13.690Z","repository":{"id":182407930,"uuid":"666299222","full_name":"OpenInterpreter/open-interpreter","owner":"OpenInterpreter","description":"A natural language interface for computers","archived":false,"fork":false,"pushed_at":"2024-05-28T17:33:14.000Z","size":92293,"stargazers_count":49322,"open_issues_count":159,"forks_count":4308,"subscribers_count":368,"default_branch":"main","last_synced_at":"2024-05-29T09:25:44.705Z","etag":null,"topics":["chatgpt","gpt-4","interpreter","javascript","nodejs","python"],"latest_commit_sha":null,"homepage":"http://openinterpreter.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenInterpreter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-14T07:10:44.000Z","updated_at":"2024-05-31T21:24:46.910Z","dependencies_parsed_at":"2023-09-27T02:15:25.564Z","dependency_job_id":"8d8dd768-7685-4b52-aaa7-ae105ce2b304","html_url":"https://github.com/OpenInterpreter/open-interpreter","commit_stats":null,"previous_names":["killianlucas/open-interpreter","openinterpreter/open-interpreter"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenInterpreter%2Fopen-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenInterpreter%2Fopen-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenInterpreter%2Fopen-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenInterpreter%2Fopen-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenInterpreter","download_url":"https://codeload.github.com/OpenInterpreter/open-interpreter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243610211,"owners_count":20318921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatgpt","gpt-4","interpreter","javascript","nodejs","python"],"created_at":"2024-07-30T20:01:06.563Z","updated_at":"2025-03-14T16:32:13.630Z","avatar_url":"https://github.com/OpenInterpreter.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003e● Open Interpreter\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://discord.gg/Hvz9Axh84z\"\u003e\n        \u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/1146610656779440188?logo=discord\u0026style=flat\u0026logoColor=white\"/\u003e\u003c/a\u003e\n    \u003ca href=\"docs/README_JA.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/ドキュメント-日本語-white.svg\" alt=\"JA doc\"/\u003e\u003c/a\u003e\n    \u003ca href=\"docs/README_ZH.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/文档-中文版-white.svg\" alt=\"ZH doc\"/\u003e\u003c/a\u003e\n    \u003ca href=\"docs/README_ES.md\"\u003e \u003cimg src=\"https://img.shields.io/badge/Español-white.svg\" alt=\"ES doc\"/\u003e\u003c/a\u003e\n    \u003ca href=\"docs/README_UK.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/Українська-white.svg\" alt=\"UK doc\"/\u003e\u003c/a\u003e\n    \u003ca href=\"docs/README_IN.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/Hindi-white.svg\" alt=\"IN doc\"/\u003e\u003c/a\u003e\n    \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=license\u0026message=AGPL\u0026color=white\u0026style=flat\" alt=\"License\"/\u003e\u003c/a\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\u003ca href=\"https://0ggfznkwh4j.typeform.com/to/G21i9lJ2\"\u003eGet early access to the desktop app\u003c/a\u003e‎ ‎ |‎ ‎ \u003ca href=\"https://docs.openinterpreter.com/\"\u003eDocumentation\u003c/a\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n\u003e [!NOTE]\n\u003e **Open Interpreter 1.0** is almost here.\n\u003e\n\u003e Please help test the [development branch](https://github.com/OpenInterpreter/open-interpreter/tree/development) and share your experience in the [Discord](https://discord.gg/Hvz9Axh84z):\n\u003e ```\n\u003e pip install git+https://github.com/OpenInterpreter/open-interpreter.git@development\n\u003e interpreter --help\n\u003e ```\n\n\u003cbr\u003e\n\n\u003cimg alt=\"local_explorer\" src=\"https://github.com/OpenInterpreter/open-interpreter/assets/63927363/d941c3b4-b5ad-4642-992c-40edf31e2e7a\"\u003e\n\n\u003cbr\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n```shell\npip install open-interpreter\n```\n\n\u003e Not working? Read our [setup guide](https://docs.openinterpreter.com/getting-started/setup).\n\n```shell\ninterpreter\n```\n\n\u003cbr\u003e\n\n**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.\n\nThis provides a natural-language interface to your computer's general-purpose capabilities:\n\n- Create and edit photos, videos, PDFs, etc.\n- Control a Chrome browser to perform research\n- Plot, clean, and analyze large datasets\n- ...etc.\n\n**⚠️ Note: You'll be asked to approve code before it's run.**\n\n\u003cbr\u003e\n\n## Demo\n\nhttps://github.com/OpenInterpreter/open-interpreter/assets/63927363/37152071-680d-4423-9af3-64836a6f7b60\n\n#### An interactive demo is also available on Google Colab:\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1WKmRXZgsErej2xUriKzxrEAXdxMSgWbb?usp=sharing)\n\n#### Along with an example voice interface, inspired by _Her_:\n\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1NojYGHDgxH6Y1G1oxThEBBb2AtyODBIK)\n\n## Quick Start\n\n```shell\npip install open-interpreter\n```\n\n### Terminal\n\nAfter installation, simply run `interpreter`:\n\n```shell\ninterpreter\n```\n\n### Python\n\n```python\nfrom interpreter import interpreter\n\ninterpreter.chat(\"Plot AAPL and META's normalized stock prices\") # Executes a single command\ninterpreter.chat() # Starts an interactive chat\n```\n\n### GitHub Codespaces\n\nPress the `,` key on this repository's GitHub page to create a codespace. After a moment, you'll receive a cloud virtual machine environment pre-installed with open-interpreter. You can then start interacting with it directly and freely confirm its execution of system commands without worrying about damaging the system.\n\n## Comparison to ChatGPT's Code Interpreter\n\nOpenAI's release of [Code Interpreter](https://openai.com/blog/chatgpt-plugins#code-interpreter) with GPT-4 presents a fantastic opportunity to accomplish real-world tasks with ChatGPT.\n\nHowever, OpenAI's service is hosted, closed-source, and heavily restricted:\n\n- No internet access.\n- [Limited set of pre-installed packages](https://wfhbrian.com/mastering-chatgpts-code-interpreter-list-of-python-packages/).\n- 100 MB maximum upload, 120.0 second runtime limit.\n- State is cleared (along with any generated files or links) when the environment dies.\n\n---\n\nOpen 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.\n\nThis combines the power of GPT-4's Code Interpreter with the flexibility of your local development environment.\n\n## Commands\n\n**Update:** The Generator Update (0.1.5) introduced streaming:\n\n```python\nmessage = \"What operating system are we on?\"\n\nfor chunk in interpreter.chat(message, display=False, stream=True):\n  print(chunk)\n```\n\n### Interactive Chat\n\nTo start an interactive chat in your terminal, either run `interpreter` from the command line:\n\n```shell\ninterpreter\n```\n\nOr `interpreter.chat()` from a .py file:\n\n```python\ninterpreter.chat()\n```\n\n**You can also stream each chunk:**\n\n```python\nmessage = \"What operating system are we on?\"\n\nfor chunk in interpreter.chat(message, display=False, stream=True):\n  print(chunk)\n```\n\n### Programmatic Chat\n\nFor more precise control, you can pass messages directly to `.chat(message)`:\n\n```python\ninterpreter.chat(\"Add subtitles to all videos in /videos.\")\n\n# ... Streams output to your terminal, completes task ...\n\ninterpreter.chat(\"These look great but can you make the subtitles bigger?\")\n\n# ...\n```\n\n### Start a New Chat\n\nIn Python, Open Interpreter remembers conversation history. If you want to start fresh, you can reset it:\n\n```python\ninterpreter.messages = []\n```\n\n### Save and Restore Chats\n\n`interpreter.chat()` returns a List of messages, which can be used to resume a conversation with `interpreter.messages = messages`:\n\n```python\nmessages = interpreter.chat(\"My name is Killian.\") # Save messages to 'messages'\ninterpreter.messages = [] # Reset interpreter (\"Killian\" will be forgotten)\n\ninterpreter.messages = messages # Resume chat from 'messages' (\"Killian\" will be remembered)\n```\n\n### Customize System Message\n\nYou can inspect and configure Open Interpreter's system message to extend its functionality, modify permissions, or give it more context.\n\n```python\ninterpreter.system_message += \"\"\"\nRun shell commands with -y so the user doesn't have to confirm them.\n\"\"\"\nprint(interpreter.system_message)\n```\n\n### Change your Language Model\n\nOpen Interpreter uses [LiteLLM](https://docs.litellm.ai/docs/providers/) to connect to hosted language models.\n\nYou can change the model by setting the model parameter:\n\n```shell\ninterpreter --model gpt-3.5-turbo\ninterpreter --model claude-2\ninterpreter --model command-nightly\n```\n\nIn Python, set the model on the object:\n\n```python\ninterpreter.llm.model = \"gpt-3.5-turbo\"\n```\n\n[Find the appropriate \"model\" string for your language model here.](https://docs.litellm.ai/docs/providers/)\n\n### Running Open Interpreter locally\n\n#### Terminal\n\nOpen Interpreter can use OpenAI-compatible server to run models locally. (LM Studio, jan.ai, ollama etc)\n\nSimply run `interpreter` with the api_base URL of your inference server (for LM studio it is `http://localhost:1234/v1` by default):\n\n```shell\ninterpreter --api_base \"http://localhost:1234/v1\" --api_key \"fake_key\"\n```\n\nAlternatively you can use Llamafile without installing any third party software just by running\n\n```shell\ninterpreter --local\n```\n\nfor a more detailed guide check out [this video by Mike Bird](https://www.youtube.com/watch?v=CEs51hGWuGU?si=cN7f6QhfT4edfG5H)\n\n**How to run LM Studio in the background.**\n\n1. Download [https://lmstudio.ai/](https://lmstudio.ai/) then start it.\n2. Select a model then click **↓ Download**.\n3. Click the **↔️** button on the left (below 💬).\n4. Select your model at the top, then click **Start Server**.\n\nOnce the server is running, you can begin your conversation with Open Interpreter.\n\n\u003e **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).\n\n#### Python\n\nOur Python package gives you more control over each setting. To replicate and connect to LM Studio, use these settings:\n\n```python\nfrom interpreter import interpreter\n\ninterpreter.offline = True # Disables online features like Open Procedures\ninterpreter.llm.model = \"openai/x\" # Tells OI to send messages in OpenAI's format\ninterpreter.llm.api_key = \"fake_key\" # LiteLLM, which we use to talk to LM Studio, requires this\ninterpreter.llm.api_base = \"http://localhost:1234/v1\" # Point this at any OpenAI compatible server\n\ninterpreter.chat()\n```\n\n#### Context Window, Max Tokens\n\nYou can modify the `max_tokens` and `context_window` (in tokens) of locally running models.\n\nFor local mode, smaller context windows will use less RAM, so we recommend trying a much shorter window (~1000) if it's failing / if it's slow. Make sure `max_tokens` is less than `context_window`.\n\n```shell\ninterpreter --local --max_tokens 1000 --context_window 3000\n```\n\n### Verbose mode\n\nTo help you inspect Open Interpreter we have a `--verbose` mode for debugging.\n\nYou can activate verbose mode by using its flag (`interpreter --verbose`), or mid-chat:\n\n```shell\n$ interpreter\n...\n\u003e %verbose true \u003c- Turns on verbose mode\n\n\u003e %verbose false \u003c- Turns off verbose mode\n```\n\n### Interactive Mode Commands\n\nIn the interactive mode, you can use the below commands to enhance your experience. Here's a list of available commands:\n\n**Available Commands:**\n\n- `%verbose [true/false]`: Toggle verbose mode. Without arguments or with `true` it\n  enters verbose mode. With `false` it exits verbose mode.\n- `%reset`: Resets the current session's conversation.\n- `%undo`: Removes the previous user message and the AI's response from the message history.\n- `%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](https://docs.litellm.ai/docs/completion/token_usage#2-cost_per_token) for estimated costs.\n- `%help`: Show the help message.\n\n### Configuration / Profiles\n\nOpen Interpreter allows you to set default behaviors using `yaml` files.\n\nThis provides a flexible way to configure the interpreter without changing command-line arguments every time.\n\nRun the following command to open the profiles directory:\n\n```\ninterpreter --profiles\n```\n\nYou can add `yaml` files there. The default profile is named `default.yaml`.\n\n#### Multiple Profiles\n\nOpen Interpreter supports multiple `yaml` files, allowing you to easily switch between configurations:\n\n```\ninterpreter --profile my_profile.yaml\n```\n\n## Sample FastAPI Server\n\nThe generator update enables Open Interpreter to be controlled via HTTP REST endpoints:\n\n```python\n# server.py\n\nfrom fastapi import FastAPI\nfrom fastapi.responses import StreamingResponse\nfrom interpreter import interpreter\n\napp = FastAPI()\n\n@app.get(\"/chat\")\ndef chat_endpoint(message: str):\n    def event_stream():\n        for result in interpreter.chat(message, stream=True):\n            yield f\"data: {result}\\n\\n\"\n\n    return StreamingResponse(event_stream(), media_type=\"text/event-stream\")\n\n@app.get(\"/history\")\ndef history_endpoint():\n    return interpreter.messages\n```\n\n```shell\npip install fastapi uvicorn\nuvicorn server:app --reload\n```\n\nYou can also start a server identical to the one above by simply running `interpreter.server()`.\n\n## Android\n\nThe step-by-step guide for installing Open Interpreter on your Android device can be found in the [open-interpreter-termux repo](https://github.com/MikeBirdTech/open-interpreter-termux).\n\n## Safety Notice\n\nSince 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.\n\n**⚠️ Open Interpreter will ask for user confirmation before executing code.**\n\nYou can run `interpreter -y` or set `interpreter.auto_run = True` to bypass this confirmation, in which case:\n\n- Be cautious when requesting commands that modify files or system settings.\n- Watch Open Interpreter like a self-driving car, and be prepared to end the process by closing your terminal.\n- 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.\n\nThere is **experimental** support for a [safe mode](https://github.com/OpenInterpreter/open-interpreter/blob/main/docs/SAFE_MODE.md) to help mitigate some risks.\n\n## How Does it Work?\n\nOpen Interpreter equips a [function-calling language model](https://platform.openai.com/docs/guides/gpt/function-calling) with an `exec()` function, which accepts a `language` (like \"Python\" or \"JavaScript\") and `code` to run.\n\nWe then stream the model's messages, code, and your system's outputs to the terminal as Markdown.\n\n# Access Documentation Offline\n\nThe full [documentation](https://docs.openinterpreter.com/) is accessible on-the-go without the need for an internet connection.\n\n[Node](https://nodejs.org/en) is a pre-requisite:\n\n- Version 18.17.0 or any later 18.x.x version.\n- Version 20.3.0 or any later 20.x.x version.\n- Any version starting from 21.0.0 onwards, with no upper limit specified.\n\nInstall [Mintlify](https://mintlify.com/):\n\n```bash\nnpm i -g mintlify@latest\n```\n\nChange into the docs directory and run the appropriate command:\n\n```bash\n# Assuming you're at the project's root directory\ncd ./docs\n\n# Run the documentation server\nmintlify dev\n```\n\nA new browser window should open. The documentation will be available at [http://localhost:3000](http://localhost:3000) as long as the documentation server is running.\n\n# Contributing\n\nThank you for your interest in contributing! We welcome involvement from the community.\n\nPlease see our [contributing guidelines](https://github.com/OpenInterpreter/open-interpreter/blob/main/docs/CONTRIBUTING.md) for more details on how to get involved.\n\n# Roadmap\n\nVisit [our roadmap](https://github.com/OpenInterpreter/open-interpreter/blob/main/docs/ROADMAP.md) to preview the future of Open Interpreter.\n\n**Note**: This software is not affiliated with OpenAI.\n\n![thumbnail-ncu](https://github.com/OpenInterpreter/open-interpreter/assets/63927363/1b19a5db-b486-41fd-a7a1-fe2028031686)\n\n\u003e 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.\n\u003e\n\u003e — _OpenAI's Code Interpreter Release_\n\n\u003cbr\u003e\n","funding_links":[],"categories":["Alternatives \u0026 Comparisons","Coding","Python","\u003cimg src=\"./assets/satellite.svg\" width=\"16\" height=\"16\" style=\"vertical-align: middle;\"\u003e Satellites","Projects","Projects and Implementations","HarmonyOS","Related Projects","推理 Inference","Complete solutions","Community Projects","Learning","Generative KI","5. Computer Use Agents (CUA)","Repos","python","Developer Tools","Table of Open-Source AI Agents Projects","Open Source Agents","Task Automation \u0026 Workflow Orchestration","Open Source Tools","Tools","UIs","Table of Contents"],"sub_categories":["Miscellaneous","Coding Assistants","💻 Terminal","Windows Manager","AI Assistants","Operating system","Open Source","Frameworks \u0026 Models","Repositories","4.3 Tree Search + Web Agents","Frameworks \u0026 Tools","Inventory Automation Agents","Agent Memory \u0026 Context","Computer Use","Command-line(shell) interface","Agent"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenInterpreter%2Fopen-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenInterpreter%2Fopen-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenInterpreter%2Fopen-interpreter/lists"}