yhyu13 / gpt-code-ui

An open source implementation of OpenAI's ChatGPT Code interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPT-Code logo

An open source implementation of OpenAI's ChatGPT Code interpreter.

Simply ask the OpenAI model to do something and it will generate & execute the code for you.

Read the blog post to find out more.

Installation

Open a terminal and run:

pip install gpt-code-ui
gptcode

User interface

GPT-Code logo

Features

  • File upload
  • File download
  • Context awareness (it can refer to your previous messages)
  • Generate code
  • Run code (Python kernel)
  • Model switching (GPT-3.5 and GPT-4)

Misc.

Using .env for OpenAI key

You can put a .env in the working directory to load the OPENAI_API_KEY environment variable.

Configurables

Set the API_PORT, WEB_PORT, SNAKEMQ_PORT variables to override the defaults.

Set OPENAI_BASE_URL to change the OpenAI API endpoint that's being used (note this environment variable includes the protocol https://...).

You can use the .env.example in the repository (make sure you git clone the repo to get the file first).

For Azure OpenAI Services, there are also other configurable variables like deployment name. See .env.azure-example for more information. Note that model selection on the UI is currently not supported for Azure OpenAI Services.

cp .env.example .env
vim .env
gptcode

Docker

localagi took the effort of bundling the Python package in a Docker container. Check it out here: gpt-code-ui-docker.

Contributing

Please do and have a look at the contributions guide! This should be a community initiative. I'll try my best to be responsive.

About

An open source implementation of OpenAI's ChatGPT Code interpreter

License:MIT License


Languages

Language:Python 54.2%Language:TypeScript 31.4%Language:CSS 8.5%Language:Makefile 2.8%Language:Shell 1.5%Language:JavaScript 0.9%Language:HTML 0.8%