mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 08:20:14 +01:00
Release 0.4.5 (#282)
* Release 0.4.5 * Update @waylaidwanderer/node-chatgpt-api to latest version * Update dockerfiles to use workspaces and ensure packages are @ latest * Remove package-lock.json files from workspace directories as no longer needed * refactor(api): remove deprecated text-davinci-002-render-paid model from CHATGPT_MODELS refactor(api/client): change model comparison to use startsWith() instead of === for GPT-4 models
This commit is contained in:
parent
45a2aaf7b8
commit
dbf45196ee
14 changed files with 633 additions and 31965 deletions
|
|
@ -1,2 +1,3 @@
|
|||
**/node_modules
|
||||
api/.env
|
||||
client/dist/images
|
||||
32
Dockerfile
32
Dockerfile
|
|
@ -1,38 +1,32 @@
|
|||
FROM node:19-alpine AS react-client
|
||||
# Base node image
|
||||
FROM node:19-alpine AS base
|
||||
WORKDIR /api
|
||||
COPY /api/package*.json /api/
|
||||
WORKDIR /client
|
||||
# copy package.json into the container at /client
|
||||
COPY /client/.env /client/.env
|
||||
COPY /client/package*.json /client/
|
||||
# install dependencies
|
||||
WORKDIR /
|
||||
COPY /package*.json /
|
||||
RUN npm ci
|
||||
# Copy the current directory contents into the container at /client
|
||||
|
||||
# React client build
|
||||
FROM base AS react-client
|
||||
WORKDIR /client
|
||||
COPY /client/ /client/
|
||||
# Set the memory limit for Node.js
|
||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
||||
# Build artifacts
|
||||
RUN npm run build
|
||||
|
||||
FROM node:19-alpine AS node-api
|
||||
# Node API setup
|
||||
FROM base AS node-api
|
||||
WORKDIR /api
|
||||
# copy package.json into the container at /api
|
||||
COPY /api/package*.json /api/
|
||||
# install dependencies
|
||||
RUN npm ci
|
||||
# Copy the current directory contents into the container at /api
|
||||
COPY /api/ /api/
|
||||
# Copy the client side code
|
||||
COPY --from=react-client /client/dist /client/dist
|
||||
# Make port 3080 available to the world outside this container
|
||||
EXPOSE 3080
|
||||
# Expose the server to 0.0.0.0
|
||||
ENV HOST=0.0.0.0
|
||||
# Run the app when the container launches
|
||||
CMD ["npm", "start"]
|
||||
|
||||
# Optional: for client with nginx routing
|
||||
FROM nginx:stable-alpine AS nginx-client
|
||||
WORKDIR /usr/share/nginx/html
|
||||
COPY --from=react-client /client/dist /usr/share/nginx/html
|
||||
# Add your nginx.conf
|
||||
COPY /client/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY client/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ WORKDIR /app
|
|||
# Copy package.json files for client and api
|
||||
COPY /client/package*.json /app/client/
|
||||
COPY /api/package*.json /app/api/
|
||||
COPY /package*.json /app/
|
||||
|
||||
# Install dependencies for both client and api
|
||||
RUN cd /app/client && npm ci
|
||||
RUN cd /app/api && npm ci
|
||||
RUN npm ci
|
||||
|
||||
# Copy the current directory contents into the container
|
||||
COPY /client/ /app/client/
|
||||
|
|
|
|||
|
|
@ -82,7 +82,10 @@ CHATGPT_TOKEN="user_provided"
|
|||
|
||||
# Identify the available models, separated by commas. The first will be default.
|
||||
# Leave it blank to use internal settings.
|
||||
CHATGPT_MODELS=text-davinci-002-render-sha,text-davinci-002-render-paid,gpt-4
|
||||
CHATGPT_MODELS=text-davinci-002-render-sha,gpt-4
|
||||
# NOTE: you can add gpt-4-plugins, gpt-4-code-interpreter, and gpt-4-browsing to the list above and use the models for these features;
|
||||
# however, the view/display portion of these features are not supported, but you can use the underlying models, which have higher token context
|
||||
# Also: text-davinci-002-render-paid is deprecated as of May 2023
|
||||
|
||||
# Reverse proxy settings for ChatGPT
|
||||
# https://github.com/waylaidwanderer/node-chatgpt-api#using-a-reverse-proxy
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ const askBing = async ({
|
|||
token,
|
||||
onProgress
|
||||
}) => {
|
||||
const { BingAIClient } = await import('og-chatgpt-api');
|
||||
const { BingAIClient } = await import('@waylaidwanderer/chatgpt-api');
|
||||
const store = {
|
||||
store: new KeyvFile({ filename: './data/cache.json' })
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const browserClient = async ({
|
|||
abortController,
|
||||
userId
|
||||
}) => {
|
||||
const { ChatGPTBrowserClient } = await import('og-chatgpt-api');
|
||||
const { ChatGPTBrowserClient } = await import('@waylaidwanderer/chatgpt-api');
|
||||
const store = {
|
||||
store: new KeyvFile({ filename: './data/cache.json' })
|
||||
};
|
||||
|
|
|
|||
11325
api/package-lock.json
generated
11325
api/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "chat-backend",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.5",
|
||||
"description": "",
|
||||
"main": "server/index.js",
|
||||
"scripts": {
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
"dependencies": {
|
||||
"@dqbd/tiktoken": "^1.0.2",
|
||||
"@keyv/mongo": "^2.1.8",
|
||||
"@waylaidwanderer/chatgpt-api": "github:danny-avila/node-chatgpt-api",
|
||||
"@waylaidwanderer/chatgpt-api": "^1.36.0",
|
||||
"axios": "^1.3.4",
|
||||
"bcrypt": "^5.1.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
|
|
@ -43,7 +43,6 @@
|
|||
"meilisearch": "^0.31.1",
|
||||
"mongoose": "^6.9.0",
|
||||
"nodemailer": "^6.9.1",
|
||||
"og-chatgpt-api": "npm:@waylaidwanderer/chatgpt-api@^1.35.0",
|
||||
"openai": "^3.1.0",
|
||||
"passport": "^0.6.0",
|
||||
"passport-facebook": "^3.0.0",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const getOpenAIModels = () => {
|
|||
};
|
||||
|
||||
const getChatGPTBrowserModels = () => {
|
||||
let models = ['text-davinci-002-render-sha', 'text-davinci-002-render-paid', 'gpt-4'];
|
||||
let models = ['text-davinci-002-render-sha', 'gpt-4'];
|
||||
if (process.env.CHATGPT_MODELS) models = String(process.env.CHATGPT_MODELS).split(',');
|
||||
|
||||
return models;
|
||||
|
|
|
|||
20260
client/package-lock.json
generated
20260
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "chat-frontend",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.5",
|
||||
"description": "",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ const getIcon = props => {
|
|||
} else if (endpoint === 'openAI') {
|
||||
const { chatGptLabel } = props;
|
||||
icon = <GPTIcon size={size * 0.7} />;
|
||||
bg = model && model.toLowerCase() === 'gpt-4' ? '#AB68FF' : (chatGptLabel
|
||||
bg = model && model.toLowerCase().startsWith('gpt-4') ? '#AB68FF' : (chatGptLabel
|
||||
? `rgba(16, 163, 127, ${button ? 0.75 : 1})`
|
||||
: `rgba(16, 163, 127, ${button ? 0.75 : 1})`);
|
||||
name = chatGptLabel || 'ChatGPT';
|
||||
|
|
@ -54,7 +54,7 @@ const getIcon = props => {
|
|||
name = jailbreak ? 'Sydney' : 'BingAI';
|
||||
} else if (endpoint === 'chatGPTBrowser') {
|
||||
icon = <GPTIcon size={size * 0.7} />;
|
||||
bg = model && model.toLowerCase() === 'gpt-4' ? '#AB68FF' : `rgba(0, 163, 255, ${button ? 0.75 : 1})`;
|
||||
bg = model && model.toLowerCase().startsWith('gpt-4') ? '#AB68FF' : `rgba(0, 163, 255, ${button ? 0.75 : 1})`;
|
||||
name = 'ChatGPT';
|
||||
} else if (endpoint === null) {
|
||||
icon = <GPTIcon size={size * 0.7} />;
|
||||
|
|
|
|||
952
package-lock.json
generated
952
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "chatgpt-clone",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.5",
|
||||
"description": "",
|
||||
"workspaces": [
|
||||
"api",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue