diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 000000000000..41fd197b36e0 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,169 @@ +version: '3.4' + +# Please consult our docs for more info: https://docs.librechat.ai/install/configuration/docker_override.html + +# TO USE THIS FILE, FIRST UNCOMMENT THE LINE ('services:') + +# THEN UNCOMMENT ONLY THE SECTION OR SECTIONS CONTAINING THE CHANGES YOU WANT TO APPLY +# SAVE THIS FILE AS 'docker-compose.override.yaml' +# AND USE THE 'docker compose build' & 'docker compose up -d' COMMANDS AS YOU WOULD NORMALLY DO + +# WARNING: YOU CAN ONLY SPECIFY EVERY SERVICE NAME ONCE (api, mongodb, meilisearch, ...) +# IF YOU WANT TO OVERRIDE MULTIPLE SETTINGS IN ONE SERVICE YOU WILL HAVE TO EDIT ACCORDINGLY + +# EXAMPLE: if you want to use the config file and the latest numbered release docker image the result will be: + +services: + api: + volumes: + - type: bind + source: ./librechat.yaml + target: /app/librechat.yaml + image: ghcr.io/danny-avila/librechat:latest + +# --------------------------------------------------- + +#services: +# +# # USE LIBRECHAT CONFIG FILE +# api: +# volumes: +# - type: bind +# source: ./librechat.yaml +# target: /app/librechat.yaml + +# # LOCAL BUILD +# api: +# image: librechat +# build: +# context: . +# target: node + +# # BUILD FROM LATEST IMAGE +# api: +# image: ghcr.io/danny-avila/librechat-dev:latest + +# # BUILD FROM LATEST IMAGE (NUMBERED RELEASE) +# api: +# image: ghcr.io/danny-avila/librechat:latest + +# # BUILD FROM LATEST API IMAGE +# api: +# image: ghcr.io/danny-avila/librechat-dev-api:latest + +# # BUILD FROM LATEST API IMAGE (NUMBERED RELEASE) +# api: +# image: ghcr.io/danny-avila/librechat-api:latest + +# # ADD MONGO-EXPRESS +# mongo-express: +# image: mongo-express +# container_name: mongo-express +# environment: +# ME_CONFIG_MONGODB_SERVER: mongodb +# ME_CONFIG_BASICAUTH_USERNAME: admin +# ME_CONFIG_BASICAUTH_PASSWORD: password +# ports: +# - '8081:8081' +# depends_on: +# - mongodb +# restart: always + +# # USE MONGODB V4.4.18 - FOR OLDER CPU WITHOUT AVX SUPPORT + mongodb: + volumes: + - ./data-node:/var/lib/mongodb + +# # DISABLE THE MONGODB CONTAINER - YOU NEED TO SET AN ALTERNATIVE MONGODB URI IN THE .ENV FILE +# api: +# environment: +# - MONGO_URI=${MONGO_URI} +# mongodb: +# image: tianon/true +# command: "" +# entrypoint: "" + +# # EXPOSE MONGODB PORTS - USE CAREFULLY, THIS MAKES YOUR DATABASE VULNERABLE TO ATTACKS +# mongodb: +# ports: +# - 27018:27017 + +# # DISABLE MEILISEARCH +# meilisearch: +# profiles: +# - donotstart + +# # EXPOSE MEILISEARCH PORTS - DO NOT USE THE DEFAULT VALUE FOR THE MASTER KEY IF YOU DO THIS +# meilisearch: +# ports: +# - 7700:7700 + meilisearch: + volumes: + - ./meili_data_v1.7:/var/lib/meili_data +# # USE RAG API IMAGE WITH LOCAL EMBEDDINGS SUPPORT +# rag_api: +# image: ghcr.io/danny-avila/librechat-rag-api-dev:latest + +# ADD OLLAMA +# ollama: +# image: ollama/ollama:latest +# ports: +# - "11434:11434" +# volumes: +# - ./ollama:/root/.ollama +# - ./wait_for_ollama.sh:/wait_for_ollama.sh +# tty: true +# restart: always +# entrypoint: [ "/usr/bin/bash", "/wait_for_ollama.sh" ] +# # ADD LITELLM BASIC - NEED TO CONFIGURE litellm-config.yaml, ONLY NEED ENV TO ENABLE REDIS FOR CACHING OR LANGFUSE FOR MONITORING +# litellm: +# image: ghcr.io/berriai/litellm:main-latest +# volumes: +# - ./litellm/litellm-config.yaml:/app/config.yaml +# command: [ "--config", "/app/config.yaml", "--port", "8000", "--num_workers", "8" ] +# environment: +# OPENAI_API_KEY: none ## needs to be set if ollama's openai api compatibility is used +# REDIS_HOST: redis +# REDIS_PORT: 6379 +# REDIS_PASSWORD: RedisChangeMe +# LANGFUSE_PUBLIC_KEY: pk-lf-RandomStringFromLangfuseWebInterface +# LANGFUSE_SECRET_KEY: sk-lf-RandomStringFromLangfuseWebInterface +# LANGFUSE_HOST: http://langfuse-server:3000 + +# # ADD LITELLM CACHING +# redis: +# image: redis:7-alpine +# command: +# - sh +# - -c # this is to evaluate the $REDIS_PASSWORD from the env +# - redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose +# environment: +# REDIS_PASSWORD: RedisChangeMe +# volumes: +# - ./redis:/data + +# # ADD LITELLM MONITORING +# langfuse-server: +# image: ghcr.io/langfuse/langfuse:latest +# depends_on: +# - db +# ports: +# - "3000:3000" +# environment: +# - NODE_ENV=production +# - DATABASE_URL=postgresql://postgres:PostgresChangeMe@db:5432/postgres +# - NEXTAUTH_SECRET=ChangeMe +# - SALT=ChangeMe +# - NEXTAUTH_URL=http://localhost:3000 +# - TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true} +# - NEXT_PUBLIC_SIGN_UP_DISABLED=${NEXT_PUBLIC_SIGN_UP_DISABLED:-false} +# - LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES=${LANGFUSE_ENABLE_EXPERIMENTAL_FEATURES:-false} +# db: +# image: postgres +# restart: always +# environment: +# - POSTGRES_USER=postgres +# - POSTGRES_PASSWORD=PostgresChangeMe +# - POSTGRES_DB=postgres +# volumes: +# - ./postgres:/var/lib/postgresql/data diff --git a/librechat.yaml b/librechat.yaml new file mode 100644 index 000000000000..14b9aa8b04a4 --- /dev/null +++ b/librechat.yaml @@ -0,0 +1,293 @@ +# For more information, see the Configuration Guide: +# https://www.librechat.ai/docs/configuration/librechat_yaml + +# Configuration version (required) +version: 1.2.1 + +# Cache settings: Set to true to enable caching +cache: true + +# Custom interface configuration +interface: + # Privacy policy settings + privacyPolicy: + externalUrl: 'https://librechat.ai/privacy-policy' + openNewTab: true + + # Terms of service + termsOfService: + externalUrl: 'https://librechat.ai/tos' + openNewTab: true + modalAcceptance: true + modalTitle: "Terms of Service for LibreChat" + modalContent: | + # Terms and Conditions for LibreChat + + *Effective Date: February 18, 2024* + + Welcome to LibreChat, the informational website for the open-source AI chat platform, available at https://librechat.ai. These Terms of Service ("Terms") govern your use of our website and the services we offer. By accessing or using the Website, you agree to be bound by these Terms and our Privacy Policy, accessible at https://librechat.ai//privacy. + + ## 1. Ownership + + Upon purchasing a package from LibreChat, you are granted the right to download and use the code for accessing an admin panel for LibreChat. While you own the downloaded code, you are expressly prohibited from reselling, redistributing, or otherwise transferring the code to third parties without explicit permission from LibreChat. + + ## 2. User Data + + We collect personal data, such as your name, email address, and payment information, as described in our Privacy Policy. This information is collected to provide and improve our services, process transactions, and communicate with you. + + ## 3. Non-Personal Data Collection + + The Website uses cookies to enhance user experience, analyze site usage, and facilitate certain functionalities. By using the Website, you consent to the use of cookies in accordance with our Privacy Policy. + + ## 4. Use of the Website + + You agree to use the Website only for lawful purposes and in a manner that does not infringe the rights of, restrict, or inhibit anyone else's use and enjoyment of the Website. Prohibited behavior includes harassing or causing distress or inconvenience to any person, transmitting obscene or offensive content, or disrupting the normal flow of dialogue within the Website. + + ## 5. Governing Law + + These Terms shall be governed by and construed in accordance with the laws of the United States, without giving effect to any principles of conflicts of law. + + ## 6. Changes to the Terms + + We reserve the right to modify these Terms at any time. We will notify users of any changes by email. Your continued use of the Website after such changes have been notified will constitute your consent to such changes. + + ## 7. Contact Information + + If you have any questions about these Terms, please contact us at contact@librechat.ai. + + By using the Website, you acknowledge that you have read these Terms of Service and agree to be bound by them. + + endpointsMenu: true + modelSelect: true + parameters: true + sidePanel: true + presets: true + prompts: true + bookmarks: true + multiConvo: false + agents: false + +# Example Registration Object Structure (optional) +registration: + socialLogins: ['github', 'google', 'discord', 'openid', 'facebook'] + # allowedDomains: + # - "gmail.com" + +# speech: +# tts: +# openai: +# url: '' +# apiKey: '${TTS_API_KEY}' +# model: '' +# voices: [''] + +# +# stt: +# openai: +# url: '' +# apiKey: '${STT_API_KEY}' +# model: '' + +# rateLimits: +# fileUploads: +# ipMax: 100 +# ipWindowInMinutes: 60 # Rate limit window for file uploads per IP +# userMax: 50 +# userWindowInMinutes: 60 # Rate limit window for file uploads per user +# conversationsImport: +# ipMax: 100 +# ipWindowInMinutes: 60 # Rate limit window for conversation imports per IP +# userMax: 50 +# userWindowInMinutes: 60 # Rate limit window for conversation imports per user + +# Example Actions Object Structure +actions: + allowedDomains: + - "swapi.dev" + - "librechat.ai" + - "google.com" + +# Example MCP Servers Object Structure +mcpServers: + everything: + # type: sse # type can optionally be omitted + url: http://localhost:3001/sse + puppeteer: + type: stdio + command: npx + args: + - -y + - "@modelcontextprotocol/server-puppeteer" + filesystem: + # type: stdio + command: npx + args: + - -y + - "@modelcontextprotocol/server-filesystem" + - /home/user/LibreChat/ + iconPath: /home/user/LibreChat/client/public/assets/logo.svg + mcp-obsidian: + command: npx + args: + - -y + - "mcp-obsidian" + - /path/to/obsidian/vault + +# Definition of custom endpoints +endpoints: + # assistants: + # disableBuilder: false # Disable Assistants Builder Interface by setting to `true` + # pollIntervalMs: 3000 # Polling interval for checking assistant updates + # timeoutMs: 180000 # Timeout for assistant operations + # # Should only be one or the other, either `supportedIds` or `excludedIds` + # supportedIds: ["asst_supportedAssistantId1", "asst_supportedAssistantId2"] + # # excludedIds: ["asst_excludedAssistantId"] + # Only show assistants that the user created or that were created externally (e.g. in Assistants playground). + # # privateAssistants: false # Does not work with `supportedIds` or `excludedIds` + # # (optional) Models that support retrieval, will default to latest known OpenAI models that support the feature + # retrievalModels: ["gpt-4-turbo-preview"] + # # (optional) Assistant Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below. + # capabilities: ["code_interpreter", "retrieval", "actions", "tools", "image_vision"] + # agents: + # (optional) Maximum recursion depth for agents, defaults to 25 + # recursionLimit: 50 + # (optional) Disable the builder interface for agents + # disableBuilder: false + # (optional) Agent Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below. + # capabilities: ["execute_code", "file_search", "actions", "tools"] + custom: + +# # Ollama +# - name: "Ollama" +# apiKey: "ollama" +# # use 'host.docker.internal' instead of localhost if running LibreChat in a docker container +# baseURL: "http://ollama:11434/v1/" +# models: +# default: [ +# "llama3.2:3b" +# ] +# # fetching list of models is supported but the `name` field must start +# # with `ollama` (case-insensitive), as it does in this example. +# fetch: true +# titleConvo: true +# titleModel: "current_model" +# summarize: false +# summaryModel: "current_model" +# forcePrompt: false +# modelDisplayLabel: "Ollama" + + #LiteLLM + - name: "SURF" + apiKey: '${LITE_LLAMA_API_KEY}' + baseURL: "https://willma.liza.surf.nl/api/" + # if using LiteLLM example in docker-compose.override.yml.example, use "http://litellm:8000/v1" + models: + default: [ "Llama 3.1 8B Instruct" ] + fetch: true + titleConvo: true + titleModel: "Llama 3.1 8B Instruct" + summarize: false + summaryModel: "Llama 3.1 8B Instruct" + forcePrompt: false + modelDisplayLabel: "SURF" + # Groq + - name: "groq" + apiKey: "${GROQ_API_KEY}" + baseURL: "https://api.groq.com/openai/v1/" + models: + default: [ + "llama3-70b-8192", + "llama3.2-90b-vision-preview", + "deepseek-r1-distill-llama-70b", + ] + fetch: false + titleConvo: true + titleModel: "llama3.2-90b-vision-preview" + modelDisplayLabel: "Groq" + +# # Groq Example +# - name: 'groq' +# apiKey: '${GROQ_API_KEY}' +# baseURL: 'https://api.groq.com/openai/v1/' +# models: +# default: +# [ +# 'llama3-70b-8192', +# 'llama3-8b-8192', +# 'llama2-70b-4096', +# 'mixtral-8x7b-32768', +# 'gemma-7b-it', +# ] +# fetch: false +# titleConvo: true +# titleModel: 'mixtral-8x7b-32768' +# modelDisplayLabel: 'groq' +# +# # Mistral AI Example +# - name: 'Mistral' # Unique name for the endpoint +# # For `apiKey` and `baseURL`, you can use environment variables that you define. +# # recommended environment variables: +# apiKey: '${MISTRAL_API_KEY}' +# baseURL: 'https://api.mistral.ai/v1' +# +# # Models configuration +# models: +# # List of default models to use. At least one value is required. +# default: ['mistral-tiny', 'mistral-small', 'mistral-medium'] +# # Fetch option: Set to true to fetch models from API. +# fetch: true # Defaults to false. +# +# # Optional configurations +# +# # Title Conversation setting +# titleConvo: true # Set to true to enable title conversation +# +# # Title Method: Choose between "completion" or "functions". +# # titleMethod: "completion" # Defaults to "completion" if omitted. +# +# # Title Model: Specify the model to use for titles. +# titleModel: 'mistral-tiny' # Defaults to "gpt-3.5-turbo" if omitted. +# +# # Summarize setting: Set to true to enable summarization. +# # summarize: false +# +# # Summary Model: Specify the model to use if summarization is enabled. +# # summaryModel: "mistral-tiny" # Defaults to "gpt-3.5-turbo" if omitted. +# +# # Force Prompt setting: If true, sends a `prompt` parameter instead of `messages`. +# # forcePrompt: false +# +# # The label displayed for the AI model in messages. +# modelDisplayLabel: 'Mistral' # Default is "AI" when not set. +# +# # Add additional parameters to the request. Default params will be overwritten. +# # addParams: +# # safe_prompt: true # This field is specific to Mistral AI: https://docs.mistral.ai/api/ +# +# # Drop Default params parameters from the request. See default params in guide linked below. +# # NOTE: For Mistral, it is necessary to drop the following parameters or you will encounter a 422 Error: +# dropParams: ['stop', 'user', 'frequency_penalty', 'presence_penalty'] + + + + +# fileConfig: +# endpoints: +# assistants: +# fileLimit: 5 +# fileSizeLimit: 10 # Maximum size for an individual file in MB +# totalSizeLimit: 50 # Maximum total size for all files in a single request in MB +# supportedMimeTypes: +# - "image/.*" +# - "application/pdf" +# openAI: +# disabled: true # Disables file uploading to the OpenAI endpoint +# default: +# totalSizeLimit: 20 +# YourCustomEndpointName: +# fileLimit: 2 +# fileSizeLimit: 5 +# serverFileSizeLimit: 100 # Global server file size limit in MB +# avatarSizeLimit: 2 # Limit for user avatar image size in MB +# See the Custom Configuration Guide for more information on Assistants Config: +# https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/assistants_endpoint diff --git a/wait_for_ollama.sh b/wait_for_ollama.sh new file mode 100644 index 000000000000..b5c459dacf71 --- /dev/null +++ b/wait_for_ollama.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Start Ollama in the background. +/bin/ollama serve & + +# Record Process ID. +pid=$! + +# Pause for Ollama to start. +sleep 5 + +echo "🔴 Retrieve openchat model..." +ollama pull llama3.2:3b +echo "🟢 Done!" + +# Wait for Ollama process to finish. +wait $pid \ No newline at end of file