- Add providers.py with 5 provider presets (OpenAI, DeepSeek, Xiaomi MiMo, Alibaba DashScope, MiniMax) - Add LLM_PROVIDER env var for one-line provider switching - Improve <think> tag stripping for reasoning models - Add .env.example with documented configuration - Update README with provider configuration section
105 lines
3.8 KiB
Plaintext
105 lines
3.8 KiB
Plaintext
# ================================================================
|
||
# MiroFish 环境变量配置
|
||
# ================================================================
|
||
# 复制此文件为 .env 并填入你的 API 密钥:
|
||
# cp .env.example .env
|
||
#
|
||
# LLM 配置支持两种方式:
|
||
# 方式1(推荐):设置 LLM_PROVIDER,只需提供 API Key
|
||
# 方式2(灵活):手动指定 LLM_BASE_URL 和 LLM_MODEL_NAME
|
||
# ================================================================
|
||
|
||
|
||
# ================================================================
|
||
# 方式1:使用提供商预设(推荐)
|
||
# ================================================================
|
||
# 取消注释你要使用的提供商,然后填入对应的 API Key。
|
||
# 设置 LLM_PROVIDER 后,LLM_BASE_URL 和 LLM_MODEL_NAME 会自动填充默认值。
|
||
#
|
||
# 可用的提供商:
|
||
# - openai : OpenAI GPT 系列
|
||
# - deepseek : DeepSeek (深度求索)
|
||
# - xiaomi_mimo : Xiaomi MiMo (小米 MiMo)
|
||
# - alibaba_dashscope : 阿里百炼 (通义千问)
|
||
# - minimax : MiniMax (海螺 AI)
|
||
|
||
# --- DeepSeek ---
|
||
# API Key 获取: https://platform.deepseek.com
|
||
# LLM_PROVIDER=deepseek
|
||
# LLM_API_KEY=sk-your-deepseek-key-here
|
||
|
||
# --- Xiaomi MiMo ---
|
||
# API Key 获取: https://platform.xiaomimimo.com
|
||
# LLM_PROVIDER=xiaomi_mimo
|
||
# LLM_API_KEY=your-mimo-api-key-here
|
||
|
||
# --- OpenAI ---
|
||
# API Key 获取: https://platform.openai.com/api-keys
|
||
# LLM_PROVIDER=openai
|
||
# LLM_API_KEY=sk-your-openai-key-here
|
||
|
||
# --- 阿里百炼 (通义千问) ---
|
||
# API Key 获取: https://bailian.console.aliyun.com/
|
||
# 注意消耗较大,可先进行小于40轮的模拟尝试
|
||
# LLM_PROVIDER=alibaba_dashscope
|
||
# LLM_API_KEY=sk-your-dashscope-key-here
|
||
|
||
# --- MiniMax (海螺 AI) ---
|
||
# API Key 获取: https://platform.minimaxi.com/
|
||
# LLM_PROVIDER=minimax
|
||
# LLM_API_KEY=your-minimax-key-here
|
||
|
||
|
||
# ================================================================
|
||
# 方式2:手动指定配置(兼容原有方式)
|
||
# ================================================================
|
||
# 如果不使用 LLM_PROVIDER,需要手动指定以下三个变量。
|
||
# 适用于任何兼容 OpenAI SDK 格式的 LLM API。
|
||
|
||
LLM_API_KEY=your_api_key_here
|
||
LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
|
||
LLM_MODEL_NAME=qwen-plus
|
||
|
||
|
||
# ================================================================
|
||
# Zep 记忆图谱配置(必需)
|
||
# ================================================================
|
||
# 每月免费额度即可支撑简单使用
|
||
# 获取地址: https://app.getzep.com/
|
||
ZEP_API_KEY=your_zep_api_key_here
|
||
|
||
|
||
# ================================================================
|
||
# 加速 LLM 配置(可选)
|
||
# ================================================================
|
||
# 注意:如果不使用加速配置,env文件中就不要出现下面的配置项
|
||
# LLM_BOOST_API_KEY=your_api_key_here
|
||
# LLM_BOOST_BASE_URL=your_base_url_here
|
||
# LLM_BOOST_MODEL_NAME=your_model_name_here
|
||
|
||
|
||
# ================================================================
|
||
# 提供商配置示例(完整示例,取消注释即可使用)
|
||
# ================================================================
|
||
|
||
# ---- DeepSeek 完整示例 ----
|
||
# LLM_PROVIDER=deepseek
|
||
# LLM_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||
# # 以下可省略(使用默认值):
|
||
# # LLM_BASE_URL=https://api.deepseek.com/v1
|
||
# # LLM_MODEL_NAME=deepseek-chat
|
||
|
||
# ---- Xiaomi MiMo 完整示例 ----
|
||
# LLM_PROVIDER=xiaomi_mimo
|
||
# LLM_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||
# # 以下可省略(使用默认值):
|
||
# # LLM_BASE_URL=https://api.xiaomimimo.com/v1
|
||
# # LLM_MODEL_NAME=mimo-v2.5-pro
|
||
|
||
# ---- 阿里百炼 完整示例 ----
|
||
# LLM_PROVIDER=alibaba_dashscope
|
||
# LLM_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||
# # 以下可省略(使用默认值):
|
||
# # LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
|
||
# # LLM_MODEL_NAME=qwen-plus
|