Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
114 lines (101 loc) · 4.55 KB
/
Copy path.env.example
File metadata and controls
114 lines (101 loc) · 4.55 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
# CodeRAG Environment Configuration
# Copy this file to .env and customize as needed
# =============================================================================
# QUICK START (no GPU required):
# 1. Copy this file: cp .env.example .env
# 2. Get free API key from https://console.groq.com/keys
# 3. Set MODEL_LLM_API_KEY below
# 4. Run: python -m coderag.main
# =============================================================================
# =============================================================================
# Application Settings
# =============================================================================
DEBUG=false
APP_NAME=CodeRAG
APP_VERSION=0.1.2
# =============================================================================
# Server Settings
# =============================================================================
SERVER_HOST=127.0.0.1
SERVER_PORT=8000
SERVER_LOG_LEVEL=info
SERVER_WORKERS=1
SERVER_RELOAD=false
# CORS defaults trust only loopback browser origins.
# Use JSON list syntax when overriding through environment variables.
SERVER_CORS_ALLOWED_ORIGINS='["http://127.0.0.1:8000","http://localhost:8000"]'
SERVER_CORS_ALLOW_CREDENTIALS=true
# =============================================================================
# Model Settings
# =============================================================================
# Provider profile: "cloud", "hybrid", "private", or "retrieval-only".
# This M1 setting is a service-level foundation; retrieval-only disables generation-provider requirements.
MODEL_PROFILE=cloud
# LLM Provider: "local", "openai", "groq", "anthropic", "openrouter", "together"
# Default: "groq" (free tier, no GPU required). Use "local" for on-device inference (requires GPU)
MODEL_LLM_PROVIDER=groq
# API Configuration (required for non-local providers)
# Get your API key from:
# - Groq (FREE, fast): https://console.groq.com/keys
# - OpenAI: https://platform.openai.com/api-keys
# - Anthropic: https://console.anthropic.com/settings/keys
# - OpenRouter: https://openrouter.ai/keys
# - Together: https://api.together.xyz/settings/api-keys
MODEL_LLM_API_KEY=
MODEL_LLM_API_BASE=
# LLM Model Configuration
# For groq: llama-3.3-70b-versatile (default), mixtral-8x7b-32768
# For openai: gpt-4o-mini (default), gpt-4o, gpt-4-turbo
# For anthropic: claude-3-5-sonnet-20241022 (default)
# For openrouter: anthropic/claude-3.5-sonnet (default)
# For together: meta-llama/Llama-3.3-70B-Instruct-Turbo (default)
# For local: Qwen/Qwen2.5-Coder-3B-Instruct (requires GPU with 8GB VRAM)
MODEL_LLM_NAME=llama-3.3-70b-versatile
MODEL_LLM_MAX_NEW_TOKENS=1024
# Remote model repository code execution is disabled by default.
# Set true only after reviewing and pinning the model source.
MODEL_ALLOW_REMOTE_CODE=false
MODEL_LLM_TEMPERATURE=0.1
MODEL_LLM_TOP_P=0.95
MODEL_LLM_USE_4BIT=true
MODEL_LLM_DEVICE_MAP=auto
# Embedding Configuration
MODEL_EMBEDDING_NAME=nomic-ai/nomic-embed-text-v1.5
MODEL_EMBEDDING_DIMENSION=768
MODEL_EMBEDDING_BATCH_SIZE=32 # 32 for CPU, reduce to 8 if using GPU with limited VRAM
# Device: "auto" (recommended), "cuda", or "cpu"
MODEL_EMBEDDING_DEVICE=auto
# =============================================================================
# Vector Store Settings
# =============================================================================
VECTORSTORE_PERSIST_DIRECTORY=./data/chroma_db
VECTORSTORE_COLLECTION_NAME=coderag_chunks
VECTORSTORE_DISTANCE_METRIC=cosine
VECTORSTORE_ANONYMIZED_TELEMETRY=false
# =============================================================================
# Ingestion Settings
# =============================================================================
INGESTION_REPOS_CACHE_DIR=./data/repos
INGESTION_MAX_FILE_SIZE_KB=500
INGESTION_DEFAULT_BRANCH=main
INGESTION_CHUNK_SIZE=1500
INGESTION_CHUNK_OVERLAP=200
# Large Repository Handling
INGESTION_MAX_FILES_PER_REPO=5000
INGESTION_MAX_TOTAL_CHUNKS=50000
INGESTION_BATCH_SIZE=100
INGESTION_STREAM_PROCESSING=true
INGESTION_WARN_FILES_THRESHOLD=1000
INGESTION_WARN_CHUNKS_THRESHOLD=10000
# =============================================================================
# Retrieval Settings
# =============================================================================
RETRIEVAL_DEFAULT_TOP_K=5
RETRIEVAL_MAX_TOP_K=20
RETRIEVAL_SIMILARITY_THRESHOLD=0.3
# =============================================================================
# HuggingFace Settings (Optional)
# =============================================================================
# HF_HOME=./data/hf_cache
# TRANSFORMERS_CACHE=./data/hf_cache
# HF_TOKEN=your_token_here # Only needed for gated models