continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.64k stars 1.72k forks source link

Export functions to add/remove custom models to other VS Code extensions #803

Open lupreCSC opened 10 months ago

lupreCSC commented 10 months ago

Validations

Problem

We are trying to use continue with some locally hosted models were happy to see that there is way to provide a custom model querying code via the config.ts. Sadly, this is somewhat limited because it does not allow access to the vscode API object, which we would to interact with VSCode's authentication providers. It gets even more difficult if we want to use some features provided by another extension inside the config.ts code. A more flexible programmatic way to add models to the continue extension would be appreciated.

Solution

VS Code allows extensions to export an API object with functions for other extensions to invoke from the activate function. It would be great if continue could export a function to add a custom model.

Would that be a feature you would be willing to consider?

(Unfortunately unable to join discord).

sestinj commented 9 months ago

@lupreCSC thanks for making the detailed PR! I apologize for taking so long to get back with you.

I feel this adds a good amount of complexity, so I'd want to understand the reasons really well. I think I understand the need to use authentication for custom LLMs at a high level, but what is the exact mechanism you'll want to use for this? And when you say "we want to use some features provided by another extension inside the config.ts code", what sorts of features are you interested in using?

Depending on what you're looking for, I think that a possible simpler option would to be to pass the vscode object to the modifyConfig function

lupreCSC commented 8 months ago

Hi @sestinj and please excuse the delay in my response.

Our setting is that we are running a model that is not using the OpenAI API and requires OAuth / OpenID Connect based authentication from our authorization servers. We have now set up a VSCode extension that implements model API requests as well as the authentication and are looking for a way to register that into the model list of the Continue extension.

The following are the problems with modifyConfig as we currently see them:

Having Continue export an API endpoint that allows other extension to register models solves all these issues: