Rajan Sharma commited on
Commit
04c0a3b
·
verified ·
1 Parent(s): 72ef4de

Update settings.py

Browse files
Files changed (1) hide show
  1. settings.py +18 -13
settings.py CHANGED
@@ -1,29 +1,36 @@
1
  import os
2
  from typing import Dict, Any, List
3
 
4
- # Residency / deployment guidance (enforce in your infra)
5
  CANADA_RESIDENCY_REQUIRED = True
6
- CLOUD_REGION = os.getenv("CLOUD_REGION", "ca-central-1")
7
 
8
- # Keys
9
  COHERE_API_KEY = os.getenv("COHERE_API_KEY", "")
 
 
 
10
 
11
- # Cohere models (ask Cohere for larger/custom healthcare)
12
  COHERE_MODEL_PRIMARY = os.getenv("COHERE_MODEL_PRIMARY", "command-r")
13
  COHERE_EMBED_MODEL = os.getenv("COHERE_EMBED_MODEL", "embed-english-v3.0")
14
 
15
- # Open-model fallbacks (largest first; will try in order)
 
 
 
 
16
  OPEN_LLM_CANDIDATES: List[str] = [
17
- "Qwen/Qwen2.5-72B-Instruct", # large & open weights
18
- "meta-llama/Meta-Llama-3.1-70B-Instruct", # large (requires strong GPUs)
19
- "mistralai/Mixtral-8x22B-Instruct-v0.1", # MoE, open
20
- "NousResearch/Meta-Llama-3.1-8B-Instruct", # smaller safety net
21
- "mistralai/Mistral-7B-Instruct-v0.3"
22
  ]
23
 
24
  LOCAL_MAX_NEW_TOKENS = int(os.getenv("LOCAL_MAX_NEW_TOKENS", "1200"))
25
 
26
- # App knobs
27
  MODEL_SETTINGS: Dict[str, Any] = {
28
  "temperature": float(os.getenv("TEMP", "0.3")),
29
  "top_p": float(os.getenv("TOP_P", "0.9")),
@@ -47,10 +54,8 @@ HEALTHCARE_SYSTEM_PROMPT = (
47
  "Do not invent numbers."
48
  )
49
 
50
- # Feature flags
51
  USE_SCENARIO_ENGINE = os.getenv("USE_SCENARIO_ENGINE", "1") not in ("0", "false", "False")
52
 
53
- # Storage
54
  DATA_DIR = os.getenv("DATA_DIR", "./data")
55
  RAG_INDEX_DIR = os.getenv("RAG_INDEX_DIR", "./rag_index")
56
  PERSIST_CONTENT = False
 
1
  import os
2
  from typing import Dict, Any, List
3
 
4
+ # ===== Residency / Deployment =====
5
  CANADA_RESIDENCY_REQUIRED = True
6
+ CLOUD_REGION = os.getenv("CLOUD_REGION", "ca") # e.g., "ca" or "us"
7
 
8
+ # ===== Cohere API =====
9
  COHERE_API_KEY = os.getenv("COHERE_API_KEY", "")
10
+ # Optional: override Cohere API url/region if your enterprise deployment provides one
11
+ COHERE_API_URL = os.getenv("COHERE_API_URL", "") # leave blank to use default SDK endpoint
12
+ COHERE_TIMEOUT_S = float(os.getenv("COHERE_TIMEOUT_S", "45"))
13
 
14
+ # Cohere models (ask Cohere for larger/custom healthcare models as needed)
15
  COHERE_MODEL_PRIMARY = os.getenv("COHERE_MODEL_PRIMARY", "command-r")
16
  COHERE_EMBED_MODEL = os.getenv("COHERE_EMBED_MODEL", "embed-english-v3.0")
17
 
18
+ # ===== Fallbacks (OPEN MODELS ONLY) =====
19
+ # By request, we default to Cohere-only. Set to "1" to allow open-model fallbacks.
20
+ USE_OPEN_FALLBACKS = os.getenv("USE_OPEN_FALLBACKS", "0") in ("1", "true", "True")
21
+
22
+ # Largest-first open models if fallbacks are enabled
23
  OPEN_LLM_CANDIDATES: List[str] = [
24
+ "Qwen/Qwen2.5-72B-Instruct",
25
+ "meta-llama/Meta-Llama-3.1-70B-Instruct",
26
+ "mistralai/Mixtral-8x22B-Instruct-v0.1",
27
+ "NousResearch/Meta-Llama-3.1-8B-Instruct",
28
+ "mistralai/Mistral-7B-Instruct-v0.3",
29
  ]
30
 
31
  LOCAL_MAX_NEW_TOKENS = int(os.getenv("LOCAL_MAX_NEW_TOKENS", "1200"))
32
 
33
+ # ===== App Knobs =====
34
  MODEL_SETTINGS: Dict[str, Any] = {
35
  "temperature": float(os.getenv("TEMP", "0.3")),
36
  "top_p": float(os.getenv("TOP_P", "0.9")),
 
54
  "Do not invent numbers."
55
  )
56
 
 
57
  USE_SCENARIO_ENGINE = os.getenv("USE_SCENARIO_ENGINE", "1") not in ("0", "false", "False")
58
 
 
59
  DATA_DIR = os.getenv("DATA_DIR", "./data")
60
  RAG_INDEX_DIR = os.getenv("RAG_INDEX_DIR", "./rag_index")
61
  PERSIST_CONTENT = False