Repository: FlowiseAI/Flowise
File: packages/components/nodes/chatmodels/ChatLocalAI/ChatLocalAI.ts (TypeScript)

Code before:
            label: 'Connect Credential',
            name: 'credential',
            type: 'credential',
            credentialNames: ['LocalAIApi'],
            optional: true
        }

        const modelOptions = JSON.parse(process.env.LOCALAI_CHAT_MODELS || '[]');
        
        this.inputs = [
            {
                label: 'Cache',
                name: 'cache',
                type: 'BaseCache',
                optional: true
            },
            {
                label: 'Base Path',
                name: 'basePath',
                type: 'string',
                placeholder: 'http://localhost:8080/v1'
            },
            {
                label: 'Model Name',
                name: 'modelName',
                type: 'options',
                options: modelOptions,
                default: modelOptions.length > 0 ? modelOptions[0].name : '',
                optional: true
            },
            {
                label: 'Temperature',
                name: 'temperature',
                type: 'number',
                step: 0.1,
                default: 0.9,
                optional: true
            },
            {
                label: 'Max Tokens',
                name: 'maxTokens',
                type: 'number',
                step: 1,
                optional: true,
                additionalParams: true
            },
            {
                label: 'Top Probability',
                name: 'topP',
                type: 'number',
                step: 0.1,

Review comment (suggestion):
Thanks for the suggestion! We didn't use `options` because we didn't want to limit the selections, hence added as `string` so that user can just specify the model they have in LocalAI.

Other users might face confusion as in why there is no selection available unless they read the repo carefully and realize they have to specify `LOCALAI_CHAT_MODELS` env. For now, I'd prefer to switch back to `string`. In future, we will have community nodes which allow users to create their custom component - https://github.com/FlowiseAI/Flowise/pull/1066

Code after:
            label: 'Connect Credential',
            name: 'credential',
            type: 'credential',
            credentialNames: ['localAIApi'],
            optional: true
        }
        this.inputs = [
            {
                label: 'Cache',
                name: 'cache',
                type: 'BaseCache',
                optional: true
            },
            {
                label: 'Base Path',
                name: 'basePath',
                type: 'string',
                placeholder: 'http://localhost:8080/v1'
            },
            {
                label: 'Model Name',
                name: 'modelName',
                type: 'string',
                placeholder: 'gpt4all-lora-quantized.bin'
            },
            {
                label: 'Temperature',
                name: 'temperature',
                type: 'number',
                step: 0.1,
                default: 0.9,
                optional: true
            },
            {
                label: 'Max Tokens',
                name: 'maxTokens',
                type: 'number',
                step: 1,
                optional: true,
                additionalParams: true
            },
            {
                label: 'Top Probability',
                name: 'topP',
                type: 'number',
                step: 0.1,
                optional: true,
                additionalParams: true
            },
            {
                label: 'Timeout',