ravenscroftj / turbopilot

Turbopilot is an open source large-language-model based code completion engine that runs locally on CPU
BSD 3-Clause "New" or "Revised" License
3.83k stars 127 forks source link

Can TurboPilot be configured to work with the official VSCode Copilot plugin? #11

Open sksq96 opened 1 year ago

sksq96 commented 1 year ago

According to the documentation of FauxPilot (https://github.com/fauxpilot/fauxpilot/blob/main/documentation/client.md#copilot-plugin), it is possible to configure the official VSCode Copilot plugin to use a local server. I am wondering if the same can be done with TurboPilot (https://github.com/ravenscroftj/turbopilot).

I tried to configure the official GitHub Copilot plugin to use a local server by adding the following settings in my VSCode settings.json file:

"debug.overrideEngine": "codegen",
"debug.testOverrideProxyUrl": "http://localhost:18080",
"debug.overrideProxyUrl": "http://localhost:18080"

However, when I tried to use FauxPilot, I received the following error message:

(2023-04-14 10:27:15) [INFO    ] Request: 127.0.0.1:56113 0x101008200 HTTP/1.1 POST /v1/engines/codegen/completions
operator(): number of tokens in prompt = 401

(2023-04-14 10:27:15) [ERROR   ] An uncaught exception occurred: cannot find key
(2023-04-14 10:27:15) [INFO    ] Response: 0x101008200 /v1/engines/codegen/completions 500 1

I am not sure what went wrong and how to fix this issue. Has anyone else faced a similar problem while configuring the official GitHub Copilot plugin? Any help or suggestions would be greatly appreciated.

Thank you in advance for your assistance!

ravenscroftj commented 1 year ago

Great question! I will have a look at this as it would be nice for people to be able to use the official plugin. I believe the error you are betting indicates that the official plugin does not pass all the input fields that my json endpoint is expecting. I have a feeling I know which one. Should be relatively easy to fix.

sksq96 commented 1 year ago

Great! Let me know if you get some time to test it with the official plugin.

ravenscroftj commented 1 year ago

Ok so I was able to fix that problem so that the official autopilot plugin can talk to fauxpilot without causing an error. However, the latest version plugin does seem to throw away the suggestions silently and I can't figure out why. Still, a step in the right direction.

Meanwhile, I've also forked the fauxpilot plugin for VSCode which actually shows a status wheel while it is thinking which helps with the UX a bit. I've provided a custom build of the plugin that can be downloaded and installed via the install from VSIX file option for now (hopefully the upstream maintainer will incorporate my PR).

image

I'll keep plugging away to see if we can make the official plugin work

Sreepathy-J commented 1 year ago

Hi @ravenscroftj, any progress on this area?