Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
75 lines (60 loc) · 2.72 KB
/
Copy path.env.example
File metadata and controls
75 lines (60 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Audison 环境配置
# 复制此文件为 .env 并填入真实值
# cp .env.example .env
# ====================
# 快速上手(单 key 即可运行)
# ====================
# 只需一个 API key,框架会自动为 brain2 选择同提供商的更便宜模型。
# 示例:brain1 = gpt-4o → brain2 自动降级为 gpt-4o-mini
#
# 如果同时配置两个 key → 跨提供商质检效果最佳!
# OpenAI API Key(必填,单 key 模式下只用这一个)
OPENAI_API_KEY=sk-your-openai-api-key
# Anthropic API Key(可选,双 key 模式下使用)
# 配置后 brain2 将自动使用 Claude 模型,实现跨提供商质检
ANTHROPIC_API_KEY=sk-ant-your-anthropic-api-key
# ====================
# 更多提供商(可选)
# ====================
# 以下提供商支持 OpenAI 兼容接口,可直接使用。
# 降级路径已配置在 models.yaml 的 fallbacks 段中。
# 通义千问(DashScope)
# 官网:https://dashscope.console.aliyun.com/
# 模型:qwen-max、qwen-plus、qwen-turbo
# DASHSCOPE_API_KEY=sk-your-dashscope-api-key
# 智谱 GLM
# 官网:https://open.bigmodel.cn/
# 模型:glm-4、glm-4-flash、glm-3-turbo
# ZHIPU_API_KEY=your-zhipu-api-key
# 月之暗面 Kimi
# 官网:https://platform.moonshot.cn/
# 模型:moonshot-v1-8k、moonshot-v1-32k、moonshot-v1-128k
# MOONSHOT_API_KEY=sk-your-moonshot-api-key
# DeepSeek
# 官网:https://platform.deepseek.com/
# 模型:deepseek-chat、deepseek-coder
# DEEPSEEK_API_KEY=sk-your-deepseek-api-key
# ====================
# 其他可选配置
# ====================
# Redis 缓存(可选,默认使用内存缓存)
# REDIS_URL=redis://localhost:6379/0
# Ollama 本地模型(可选,免费,适合 brain2 或专家节点)
# 1. 安装:brew install ollama(macOS)或从 ollama.com 下载
# 2. 启动服务:ollama serve
# 3. 下载模型:ollama pull llama3 && ollama pull codellama
# 4. 使用方式:audison audit file.py -r "..." --local
# 或指定模型:audison audit file.py -r "..." --local --model1 llama3 --model2 codellama
# 注意:模型名和 Ollama 官方一致,不需要加 ollama- 前缀
# ⚠️ 精度提示:本地模型检测率约 50-60%,云端模式约 85%+。仅建议在代码隐私敏感的
# 场景下使用本地模式,生产审计请使用云端模式。
# ====================
# 自定义 OpenAI 兼容接口(可选)
# ====================
# 如果你有其他 OpenAI 兼容的 API(如 vLLM、LocalAI、其他代理服务等)
# 可以通过以下环境变量配置
# 自定义 API Key
# CUSTOM_API_KEY=sk-your-custom-api-key
# 自定义 Base URL(OpenAI 兼容接口地址)
# CUSTOM_BASE_URL=https://your-custom-api.com/v1
# 使用方式:brain1 = "custom-model" 或 brain2 = "custom-model"