{"id":13643465,"url":"https://github.com/iamgreggarcia/codesherpa","last_synced_at":"2025-04-21T01:32:44.025Z","repository":{"id":162764450,"uuid":"637255415","full_name":"iamgreggarcia/codesherpa","owner":"iamgreggarcia","description":"A code interpreter and ChatGPT plugin.","archived":false,"fork":false,"pushed_at":"2023-08-12T00:44:49.000Z","size":18606,"stargazers_count":256,"open_issues_count":9,"forks_count":33,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-14T08:19:29.015Z","etag":null,"topics":["chatgpt-plugin","code-interpreter","fastapi","gpt-4","gpt-4-0613","nextjs","python"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/iamgreggarcia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-05-07T01:36:43.000Z","updated_at":"2025-03-15T07:26:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"a2183de4-e793-4bd1-b22e-ac1b56960dfd","html_url":"https://github.com/iamgreggarcia/codesherpa","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamgreggarcia%2Fcodesherpa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamgreggarcia%2Fcodesherpa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamgreggarcia%2Fcodesherpa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamgreggarcia%2Fcodesherpa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamgreggarcia","download_url":"https://codeload.github.com/iamgreggarcia/codesherpa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982641,"owners_count":21355735,"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-plugin","code-interpreter","fastapi","gpt-4","gpt-4-0613","nextjs","python"],"created_at":"2024-08-02T01:01:47.974Z","updated_at":"2025-04-21T01:32:42.685Z","avatar_url":"https://github.com/iamgreggarcia.png","language":"TypeScript","funding_links":[],"categories":["Browser-extensions"],"sub_categories":[],"readme":"# codesherpa\n\n**codesherpa** is a code interpreter **ChatGPT plugin** and a **standalone** code interpreter (_**experimental**_). Read the [Quickstart section](#quickstart) to try it out.\n\n### You can use it as a\n\n- code interpreter plugin with ChatGPT\n  - API for ChatGPT to run and execute code with file persistance and no timeout \n- standalone code interpreter (_**experimental**_). \n  - Using OpenAI's [GPT function calling](https://platform.openai.com/docs/guides/gpt/function-calling), I've tried to recreate the experience of the ChatGPT Code Interpreter by using `functions`. For many reasons, there is a significant difference between this implementation and the ChatGPT Code Interpreter created by OpenAI. It's still very buggy and inconsistent, but I wanted to release it for those interested.\n\n\nStandalone code interpreter demo:\n\n\n\nhttps://github.com/iamgreggarcia/codesherpa/assets/16596972/96cb0694-fec6-4046-99d6-2e141b2a853f\n\n\n\n\n\nChatGPT Plugin demo:\n\nhttps://github.com/iamgreggarcia/codesherpa/assets/16596972/b7afb034-6b74-42a3-9496-a912bcaf0f66\n\n\nSee more [examples here](#examples)\n\n\n## Recent Updates\n\n- **July 13, 2023**: \n  - A basic standalone UI is now available. Read the [Quickstart section](#quickstart) to try it (requires an OpenAI API key). _NOTE_: expect **many** bugs and shortcomings, especially if you've been binging OpenAI's Code Interpreter since its been made generally available to Plus subscribers\n  - New contributions from [emsi](https://github.com/emsi) [(#18)]([Title](https://github.com/iamgreggarcia/codesherpa/pull/18)) and [PeterDaveHello](https://github.com/PeterDaveHello) [(#28)](https://github.com/iamgreggarcia/codesherpa/pull/28)! 👏\n- **June 21, 2023**: \n    - The ChatGPT plugin service will now fetch the `openapi.json` generated be the server. Also added [request example data](https://fastapi.tiangolo.com/tutorial/schema-extra-example/) which is included in the api spec. This reduces the size of the plugin manifest `description_for_model`.\n    - Updated the README section on future work. \n\u003cdetails\u003e\n\u003csummary\u003ePrevious Updates\u003c/summary\u003e\n\n- **June 18, 2023**: Added `docker-compose.yml`\n- **May 31, 2023**: Introduced new file upload interface via `upload.html` and corresponding server endpoint, allowing you to upload files at `localhost:3333/upload` or by telling ChatGPT you want to upload a file or have a file you want to work with: ![upload-demo](https://github.com/iamgreggarcia/codesherpa/assets/16596972/bb1bcadf-7152-44fb-becb-f571094cbf56) Refactored Python code execution using `ast` module for enhanced efficiency. Local server and manifest file updates to support these features. Minor updates to REPL execution, error handling, and code formatting.\n- **May 22, 2023**: Refactored README to provide clear and concise instructions for building and running codesherpa.\n- **May 20, 2023**: codesherpa now supports multiple programming languages, including Python, C++, and Rust.\n\n\u003c/details\u003e\n\n## Quickstart\n\n### NEW: Standalone code interpreter (experimental)\n\nTo try the new chat interface:\n\n```bash\n# Clone the repository\ngit clone https://github.com/iamgreggarcia/codesherpa.git\n```\nAdd your `OPENAI_API_KEY` to a copy of `.env.example`:\n```bash\ncd codesherpa/frontend\ncp .env.example .env.local\n```\n\nInstall dependencies and startup the Next.js app:\n```bash\npnpm install\npnpm dev\n```\nOR\n\n```bash\nnpm install\nnpm run dev\n```\nDownload the docker image OR run the codesherpa API locally (beware!):\n\nDocker image:\n```bash\n# Pull the Docker image\ndocker pull ghcr.io/iamgreggarcia/codesherpa:latest\n\n# Run the Docker image locally\ndocker compose up\n```\n\nRun the server locally (potentially risky!):\n```bash\ncd codesherpa\nmake dev\n```\n\nNavigate to `http://localhost:3000`. Expect bugs and inconsistencies.\n\n### Installation and Running codesherpa as a ChatGPT Plugin\n\n### Prerequisites\n\nEnsure the following software is installed on your system:\n\n- Python 3.10\n- Docker\n- Docker Compose (optional). Download Docker Desktop or the plugin to use Docker Compose\n    - Pluin:\n      - [Linux](https://docs.docker.com/compose/install/#scenario-two-install-the-compose-plugin)\n    - Desktop:\n      - [Linux](https://docs.docker.com/desktop/install/linux-install/)\n      - [Mac](https://docs.docker.com/desktop/install/mac-install/)\n      - [Windows](https://docs.docker.com/desktop/install/windows-install/)\n\n\n**Option 1: Using Docker image from Github Packages**\n\n```bash\n# Pull the Docker image\ndocker pull ghcr.io/iamgreggarcia/codesherpa:latest\n\n# Run the Docker image locally\ndocker compose up\n```\n\n**Option 2: Using the repository and Make commands**\n\n```bash\n# Clone the repository\ngit clone https://github.com/iamgreggarcia/codesherpa.git\n\n# Navigate to the repository directory\ncd codesherpa\n\n# Build the Docker image using Make\nmake build-docker\n\n# Run the Docker image locally\nmake run-docker-localserver\n```\n\n**Option 3: Using the repository and Docker commands**\n\nInstead of Make commands, you can use the following Docker commands directly or use Docker Compose\n\n```bash\n# Clone the repository\ngit clone https://github.com/iamgreggarcia/codesherpa.git\n\n# Navigate to the repository directory\ncd codesherpa\n\n# Build the Docker image\ndocker build -t codesherpa .\n\n# Run the Docker image locally\ndocker run -p 3333:3333 codesherpa python3 -c \"import localserver.main; localserver.main.start()\"\n\n# OR use Docker Compose\n\ndocker compose up\n```\n\nWhichever option you choose, codesherpa will be accessible at [localhost:3333](http://localhost:3333).\n\n### Connecting codesherpa to ChatGPT\n\n1. Navigate to the ChatGPT UI, and access the plugin store.\n2. Select \"Develop your own plugin\".\n3. In the plugin URL input, enter `localhost:3333`. Your ChatGPT should now be able to use codesherpa's features.\n\n\n## Examples\n\nBelow are some examples. Please note that portions of these videos are edited and/or sped up for brevity.\n\n### Ploting a vector field on a sphere creating an animated gif (short):\nhttps://github.com/iamgreggarcia/codesherpa/assets/16596972/a42d717c-a996-4622-a5d1-139466cad233\n\n### Demo of the Demo: Recreating the ChatGPT Code Interpreter Video Demo\nMost of us have seen the [ChatGPT Code Interpreter Video Demo](https://openai.com/blog/chatgpt-plugins#code-interpreter), which is the inspiration for this project. So I thought it fitting to ask similar questions as those in the OpenAI video demo.\n\n- Asking about properties of the function `1/sin(x)`:\n\n\nhttps://github.com/iamgreggarcia/codesherpa/assets/16596972/111e7e25-a5b0-4d7e-9ffb-dee5e844cafd\n\n\n- Uploading a [music.csv](https://corgis-edu.github.io/corgis/csv/music/) dataset for analysis and visualization. [View the ChatGPT conversation](https://chat.openai.com/share/ee480269-ee72-4104-a1fa-2f11e881055b)\n\n\n\nhttps://github.com/iamgreggarcia/codesherpa/assets/16596972/5e9a3b6a-b004-434b-aaba-715d7d53e54d\n\n\n## Future Work\n- Improve the UI (maybe). The UI needs a lot of love:\n  - multi-conversation support\n  - previous message editing\n  - granular control over parameters\n  - consistent function call rendering\n\n## Contributing\n\nI welcome contributions! If you have an idea for a feature, or want to report a bug, please open an issue, or submit a pull request.\n\nSteps to contribute:\n\n1. Fork this repository.\n2. Create a feature branch `git checkout -b feature/YourAmazingIdea`.\n3. Commit your changes `git commit -m 'Add YourAmazingIdea'`.\n4. Push to the branch `git push origin feature/YourAmazingIdea`.\n5. Submit a Pull Request.\n\n## Disclaimer\n\n**codesherpa** is independently developed and not affiliated, endorsed, or sponsored by OpenAI. \n\n## License\n\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamgreggarcia%2Fcodesherpa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamgreggarcia%2Fcodesherpa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamgreggarcia%2Fcodesherpa/lists"}