In settings.ts there are two things that prevent the model fetching from working correctly
first: instead of hard coding the url, this.plugin.settings.restAPIUrl should be used
async fetchData() {
const url = 'http://localhost:8080/v1/models';
2nd: when filling the drop down of models, there should be no default values for localai.io, as this is completely up to the user, how they set them up. If nothing is returned, nothing should be shown
.addDropdown(dropdown => {
dropdown
.addOption('gpt-3.5-turbo', 'gpt-3.5-turbo')
.addOption('gpt-3.5-turbo-16k', 'gpt-3.5-turbo-16k')
.addOption('gpt-4', 'gpt-4')
if (this.plugin.settings.restAPIUrl) {
if (models && models.length > 0) {
models.forEach((model: string) => {
dropdown.addOption(model, model);
});
}
}
sorry, i have no dev environment at hand, otherwise I would have created the PRs myself