Git Product home page Git Product logo

gpt-code-learner's Introduction

GPT-Code-Learner

Learn A Repo Interactively with GPT. Ask questions to let the GPT explain the code to you.

GPT-Code-Learner.jpg

Try it out in your browser

GUI.jpg

Local LLM Support (Experimental)

GPT-Code-Learner supports running the LLM models locally. In general, GPT-Code-Learner uses LocalAI for local private LLM and Sentence Transformers for local embedding.

Please refer to Local LLM for more details.

Note: Due to the current capability of local LLM, the performance of GPT-Code-Learner is not as good as the online version.

Installation

  1. Clone this repository and install the required packages:
git clone https://github.com/JinghaoZhao/GPT-Code-Learner.git
pip install -r requirements.txt
  1. Create a .env file to put your API key:
OPENAI_API_KEY=sk-xxxxxx
LLM_TYPE="OpenAI"
EMBEDDING_TYPE="OpenAI"

If you want to run the whole program locally, please change the following line in the .env file:

LLM_TYPE="local"
EMBEDDING_TYPE="local"
  1. Put the repo url (e.g., Github link) in the Repo Link textbox and click Analyze Code Repo button in the GUI. Or manually clone the repo you want to learn into code_repo folder:
cd code_repo
git clone <repo_url>
  1. Run the GPT-Code-Learner. If you use local LLM models, please run the local model before running the GPT-Code-Learner. Please refer to Local LLM for more details.
python run.py
  1. Open your web browser at http://127.0.0.1:7860 to ask any questions about your repo

Knowledge Base

GPT-Code-Learner generates vector database from the code repo as a knowledge base to answer repo-related questions. By default, it will use the source codes as the knowledge base. More details can be found in Knowledge Base.

Tool Planner

The core of the GPT-Code-Learner is the tool planner. It leverages available tools to process the input to provide contexts.

Currently, the tool planner supports the following tools:

  • Code_Searcher: This tool searches keywords (e.g., specific functions or variables) extracted from user query in the code repository

  • Repo_Parser: This tool performs a fuzzy search with vector database of the code repo. It provides contexts for questions about the general procedures in the repo.

More tools are under development. Feel free to contribute to this project!

gpt-code-learner's People

Contributors

jinghaozhao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.