mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
🔼 feat: Vercel App Attribution for LibreChat (#9769)
This commit is contained in:
parent
880c7b43a1
commit
91e49d82aa
2 changed files with 6 additions and 1 deletions
|
|
@ -41,6 +41,9 @@ export function getOpenAIConfig(
|
||||||
!isAnthropic &&
|
!isAnthropic &&
|
||||||
((baseURL && baseURL.includes(KnownEndpoints.openrouter)) ||
|
((baseURL && baseURL.includes(KnownEndpoints.openrouter)) ||
|
||||||
(endpoint != null && endpoint.toLowerCase().includes(KnownEndpoints.openrouter)));
|
(endpoint != null && endpoint.toLowerCase().includes(KnownEndpoints.openrouter)));
|
||||||
|
const isVercel =
|
||||||
|
(baseURL && baseURL.includes('ai-gateway.vercel.sh')) ||
|
||||||
|
(endpoint != null && endpoint.toLowerCase().includes(KnownEndpoints.vercel));
|
||||||
|
|
||||||
let azure = options.azure;
|
let azure = options.azure;
|
||||||
let headers = options.headers;
|
let headers = options.headers;
|
||||||
|
|
@ -80,7 +83,7 @@ export function getOpenAIConfig(
|
||||||
if (baseURL) {
|
if (baseURL) {
|
||||||
configOptions.baseURL = baseURL;
|
configOptions.baseURL = baseURL;
|
||||||
}
|
}
|
||||||
if (useOpenRouter) {
|
if (useOpenRouter || isVercel) {
|
||||||
configOptions.defaultHeaders = Object.assign(
|
configOptions.defaultHeaders = Object.assign(
|
||||||
{
|
{
|
||||||
'HTTP-Referer': 'https://librechat.ai',
|
'HTTP-Referer': 'https://librechat.ai',
|
||||||
|
|
|
||||||
|
|
@ -889,6 +889,7 @@ export enum KnownEndpoints {
|
||||||
shuttleai = 'shuttleai',
|
shuttleai = 'shuttleai',
|
||||||
'together.ai' = 'together.ai',
|
'together.ai' = 'together.ai',
|
||||||
unify = 'unify',
|
unify = 'unify',
|
||||||
|
vercel = 'vercel',
|
||||||
xai = 'xai',
|
xai = 'xai',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -925,6 +926,7 @@ export const alternateName = {
|
||||||
[KnownEndpoints.ollama]: 'Ollama',
|
[KnownEndpoints.ollama]: 'Ollama',
|
||||||
[KnownEndpoints.deepseek]: 'DeepSeek',
|
[KnownEndpoints.deepseek]: 'DeepSeek',
|
||||||
[KnownEndpoints.xai]: 'xAI',
|
[KnownEndpoints.xai]: 'xAI',
|
||||||
|
[KnownEndpoints.vercel]: 'Vercel',
|
||||||
};
|
};
|
||||||
|
|
||||||
const sharedOpenAIModels = [
|
const sharedOpenAIModels = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue