Package: gpt-code-assistant
gpt-code-assistantgpt-code-assistantis an AI-based open-source tool for exploring, querying, and understanding any codebase using Language Models (LLMs) and vector embeddings (a technique to convert objects, like text, into vectors).Table of ContentsFeaturesGetting StartedInstallationUsageConfigurationProblemRoadmapContributingFeaturesLLM-based Search & Retrieval: Uses Language Models for efficient code search, retrieval, and comprehension.File-system Integration: Designed to work with any codebase and operates directly with any local code on your machine, allowing seamless integration with your existing workflow.Language Agnostic: Supports multiple programming languages.Privacy-centric Design: Code snippets are only transmitted when a question is asked and the Language Model requests the relevant code, ensuring privacy.(Note: Code snippets are shared with OpenAI)Future plans include supporting local models and the ability to generate code.Getting StartedInstallationpipinstallgpt-code-assistantUsageCreate a projectFirst, create a project to index all the files. This step involves creating embeddings for each file and storing them in a local database.gpt-code-assistantcreate-project<project-name><path-to-codebase>

gpt-code-assistantcreate-projectgpt-code-assistant.Ask a question about your codebaseTo query about the purpose of your codebase, you can use thequerycommand:gpt-code-assistantquery<project-name>"What does this codebase do?"If you want to generate a test for a specific file, for example analytics.py, you can mention the file name to improve accuracy:gpt-code-assistantquerygpt-code-assistant"Can you generate a test for analytics.py?"For a general usage question about a certain module, like analytics, you can use keywords to search across the codebase:gpt-code-assistantquerygpt-code-assistant"How do I use the analytics module?"Remember, mentioning the file name or specific keywords improves the accuracy of the search.List all projectsTo get a list of all the projects:gpt-code-assistantlist-projectsRefresh a projectIf you want to reindex a project and update the embeddings to the latest content:gpt-code-assistantrefresh-project<project-name>Delete a projectIf you wish to delete a project and all its data (including embeddings):gpt-code-assistantdelete-project<project-name>Select a model to useYou can select which model to use for your queries:gpt-code-assistantselect-modelDefaults togpt-3.5-turbo-16k. The selected model is stored in$HOME/.gpt-code-assistant/config.toml.ConfigurationThe tool will prompt you to configure theOPENAI_API_KEY, if you haven't already.ProblemYou want to leverage the power of GPT-4 to search your codebase, but you don't want to manually copy and paste code snippets into a prompt nor send your code to another third-party service (other than OpenAI). This tool solves these problems by letting GPT-4 determine the most relevant code snippets within your codebase. It also allows you to perform your queries in your terminal, removing the need for a separate UI.Examples of the types of questions you might want to ask:🐛 Help debugging errors and finding the relevant code and files📝 Document large files or functionalities formatted as markdown🛠️ Generate new code based on existing files and conventions📨 Ask general questions about any part of the codebaseRoadmapUse vector embeddings to improve search and retrievalAdd support for additional models (Claude, Bedrock, etc)Add support for local models (Llama2, Starcoder, etc)Add support for generating code and saving it to a fileSupport for searching across multiple codebasesAllow the model to create new functions that it can then executeUseguidanceto improve promptsContributingWe love contributions from the community! ❤️ If you'd like to contribute, feel free to fork the repository and submit a pull request.Please read ourCode of ConductandContributing Guidefor more detailed steps and information.Code of ConductWe are committed to fostering a welcoming community. To ensure that everyone feels safe and welcome, we have aCode of Conductthat all contributors, maintainers, and users of this project are expected to adhere to.SupportIf you're having trouble usinggpt-code-assistant, feel free toopen an issueon our GitHub. You can also reach out to us directly atnarenkmanoharan@gmail.com. We're always happy to help!FeedbackYour feedback is very important to us! If you have ideas for how we can improvegpt-code-assistant, we'd love to hear from you. Pleaseopen an issueor reach out to us directly atnarenkmanoharan@gmailwith your feedback or thoughts.LicenseThis project is licensed under the terms of theApache 2.0.