-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.env.example
More file actions
181 lines (133 loc) · 4.29 KB
/
.env.example
File metadata and controls
181 lines (133 loc) · 4.29 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# ============================================================
# Environment Variables Template
# ============================================================
#
# 使用方式:
# 1. 複製此文件: cp .env.example .env
# 2. 填入您的 API 金鑰和配置
# 3. .env 文件已被 .gitignore 忽略,不會被提交到 Git
#
# ============================================================
# ==================== LLM API 金鑰 ====================
# OpenAI API
OPENAI_API_KEY=sk-your-openai-api-key-here
OPENAI_ORG_ID= # 可選
OPENAI_BASE_URL=https://api.openai.com/v1 # 可自定義
# Anthropic API (Claude)
ANTHROPIC_API_KEY=sk-ant-your-anthropic-api-key-here
# Google Gemini API
GOOGLE_API_KEY=your-google-api-key-here
# Cohere API
COHERE_API_KEY=your-cohere-api-key-here
# Hugging Face
HUGGINGFACE_API_KEY=hf_your-huggingface-token-here
# ==================== 向量數據庫 ====================
# Pinecone
PINECONE_API_KEY=your-pinecone-api-key-here
PINECONE_ENVIRONMENT=your-environment
# Weaviate
WEAVIATE_URL=http://localhost:8080
WEAVIATE_API_KEY=your-weaviate-api-key-here
# Qdrant
QDRANT_URL=http://localhost:6333
QDRANT_API_KEY=your-qdrant-api-key-here
# ==================== 搜尋 API ====================
# SerpAPI (Google Search)
SERPAPI_API_KEY=your-serpapi-key-here
# Tavily Search
TAVILY_API_KEY=your-tavily-key-here
# ==================== 監控與追蹤 ====================
# LangSmith
LANGCHAIN_TRACING_V2=true
LANGCHAIN_API_KEY=your-langsmith-api-key-here
LANGCHAIN_PROJECT=my-ai-learning-project
LANGCHAIN_ENDPOINT=https://api.smith.langchain.com
# Weights & Biases
WANDB_API_KEY=your-wandb-api-key-here
WANDB_PROJECT=my-ai-learning
WANDB_ENTITY=your-wandb-username
# MLflow
MLFLOW_TRACKING_URI=http://localhost:5000
# LangFuse
LANGFUSE_PUBLIC_KEY=your-langfuse-public-key
LANGFUSE_SECRET_KEY=your-langfuse-secret-key
LANGFUSE_HOST=https://cloud.langfuse.com
# ==================== 數據庫 ====================
# PostgreSQL (用於向量存儲)
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=vectordb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your-password
# MongoDB
MONGODB_URI=mongodb://localhost:27017/ai_learning
# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your-redis-password
# ==================== 應用配置 ====================
# 環境類型
ENVIRONMENT=development # development, staging, production
# 日誌級別
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR, CRITICAL
# API 服務配置
API_HOST=0.0.0.0
API_PORT=8000
API_WORKERS=4
# ==================== 模型配置 ====================
# 默認模型
DEFAULT_LLM_MODEL=gpt-4o-mini
DEFAULT_EMBEDDING_MODEL=text-embedding-3-small
# 模型參數
LLM_TEMPERATURE=0.7
LLM_MAX_TOKENS=2000
LLM_TOP_P=0.9
# ==================== RAG 配置 ====================
# 向量數據庫類型
VECTOR_DB=chromadb # chromadb, faiss, pinecone, qdrant
# 檢索配置
RETRIEVAL_TOP_K=5
CHUNK_SIZE=1000
CHUNK_OVERLAP=200
# ==================== 安全配置 ====================
# JWT 密鑰
JWT_SECRET_KEY=your-super-secret-jwt-key-change-in-production
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24
# CORS 設定
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8501
# ==================== 其他服務 ====================
# Ollama (本地 LLM)
OLLAMA_HOST=http://localhost:11434
# Elasticsearch
ELASTICSEARCH_URL=http://localhost:9200
ELASTICSEARCH_API_KEY=your-elasticsearch-api-key
# ==================== 代理設定 ====================
# HTTP 代理 (如需要)
HTTP_PROXY=
HTTPS_PROXY=
NO_PROXY=localhost,127.0.0.1
# ==================== 開發工具 ====================
# 是否啟用調試模式
DEBUG=true
# 是否啟用熱重載
RELOAD=true
# ==================== 雲端服務 ====================
# AWS
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-s3-bucket
# Google Cloud
GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
GCP_PROJECT_ID=your-gcp-project-id
# Azure
AZURE_SUBSCRIPTION_ID=your-azure-subscription-id
AZURE_RESOURCE_GROUP=your-resource-group
# ==================== 提醒 ====================
# 🔒 請確保:
# 1. 不要將 .env 文件提交到版本控制
# 2. 生產環境使用強密碼
# 3. 定期輪換 API 金鑰
# 4. 使用環境變量管理敏感信息
# ============================================================