fix: add defaults for LMStudio to work out of the box (#928)
Some checks are pending
Update Stable Branch / prepare-release (push) Waiting to run

This commit is contained in:
Eduard Ruzga 2024-12-30 14:20:13 +02:00 committed by GitHub
parent 4c81e154a0
commit 4c81cb02e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -29,7 +29,12 @@ export abstract class BaseProvider implements ProviderInfo {
}
const baseUrlKey = this.config.baseUrlKey || defaultBaseUrlKey;
let baseUrl = settingsBaseUrl || serverEnv?.[baseUrlKey] || process?.env?.[baseUrlKey] || manager.env?.[baseUrlKey];
let baseUrl =
settingsBaseUrl ||
serverEnv?.[baseUrlKey] ||
process?.env?.[baseUrlKey] ||
manager.env?.[baseUrlKey] ||
this.config.baseUrl;
if (baseUrl && baseUrl.endsWith('/')) {
baseUrl = baseUrl.slice(0, -1);

View File

@ -12,6 +12,7 @@ export default class LMStudioProvider extends BaseProvider {
config = {
baseUrlKey: 'LMSTUDIO_API_BASE_URL',
baseUrl: 'http://localhost:1234/',
};
staticModels: ModelInfo[] = [];

View File

@ -28,5 +28,6 @@ export interface ProviderInfo {
}
export interface ProviderConfig {
baseUrlKey?: string;
baseUrl?: string;
apiTokenKey?: string;
}