juechafun/02-领域/觉察知识/觉察-LibreChat接入第三方模型.md

6.1 KiB
Raw Permalink Blame History


#领域/未知

#复盘/0 #临时/备忘 #状态/待处理

一句话描述

[LibreChat 接入第三方模型配置]


涉及文件librechat.yaml

endpoints:
  custom:
    - name: "Deepseek"
      apiKey: "${OPENAI_DEEPSEEK_API_KEY}"
      baseURL: "https://api.deepseek.com/v1"
      models:
        default: ["deepseek-v4-pro", "deepseek-chat", "deepseek-coder", "deepseek-reasoner"]
        fetch: false
      titleConvo: true
      titleModel: "deepseek-chat"
      modelDisplayLabel: "Deepseek"
  
    - name: "Alibailian"
      apiKey: "${OPENAI_ALIBAILIAN_API_KEY}"
      baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1"
      models:
        default: ["qwen3.6-flash-2026-04-16"]
        fetch: false
      titleConvo: true
      titleModel: "qwen3.6-flash-2026-04-16"
      modelDisplayLabel: "Qwen3"

    - name: "MaxKB"
      apiKey: "agent-d399a24728ebca8b87193326e4963617"
      baseURL: "http://192.168.0.151:8080/chat/api/019e0542-74a5-77d2-8b64-8ba18457b4d3"
      models:
        default: ["maxkb-chat"]
        fetch: false
      titleConvo: true
      titleModel: "maxkb-chat"
      modelDisplayLabel: "MaxKB"

    - name: "NewAPI"
      apiKey: "sk-uZLkkoRuA2KZc0nSIWWiZzO1WTNMKpHkc6Rw1mAPCwoFAOKS"
      baseURL: "http://192.168.0.151:30104/v1" # 把localhost换成你NewAPI的实际IP
      models:
        default: ["juecha", "qwen3.5:9b", "qwen3.6:27b"]
        fetch: false
      titleConvo: false
      modelDisplayLabel: "NewAPI"
      type: "openai"

    # 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.
      # 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']

    # OpenRouter Example
    - name: 'OpenRouter'
      # For `apiKey` and `baseURL`, you can use environment variables that you define.
      # recommended environment variables:
      apiKey: '${OPENROUTER_KEY}'
      baseURL: 'https://openrouter.ai/api/v1'
      headers:
        x-librechat-body-parentmessageid: '{{LIBRECHAT_BODY_PARENTMESSAGEID}}'
      models:
        default: ['meta-llama/llama-3-70b-instruct']
        fetch: true
      titleConvo: true
      titleModel: 'meta-llama/llama-3-70b-instruct'
      # Recommended: Drop the stop parameter from the request as Openrouter models use a variety of stop tokens.
      dropParams: ['stop']
      modelDisplayLabel: 'OpenRouter'

    # Helicone Example
    - name: 'Helicone'
      # For `apiKey` and `baseURL`, you can use environment variables that you define.
      # recommended environment variables:
      apiKey: '${HELICONE_KEY}'
      baseURL: 'https://ai-gateway.helicone.ai'
      headers:
        x-librechat-body-parentmessageid: '{{LIBRECHAT_BODY_PARENTMESSAGEID}}'
      models:
        default:
          ['gpt-4o-mini', 'claude-4.5-sonnet', 'llama-3.1-8b-instruct', 'gemini-2.5-flash-lite']
        fetch: true
      titleConvo: true
      titleModel: 'gpt-4o-mini'
      modelDisplayLabel: 'Helicone'
      iconURL: https://marketing-assets-helicone.s3.us-west-2.amazonaws.com/helicone.png

    # Portkey AI Example
    - name: 'Portkey'
      apiKey: 'dummy'
      baseURL: 'https://api.portkey.ai/v1'
      headers:
        x-portkey-api-key: '${PORTKEY_API_KEY}'
        x-portkey-virtual-key: '${PORTKEY_OPENAI_VIRTUAL_KEY}'
      models:
        default: ['gpt-4o-mini', 'gpt-4o', 'chatgpt-4o-latest']
        fetch: true
      titleConvo: true
      titleModel: 'current_model'
      summarize: false
      summaryModel: 'current_model'
      modelDisplayLabel: 'Portkey'
      iconURL: https://images.crunchbase.com/image/upload/c_pad,f_auto,q_auto:eco,dpr_1/rjqy7ghvjoiu4cd1xjbf

注意:请忽略以下内容

输出内容