codesherpa is a code interpreter ChatGPT plugin and a standalone code interpreter (experimental). Read the Quickstart section to try it out.
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.Standalone code interpreter demo:
https://github.com/iamgreggarcia/codesherpa/assets/16596972/96cb0694-fec6-4046-99d6-2e141b2a853f
ChatGPT Plugin demo:
https://github.com/iamgreggarcia/codesherpa/assets/16596972/b7afb034-6b74-42a3-9496-a912bcaf0f66
See more examples here
July 13, 2023:
June 21, 2023:
openapi.json
generated be the server. Also added request example data which is included in the api spec. This reduces the size of the plugin manifest description_for_model
.June 18, 2023: Added docker-compose.yml
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: 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.
May 22, 2023: Refactored README to provide clear and concise instructions for building and running codesherpa.
May 20, 2023: codesherpa now supports multiple programming languages, including Python, C++, and Rust.
To try the new chat interface:
# Clone the repository
git clone https://github.com/iamgreggarcia/codesherpa.git
Add your OPENAI_API_KEY
to a copy of .env.example
:
cd codesherpa/frontend
cp .env.example .env.local
Install dependencies and startup the Next.js app:
pnpm install
pnpm dev
OR
npm install
npm run dev
Download the docker image OR run the codesherpa API locally (beware!):
Docker image:
# Pull the Docker image
docker pull ghcr.io/iamgreggarcia/codesherpa:latest
# Run the Docker image locally
docker compose up
Run the server locally (potentially risky!):
cd codesherpa
make dev
Navigate to http://localhost:3000
. Expect bugs and inconsistencies.
Ensure the following software is installed on your system:
Option 1: Using Docker image from Github Packages
# Pull the Docker image
docker pull ghcr.io/iamgreggarcia/codesherpa:latest
# Run the Docker image locally
docker compose up
Option 2: Using the repository and Make commands
# Clone the repository
git clone https://github.com/iamgreggarcia/codesherpa.git
# Navigate to the repository directory
cd codesherpa
# Build the Docker image using Make
make build-docker
# Run the Docker image locally
make run-docker-localserver
Option 3: Using the repository and Docker commands
Instead of Make commands, you can use the following Docker commands directly or use Docker Compose
# Clone the repository
git clone https://github.com/iamgreggarcia/codesherpa.git
# Navigate to the repository directory
cd codesherpa
# Build the Docker image
docker build -t codesherpa .
# Run the Docker image locally
docker run -p 3333:3333 codesherpa python3 -c "import localserver.main; localserver.main.start()"
# OR use Docker Compose
docker compose up
Whichever option you choose, codesherpa will be accessible at localhost:3333.
localhost:3333
. Your ChatGPT should now be able to use codesherpa's features.Below are some examples. Please note that portions of these videos are edited and/or sped up for brevity.
https://github.com/iamgreggarcia/codesherpa/assets/16596972/a42d717c-a996-4622-a5d1-139466cad233
Most of us have seen the ChatGPT Code Interpreter Video Demo, which is the inspiration for this project. So I thought it fitting to ask similar questions as those in the OpenAI video demo.
1/sin(x)
:https://github.com/iamgreggarcia/codesherpa/assets/16596972/111e7e25-a5b0-4d7e-9ffb-dee5e844cafd
https://github.com/iamgreggarcia/codesherpa/assets/16596972/5e9a3b6a-b004-434b-aaba-715d7d53e54d
I 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.
Steps to contribute:
git checkout -b feature/YourAmazingIdea
.git commit -m 'Add YourAmazingIdea'
.git push origin feature/YourAmazingIdea
.codesherpa is independently developed and not affiliated, endorsed, or sponsored by OpenAI.
This project is licensed under the terms of the MIT license.