Coder Social home page Coder Social logo

codecomp's Introduction

Codecomp

Copilot like code suggestions using RAG. Currently only plugins for Lem editor and Vim (with textprop support, > 9.0.0185).

Demo

Lem

Screen.Recording.2024-03-06.at.6.33.44.PM.mov

Vim

Setup

  • Clone the repo
$ git clone https://github.com/asutoshpalai/codecomp
$ cd codecomp
  • Download the embedding model
$ curl -OL 'https://huggingface.co/nomic-ai/nomic-embed-text-v1.5-GGUF/resolve/main/nomic-embed-text-v1.5.Q8_0.gguf?download=true'
  • Export the following environment variables or create an .env file contianing the following variables.
export OPENAI_BASE_URL="https://api.openai.com/v1"
export OPENAI_API_KEY="skynet-launch-codes"
export OPENAI_MODEL_NAME="gpt-3.5-turbo-0613"

Note: Strongly using Groq becuase of how fast it is. Groq has an OpenAI compatible API which can be used here.

  • Launch the Python server from the same shell. I haven't commited the dependency file yet. Please install anything that it complains about. Some errors might show up while serving the request.
$ python server.py
  • Test that the server is working properly.
curl -X POST -v http://localhost:8000/code_complete/invoke --header 'Content-Type: application/json' --data-raw '{
        "input": {
        "repo_path": "/home/user/projects/lem-codecomp/",
        "language": "python",
        "partial_code": "def start_server(host: str, port: int):\n"
  }
}'

Vim

  • Install the plugin. You can use vim-plug to install as follows:
Plug 'asutoshpalai/codecomp'
  • Add keybindings to invoke code completion
imap <C-a> <esc>:Codecomp<cr>i
imap <C-e> <esc>:CodecompAccept<cr>i
imap <C-s> <esc>:CodecompReject<cr>i

Lem

  • Load this in your Lem's init.lisp file. Add the following lines to the init file.
(push "/home/remote/Learning/llm/anyscale/" asdf:*central-registry*)
(ql:quickload :lem-codecomp)

codecomp's People

Contributors

asutoshpalai avatar

Stargazers

Manjaree Binjolkar avatar vindarel avatar

Watchers

vindarel avatar  avatar Kostas Georgiou avatar Manjaree Binjolkar 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.