Spaces:
Running
Running
Upload llm.py
Browse files- 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
|
| 97 |
-
|
|
|
|
| 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
|
| 110 |
fallback_models = [
|
| 111 |
-
"google/gemma-3-4b-it:free",
|
| 112 |
"qwen/qwen3-coder:free",
|
| 113 |
-
"
|
| 114 |
-
"google/gemma-3-
|
| 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
|