mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: byebye litellm
This commit is contained in:
@@ -5,12 +5,7 @@
|
||||
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
||||
import {
|
||||
LITELLM_API_BASE_URL,
|
||||
OLLAMA_API_BASE_URL,
|
||||
OPENAI_API_BASE_URL,
|
||||
WEBUI_API_BASE_URL
|
||||
} from '$lib/constants';
|
||||
import { OLLAMA_API_BASE_URL, OPENAI_API_BASE_URL, WEBUI_API_BASE_URL } from '$lib/constants';
|
||||
import { WEBUI_NAME, config, user, models, settings } from '$lib/stores';
|
||||
|
||||
import { cancelOllamaRequest, generateChatCompletion } from '$lib/apis/ollama';
|
||||
@@ -79,11 +74,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
model.external
|
||||
? model.source === 'litellm'
|
||||
? `${LITELLM_API_BASE_URL}/v1`
|
||||
: `${OPENAI_API_BASE_URL}`
|
||||
: `${OLLAMA_API_BASE_URL}/v1`
|
||||
model?.owned_by === 'openai' ? `${OPENAI_API_BASE_URL}` : `${OLLAMA_API_BASE_URL}/v1`
|
||||
);
|
||||
|
||||
if (res && res.ok) {
|
||||
@@ -150,11 +141,7 @@
|
||||
...messages
|
||||
].filter((message) => message)
|
||||
},
|
||||
model.external
|
||||
? model.source === 'litellm'
|
||||
? `${LITELLM_API_BASE_URL}/v1`
|
||||
: `${OPENAI_API_BASE_URL}`
|
||||
: `${OLLAMA_API_BASE_URL}/v1`
|
||||
model?.owned_by === 'openai' ? `${OPENAI_API_BASE_URL}` : `${OLLAMA_API_BASE_URL}/v1`
|
||||
);
|
||||
|
||||
let responseMessage;
|
||||
|
||||
Reference in New Issue
Block a user