OpenHuman 指南

配置教程

OpenHuman config.toml 完全指南 — 所有参数详解

2026-05-25约 8 分钟阅读

OpenHuman 的核心配置文件是 config.toml,控制着模型、记忆、语音、网络等所有行为。本文逐个参数讲解作用和推荐值。

config.toml 在哪?

  • macOS:~/.openhuman/config.toml
  • Windows:%USERPROFILE%\.openhuman\config.toml
  • Linux:~/.openhuman/config.toml

模型配置 [models]

[models]
# 快速模型(日常对话、简单查询)
fast = {
  provider = "openai_compatible",    # 可选: openai, openai_compatible, ollama
  model = "gpt-4o-mini",             # 模型名称
  base_url = "https://api.openai.com/v1",  # API 端点
  api_key = "sk-xxx",                # API Key
  max_tokens = 4096,                 # 最大输出 Token
  temperature = 0.7                  # 创造性(0-2)
}

# 推理模型(复杂任务、编码、分析)
reasoning = {
  provider = "openai_compatible",
  model = "deepseek-reasoner",
  base_url = "https://api.deepseek.com/v1",
  api_key = "sk-xxx"
}

# 视觉模型(图片分析)
vision = {
  provider = "openai_compatible",
  model = "gpt-4o",
  base_url = "https://api.openai.com/v1",
  api_key = "sk-xxx"
}

记忆系统 [memory]

[memory]
backend = "sqlite"                    # 存储后端: sqlite, postgres
sync_interval_minutes = 20            # Auto-fetch 同步频率
max_token_budget = 3000               # 每个记忆块最大 Token
obsidian_vault_path = "/path/vault"   # Obsidian 导出路径(可选)
connection_string = ""                # 远程数据库连接(postgres 时使用)

TokenJuice [token_juice]

[token_juice]
enabled = true                        # 是否启用
compression_level = "balanced"        # mild / balanced / aggressive
max_chunk_tokens = 3000               # 压缩块上限
preserve_structure = true             # 保留 JSON 结构

语音 [voice]

[voice]
stt_engine = "whisper"                # 语音识别引擎
tts_engine = "system"                 # 语音合成: system, elevenlabs
elevenlabs_api_key = ""               # ElevenLabs Key
elevenlabs_voice_id = "21m00Tcm4TlvDq8ikWAM"  # 音色 ID

Web 和搜索 [web]

[web]
search_enabled = true                 # 联网搜索开关
scraper_enabled = true                # 网页抓取开关
proxy = ""                            # HTTP 代理(如 http://127.0.0.1:7890)
user_agent = "OpenHuman/1.0"          # 自定义 UA

模型路由 [model_routing]

[model_routing]
default = "fast"                      # 默认路由
keyword_trigger = ["写代码", "分析"]   # 触发推理模型的关键词
image_task = "vision"                 # 图片任务路由

完整示例配置

适合中国用户的推荐配置:

[models]
fast = { provider = "openai_compatible", model = "deepseek-chat", base_url = "https://api.deepseek.com/v1", api_key = "sk-ds" }
reasoning = { provider = "openai_compatible", model = "deepseek-reasoner", base_url = "https://api.deepseek.com/v1", api_key = "sk-ds" }
vision = { provider = "openai_compatible", model = "gpt-4o-mini", base_url = "https://api.openai.com/v1", api_key = "sk-oai" }

[memory]
backend = "sqlite"
sync_interval_minutes = 20
max_token_budget = 3000

[token_juice]
enabled = true
compression_level = "aggressive"

[voice]
tts_engine = "system"

[web]
search_enabled = true
scraper_enabled = true

相关阅读