MCPcopy
hub / github.com/ricklamers/gpt-code-ui

github.com/ricklamers/gpt-code-ui @v0.42.40 sqlite

repository ↗ · DeepWiki ↗ · release v0.42.40 ↗
83 symbols 218 edges 20 files 0 documented · 0%
README

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.

Community

Judah Cooper offered to start & curate a Discord community. Join here.

Installation

Open a terminal and run:

pip install gpt-code-ui
gptcode

In order to make basic dependencies available it's recommended to run the following pip install in the Python environment that is used in the shell where you run gptcode:

pip install "numpy>=1.24,<1.25" "dateparser>=1.1,<1.2" "pandas>=1.5,<1.6" "geopandas>=0.13,<0.14" "tabulate>=0.9.0<1.0" "PyPDF2>=3.0,<3.1" "pdfminer>=20191125,<20191200" "pdfplumber>=0.9,<0.10" "matplotlib>=3.7,<3.8"

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.

Thank you for your interest in this project!

Core symbols most depended-on inside this repo

addMessage
called by 5
frontend/src/App.tsx
run
called by 5
gpt_code_ui/kernel_program/kernel_manager.py
send_message
called by 5
gpt_code_ui/kernel_program/kernel_manager.py
append
called by 3
gpt_code_ui/webapp/main.py
flush_kernel_msgs
called by 2
gpt_code_ui/kernel_program/kernel_manager.py
start_kernel_manager
called by 2
gpt_code_ui/kernel_program/main.py
cleanup_kernel_program
called by 2
gpt_code_ui/kernel_program/main.py
getModels
called by 1
frontend/src/App.tsx

Shape

Function 65
Route 10
Method 5
Class 2
Enum 1

Languages

Python70%
TypeScript30%

Modules by API surface

gpt_code_ui/webapp/main.py24 symbols
gpt_code_ui/kernel_program/main.py13 symbols
gpt_code_ui/kernel_program/kernel_manager.py11 symbols
frontend/src/App.tsx10 symbols
frontend/src/components/Input.tsx8 symbols
gpt_code_ui/main.py6 symbols
frontend/src/components/Chat.tsx5 symbols
gpt_code_ui/kernel_program/utils.py3 symbols
frontend/src/components/Sidebar.tsx2 symbols
gpt_code_ui/kernel_program/config.py1 symbols

Dependencies from manifests, versioned

@emotion/react11.11.0 · 1×
@emotion/styled11.11.0 · 1×
@mui/icons-material5.11.16 · 1×
@mui/material5.13.1 · 1×
@types/react18.0.28 · 1×
@types/react-dom18.0.11 · 1×
@typescript-eslint/eslint-plugin5.57.1 · 1×
@typescript-eslint/parser5.57.1 · 1×
@vitejs/plugin-react-swc3.0.0 · 1×
eslint8.38.0 · 1×
eslint-plugin-react-hooks4.6.0 · 1×

For agents

$ claude mcp add gpt-code-ui \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact