{"id":13493787,"url":"https://github.com/silvanmelchior/IncognitoPilot","last_synced_at":"2025-03-28T12:32:35.488Z","repository":{"id":184640609,"uuid":"666848277","full_name":"silvanmelchior/IncognitoPilot","owner":"silvanmelchior","description":"An AI code interpreter for sensitive data, powered by GPT-4 or Code Llama / Llama 2.","archived":false,"fork":false,"pushed_at":"2023-09-02T08:48:47.000Z","size":1361,"stargazers_count":429,"open_issues_count":24,"forks_count":44,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-10-30T00:52:06.088Z","etag":null,"topics":["ai","chatgpt","chatgpt-code-interpreter","codellama","copilot","gpt-4","llama2","llm","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silvanmelchior.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T19:27:44.000Z","updated_at":"2024-10-25T17:57:26.000Z","dependencies_parsed_at":"2024-07-25T17:12:16.213Z","dependency_job_id":null,"html_url":"https://github.com/silvanmelchior/IncognitoPilot","commit_stats":null,"previous_names":["silvanmelchior/incognitopilot"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanmelchior%2FIncognitoPilot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanmelchior%2FIncognitoPilot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanmelchior%2FIncognitoPilot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silvanmelchior%2FIncognitoPilot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silvanmelchior","download_url":"https://codeload.github.com/silvanmelchior/IncognitoPilot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222382339,"owners_count":16975376,"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":["ai","chatgpt","chatgpt-code-interpreter","codellama","copilot","gpt-4","llama2","llm","python"],"created_at":"2024-07-31T19:01:18.806Z","updated_at":"2024-10-31T08:31:16.399Z","avatar_url":"https://github.com/silvanmelchior.png","language":"Python","funding_links":[],"categories":["Python","AI-Powered Developer Tools","Assistants","Web-Based Tools","📚 Tools"],"sub_categories":["Assistants","Web-based","CLI Utilities","🌟 What You'll Find Here:"],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/silvanmelchior/IncognitoPilot/blob/main/docs/title.png\" alt=\"logo\" style=\"width: 75%\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cem\u003eAn AI code interpreter for sensitive data, powered by GPT-4 or Code Llama / Llama 2.\u003c/em\u003e\u003c/p\u003e\n\n**Incognito Pilot** combines a Large Language Model (LLM) with a Python interpreter, so it can run code and execute tasks for you.\nIt is similar to **ChatGPT Code Interpreter**, but the interpreter runs **locally** and it can use open-source models like **Code Llama / Llama 2**.\n\n**Incognito Pilot** allows you to work with **sensitive data** without uploading it to the cloud.\nEither you use a local LLM (like Llama 2), or an API (like GPT-4).\nFor the latter case, there is an **approval mechanism** in the UI, which separates your local data from the remote services.\n\nWith **Incognito Pilot**, you can:\n- :white_check_mark: analyse data and create visualizations\n- :white_check_mark: convert your files, e.g. a video to a gif\n- :white_check_mark: **access the internet** to e.g. download data\n\nand much more!\n\n## :bulb: Demo\n\nhttps://github.com/silvanmelchior/IncognitoPilot/assets/6033305/05b0a874-6f76-4d22-afca-36c11f90b1ff\n\nThe video shows Incognito Pilot with GPT-4.\nWhile your conversation and approved code results are sent to OpenAI's API, your **data is kept locally** on your machine.\nThe interpreter is running locally as well and processes your data right there.\nAnd you can go even further and use Code Llama / Llama 2 to have everything running on your machine.\n\n## :package: Installation (GPT via OpenAI API)\n\nThis section shows how to install **Incognito Pilot** using a GPT model via OpenAI's API. For\n\n- **Code Llama / Llama 2**, check [Installation for Llama 2](/docs/INSTALLATION_LLAMA.md) instead, and for\n- **GPT on Azure**, check [Installation with Azure](/docs/INSTALLATION_AZURE.md) instead.\n- If you don't have docker, you can install **Incognito Pilot** on your system directly, using the development setup (see below).\n\nFollow these steps:\n\n1. Install [docker](https://www.docker.com/).\n2. Create an empty folder somewhere on your system.\n   This will be the working directory to which **Incognito Pilot** has access to.\n   The code interpreter can read your files in this folder and store any results.\n   In the following, we assume it to be */home/user/ipilot*.\n3. Create an [OpenAI account](https://platform.openai.com),\n   add a [credit card](https://platform.openai.com/account/billing/payment-methods)\n   and create an [API key](https://platform.openai.com/account/api-keys).\n4. Now, just run the following command (replace your working directory and API key):\n\n```shell\ndocker run -i -t \\\n  -p 3030:80 \\\n  -e OPENAI_API_KEY=\"sk-your-api-key\" \\\n  -e ALLOWED_HOSTS=\"localhost:3030\" \\\n  -v /home/user/ipilot:/mnt/data \\\n  silvanmelchior/incognito-pilot:latest-slim\n```\n\nIn the console, you should now see a URL.\nOpen it, and you should see the **Incognito Pilot** interface.\n\nIt's also possible to run **Incognito Pilot** with the free trial credits of OpenAI, without adding a credit card.\nAt the moment, this does not include GPT-4 however, so see below how to change the model to GPT-3.5.\n\n## :rocket: Getting started (GPT)\n\nIn the **Incognito Pilot** interface, you will see a chat interface, with which you can interact with the model.\nLet's try it out!\n\n1. **Greetings**: Type \"Hi\" and see how the model responds to you.\n2. **Hello World**: Type \"Print a hello world message for me\".\n   You will see how the *Code* part of the UI shows you a Python snippet.\n   As soon as you approve, the code will be executed on your machine (within the docker container).\n   You will see the result in the *Result* part of the UI.\n   As soon as you approve it, it will be sent back to the model.\n   In the case of using an API like here OpenAI's GPT models, this of course also means that this result will be sent to their services.\n3. **File Access**: Type \"Create a text file with all numbers from 0 to 100\".\n   After the approval, the model will confirm you the execution.\n   Check your working directory now (e.g. */home/user/ipilot*): You should see the file!\n\nNow you should be ready to use **Incognito Pilot** for your own tasks. Just remember:\n- Everything you type or every code result you approve is sent to the OpenAI / Azure API\n- Your data stays and is processed locally\n\nOne more thing: The version you just used has nearly no packages shipped with the Python interpreter.\nThis means, things like reading images or Excel files will not work.\nTo change this, head back to the console and press Ctrl-C to stop the container.\nNow re-run the command, but remove the `-slim` suffix from the image.\nThis will download a much larger version, equipped with [many packages](/docker/requirements_full.txt).\n\n### Change model\n\nTo use another model than the default one (GPT-4), set the environment variable `LLM`.\nOpenAI's GPT models have the prefix `gpt:`, so to use GPT-3.5 for example (the original ChatGPT), add the following to the docker run command:\n\n```shell\n-e LLM=\"gpt-openai:gpt-3.5-turbo\"\n```\n\nPlease note that GPT-4 is considerably better in the interpreter setup than GPT-3.5.\n\n## :gear: Settings\n\n### Change port\n\nTo serve the UI at a different port than 3030, you can expose the internal port 80 to a different one, for example 8080.\nYou should also change the allowed host variable in this case:\n\n```shell\ndocker run -i -t \\\n  -p 8080:80 \\\n  -e ALLOWED_HOSTS=\"localhost:8080\" \\\n  ... \\\n  silvanmelchior/incognito-pilot\n```\n\n### Authentication\n\nPer default, the authentication token, which is part of the URL you open, is randomly generated at startup.\nThis means, whenever you restart the container, you need to re-copy the URL.\nIf you want to prevent this, you can also fix the token to a certain value, by adding the following to the docker run command:\n\n```shell\n  -e AUTH_TOKEN=\"some-secret-token\" \n```\n\nOnce you opened the URL with the new token, the browser will remember it.\nThus, from now on, you can access **Incognito Pilot** by just opening http://localhost:3030, without having to add a token to the URL.\n\n### Timeout\n\nPer default, the Python interpreter stops after 30 seconds.\nTo change this, set the environment variable `INTERPRETER_TIMEOUT`.\nFor 2 minutes for example, add the following to the docker run command:\n\n```shell\n-e INTERPRETER_TIMEOUT=\"120\"\n```\n\n### Autostart\n\nTo automatically start **Incognito Pilot** with docker / at startup, remove the `-i -t` from the run command and add the following:\n\n```shell\n--restart always\n```\n\nTogether with a bookmark of the UI URL, you'll have **Incognito Pilot** at your fingertips whenever you need it.\nAlternatively, you can use docker-compose.\n\n## :toolbox: Own dependencies\n\nNot happy with the pre-installed packages of the full (aka non-slim) version?\nWant to add more Python (or Debian) packages to the interpreter?\n\nYou can easily containerize your own dependencies with **Incognito Pilot**.\nTo do so, create a Dockerfile like this:\n\n```dockerfile\nFROM silvanmelchior/incognito-pilot:latest-slim\nSHELL [\"/bin/bash\", \"-c\"]\n\n# uncomment the following line, if you want to install more packages\n# RUN apt update \u0026\u0026 apt install -y some-package\n\nWORKDIR /opt/app\n\nCOPY requirements.txt .\n\nRUN source venv_interpreter/bin/activate \u0026\u0026 \\\n    pip3 install -r requirements.txt\n```\n\nPut your dependencies into a *requirements.txt* file and run the following command:\n\n```shell\ndocker build --tag incognito-pilot-custom .\n```\n\nThen run the container like this:\n\n```shell\ndocker run -i -t \\\n  ... \\\n  incognito-pilot-custom\n```\n\n## :question: FAQs\n\n### Is it as good as ChatGPT Code Interpreter?\n\nNo, it has its limits.\nThe tradeoff between privacy and capabilities is not an easy one in this case.\nFor things like images, it is as powerful as ChatGPT code interpreter, because it doesn't need to know about the content of the image to edit it.\nBut for things like spreadsheets, if ChatGPT doesn't see the content, it has to guess for example the data format from the header, which can go wrong.\n\nHowever, in certain aspects, it's even better than ChatGPT code interpreter:\nThe interpreter has internet access, allowing for a bunch of new tasks which were not possible before.\nAlso, you can run the interpreter on any machine, including very powerful ones, so you can solve much larger tasks than with ChatGPT code interpreter.\n\n### Why not just use ChatGPT to generate the code and run it myself?\n\nYou can of course do this. There are quite some advantages of using **Incognito Pilot** however:\n\n- Incognito Pilot can run code in multiple rounds (e.g. first getting the file name of a csv, then the structure, and then analyze the content).\n  It can even correct itself, seeing the stack trace of its failed execution.\n  You can of course also copy back and forth code and result to achieve all of this manually, but it gets cumbersome quite quickly.\n- You have tons of pre-installed dependencies in Incognito Pilot\n- The code runs in a sandbox, protecting your computer\n\n### How can it be private if you use public cloud APIs?\n\nWhatever you type and all code results you approve are indeed not private, in the sense that they are sent to the cloud API.\nYour data however stays local.\nThe interpreter runs locally as well, processing your data right where it is.\nFor certain things, you will have to tell the model something about your data (e.g. the file-name of structure),\nbut it usually is meta-data which you actively approve in the UI and not the actual data.\nAt every step in the execution, you can just reject that something is sent to the API.\n\n## :house: Architecture\n\n![Architecture Diagram](/docs/architecture.png)\n\n## :wrench: Development\n\nWant to contribute to **Incognito Pilot**?\nOr just install it without docker?\nCheck out the contribution [instruction \u0026 guidelines](/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilvanmelchior%2FIncognitoPilot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilvanmelchior%2FIncognitoPilot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilvanmelchior%2FIncognitoPilot/lists"}