Vishwanath77 commited on
Commit
028cbc2
·
verified ·
1 Parent(s): 139d9ec

Upload llm.py

Browse files
Files changed (1) hide show
  1. src/apps/utils/llm.py +6 -6
src/apps/utils/llm.py CHANGED
@@ -93,8 +93,9 @@ Chat History: {chat_history}
93
  "Set OPENROUTER_API_KEY in src/apps/.env (get a key at https://openrouter.ai/keys)"
94
  )
95
 
96
- # Switched to Llama 3.2 3B as primary to avoid 429 Rate Limits
97
- primary_model = "meta-llama/llama-3.2-3b-instruct:free"
 
98
 
99
  # Initialize client with recommended OpenRouter headers
100
  client = openai.OpenAI(
@@ -106,12 +107,11 @@ Chat History: {chat_history}
106
  }
107
  )
108
 
109
- # Reordered fallbacks to put stable models first
110
  fallback_models = [
111
- "google/gemma-3-4b-it:free",
112
  "qwen/qwen3-coder:free",
113
- "google/gemma-3-12b-it:free",
114
- "google/gemma-3-27b-it:free"
115
  ]
116
 
117
  current_model = primary_model
 
93
  "Set OPENROUTER_API_KEY in src/apps/.env (get a key at https://openrouter.ai/keys)"
94
  )
95
 
96
+ # Switched to Mistral Small 3.1 to avoid "PROHIBITED_CONTENT" errors
97
+ # Mistral is much better for professional/legal reasoning without over-censorship.
98
+ primary_model = "mistralai/mistral-small-3.1-24b-instruct:free"
99
 
100
  # Initialize client with recommended OpenRouter headers
101
  client = openai.OpenAI(
 
107
  }
108
  )
109
 
110
+ # Reordered fallbacks
111
  fallback_models = [
 
112
  "qwen/qwen3-coder:free",
113
+ "meta-llama/llama-3.2-3b-instruct:free",
114
+ "google/gemma-3-4b-it:free"
115
  ]
116
 
117
  current_model = primary_model